diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1574e650 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "noninteractive", + "pipx" + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 8bb5b5d4..1176123c 100644 --- a/Makefile +++ b/Makefile @@ -22,19 +22,19 @@ confirm: .PHONY: sqlpipe sqlpipe: build/sqlpipe docker rm -f sqlpipe - docker-compose up --build -d sqlpipe - docker-compose logs -f sqlpipe + docker compose up --build -d sqlpipe + docker compose logs -f sqlpipe .PHONY: run run: build/sqlpipe ./bin/sqlpipe -## compose-reset: run docker-compose +## compose-reset: run docker compose .PHONY: compose -compose: build/sqlpipe - docker-compose down -v - docker-compose up --build -d - docker-compose logs -f +compose: + docker compose down -v + docker compose up --build -d + docker compose logs -f ## postgresql: run postgresql .PHONY: postgresql @@ -100,8 +100,15 @@ vendor: .PHONY: build/sqlpipe build/sqlpipe: @echo 'Building cmd/sqlpipe...' - GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o=./bin/sqlpipe ./cmd/sqlpipe - # go build -ldflags="-w -s" -o=./bin/sqlpipe ./cmd/sqlpipe + # GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o=./bin/sqlpipe ./cmd/sqlpipe + go build -ldflags="-w -s" -o=./bin/sqlpipe ./cmd/sqlpipe + +## build/transfer: build the cmd/transfer application +.PHONY: build/transfer +build/transfer: + @echo 'Building cmd/transfer...' + # go build -ldflags="-w -s" -o=./bin/transfer ./cmd/transfer + GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o=./bin/transfer ./cmd/transfer ## build/docker: build the cmd/sqlpipe docker image and push .PHONY: build/docker @@ -112,3 +119,51 @@ build/docker: docker buildx build --platform linux/amd64 -t sqlpipe/sqlpipe:latest -f sqlpipe.dockerfile . --load @echo 'Pushing docker image...' docker push sqlpipe/sqlpipe:latest + +## docker/build/transferInstance: build the cmd/sqlpipe docker image and push +.PHONY: docker/build/transferInstance +docker/build/transferInstance: + @echo 'Building cmd/transferInstance...' + GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o=./bin/transferInstance ./cmd/transferInstance + @echo 'Building docker image...' + docker buildx build --platform linux/amd64 -t sqlpipe/transfer-instance:latest -f transferInstance.dockerfile . --load + +## docker/build/transferInstance: build the cmd/sqlpipe docker image and push +.PHONY: docker/build/transferInstance/arm64 +docker/build/transferInstance/arm64: + @echo 'Building cmd/transferInstance...' + GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o=./bin/transferInstance ./cmd/transferInstance + @echo 'Building docker image...' + docker buildx build --no-cache --platform linux/arm64 -t sqlpipe/transfer-instance:latest -f transferInstance.dockerfile . --load + +## docker/push/transfer: build the cmd/sqlpipe docker image and push +.PHONY: docker/push/transferInstance +docker/push/transferInstance: docker/build/transferInstance + @echo 'Pushing docker image...' + docker push sqlpipe/transfer-instance:latest + +# ==================================================================================== # +# TESTS +# ==================================================================================== # + +## build/tests: build the cmd/tests application +.PHONY: build/tests +build/tests: + @echo 'Building cmd/tests...' + # GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o=./bin/tests ./cmd/tests + go build -ldflags="-w -s" -o=./bin/tests ./cmd/tests + +## tests: run the cmd/tests application +.PHONY: tests +tests: build/tests + docker rm -f tests + docker compose up --build -d tests + +.PHONY: run-tests +run-tests: tests + ./bin/tests -postgresql-host=${POSTGRESQL_HOST} -postgresql-user=${POSTGRESQL_USER} -postgresql-password=${POSTGRESQL_PASSWORD} -postgresql-port=${POSTGRESQL_PORT} \ + -mysql-host=${MYSQL_HOST} -mysql-user=${MYSQL_USER} -mysql-password=${MYSQL_PASSWORD} -mysql-port=${MYSQL_PORT} \ + -mssql-host=${MSSQL_HOST} -mssql-user=${MSSQL_USER} -mssql-password=${MSSQL_PASSWORD} -mssql-port=${MSSQL_PORT} \ + -snowflake-account=${SNOWFLAKE_ACCOUNT} -snowflake-user=${SNOWFLAKE_USER} -snowflake-password=${SNOWFLAKE_PASSWORD} \ + -server-address=${SERVER_ADDRESS} + # -oracle-host=${ORACLE_HOST} -oracle-user=${ORACLE_USER} -oracle-password=${ORACLE_PASSWORD} -oracle-port=${ORACLE_PORT} \ \ No newline at end of file diff --git a/cmd/sqlpipe/errors.go b/cmd/serve/errors.go similarity index 78% rename from cmd/sqlpipe/errors.go rename to cmd/serve/errors.go index afd637e5..24e7e52c 100644 --- a/cmd/sqlpipe/errors.go +++ b/cmd/serve/errors.go @@ -6,7 +6,7 @@ import ( "net/http" ) -func clientErrorResponse(w http.ResponseWriter, r *http.Request, status int, err error) { +func clientErrorResponse(w http.ResponseWriter, status int, err error) { env := envelope{"error": err.Error()} err = writeJSON(w, status, env, nil) @@ -30,15 +30,15 @@ func serverErrorResponse(w http.ResponseWriter, r *http.Request, status int, err func notFoundResponse(w http.ResponseWriter, r *http.Request) { err := errors.New("the requested resource could not be found") - clientErrorResponse(w, r, http.StatusNotFound, err) + clientErrorResponse(w, http.StatusNotFound, err) } func methodNotAllowedResponse(w http.ResponseWriter, r *http.Request) { err := fmt.Errorf("the %v method is not supported for this resource", r.Method) - clientErrorResponse(w, r, http.StatusMethodNotAllowed, err) + clientErrorResponse(w, http.StatusMethodNotAllowed, err) } -func failedValidationResponse(w http.ResponseWriter, r *http.Request, errors map[string]string) { +func failedValidationResponse(w http.ResponseWriter, errors map[string]string) { env := envelope{"error": errors} err := writeJSON(w, http.StatusUnprocessableEntity, env, nil) diff --git a/cmd/sqlpipe/helpers.go b/cmd/serve/helpers.go similarity index 100% rename from cmd/sqlpipe/helpers.go rename to cmd/serve/helpers.go diff --git a/cmd/sqlpipe/main.go b/cmd/serve/main.go similarity index 99% rename from cmd/sqlpipe/main.go rename to cmd/serve/main.go index 0194eda6..0d6672fe 100644 --- a/cmd/sqlpipe/main.go +++ b/cmd/serve/main.go @@ -15,7 +15,6 @@ import ( _ "github.com/jackc/pgx/v5/stdlib" _ "github.com/microsoft/go-mssqldb" _ "github.com/sijms/go-ora/v2" - _ "github.com/snowflakedb/gosnowflake" ) var ( diff --git a/cmd/sqlpipe/routes.go b/cmd/serve/routes.go similarity index 98% rename from cmd/sqlpipe/routes.go rename to cmd/serve/routes.go index eddca7a0..8bfc4ea6 100644 --- a/cmd/sqlpipe/routes.go +++ b/cmd/serve/routes.go @@ -10,7 +10,6 @@ import ( func routes() http.Handler { router := httprouter.New() - // SQLpipe router.NotFound = http.HandlerFunc(notFoundResponse) router.MethodNotAllowed = http.HandlerFunc(methodNotAllowedResponse) diff --git a/cmd/sqlpipe/system_mssql.go b/cmd/serve/system_mssql.go similarity index 100% rename from cmd/sqlpipe/system_mssql.go rename to cmd/serve/system_mssql.go diff --git a/cmd/sqlpipe/system_mysql.go b/cmd/serve/system_mysql.go similarity index 100% rename from cmd/sqlpipe/system_mysql.go rename to cmd/serve/system_mysql.go diff --git a/cmd/sqlpipe/system_oracle.go b/cmd/serve/system_oracle.go similarity index 100% rename from cmd/sqlpipe/system_oracle.go rename to cmd/serve/system_oracle.go diff --git a/cmd/sqlpipe/system_postgresql.go b/cmd/serve/system_postgresql.go similarity index 100% rename from cmd/sqlpipe/system_postgresql.go rename to cmd/serve/system_postgresql.go diff --git a/cmd/sqlpipe/system_snowflake.go b/cmd/serve/system_snowflake.go similarity index 99% rename from cmd/sqlpipe/system_snowflake.go rename to cmd/serve/system_snowflake.go index 4ea2a938..98902846 100644 --- a/cmd/sqlpipe/system_snowflake.go +++ b/cmd/serve/system_snowflake.go @@ -298,7 +298,7 @@ func (system Snowflake) insertPipeFilesOverride(columnInfos []ColumnInfo, transf finalCsvChannel := convertPipeFiles(pipeFileInfoChannel, columnInfos, transfer, system) - putCsvsChannel := system.putCsvs(finalCsvChannel, columnInfos, transfer) + putCsvsChannel := system.putCsvs(finalCsvChannel, transfer) err = insertFinalCsvs(putCsvsChannel, transfer, system, transfer.TargetSchema, table) if err != nil { @@ -319,7 +319,6 @@ func (system Snowflake) convertPipeFilesOverride(pipeFilePath <-chan PipeFileInf func (system Snowflake) putCsvs( finalCsvChannelIn <-chan FinalCsvInfo, - columnInfo []ColumnInfo, transfer Transfer, ) <-chan FinalCsvInfo { diff --git a/cmd/sqlpipe/systems.go b/cmd/serve/systems.go similarity index 94% rename from cmd/sqlpipe/systems.go rename to cmd/serve/systems.go index 8ad79407..860cf03f 100644 --- a/cmd/sqlpipe/systems.go +++ b/cmd/serve/systems.go @@ -96,7 +96,7 @@ func openConnectionPool(name, connectionString, driverName string) (connectionPo return nil, fmt.Errorf("error opening connection to %v :: %v", name, err) } - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() err = connectionPool.PingContext(ctx) @@ -330,7 +330,6 @@ func createPipeFiles( transfer Transfer, rows *sql.Rows, source System, - target System, incremental bool, ) <-chan PipeFileInfo { @@ -968,6 +967,52 @@ func dropTableIfExists(schema, table string, system System) (err error) { return nil } +func getIncrementalTime(schema, table, incrementalColumn string, initialLoad bool, system System) (bool, time.Time, error) { + + incrementalTime, overridden, initialLoad, err := system.getIncrementalTimeOverride(schema, table, incrementalColumn, initialLoad) + if overridden { + return initialLoad, incrementalTime, err + } + + escapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, true) + + query := fmt.Sprintf("select max(%v) from %v", escapeIfNeeded(incrementalColumn, system), escapedSchemaPeriodTable) + + rows, err := system.query(query) + if err != nil { + if !system.IsTableNotFoundError(err) { + return initialLoad, incrementalTime, fmt.Errorf("error getting max %v :: %v", incrementalColumn, err) + } + return initialLoad, incrementalTime, nil + } + defer rows.Close() + + columnInfos, err := getQueryColumnInfos(rows, system) + if err != nil { + return initialLoad, incrementalTime, fmt.Errorf("error getting column info :: %v", err) + } + + if !permittedValue(columnInfos[0].PipeType, "datetime", "datetimetz", "date") { + return initialLoad, incrementalTime, fmt.Errorf("column %v is unsupported pipe type %v", incrementalColumn, columnInfos[0].PipeType) + } + + for rows.Next() { + err := rows.Scan(&incrementalTime) + if err != nil { + if !strings.Contains(err.Error(), "storing driver.Value type ") { + return initialLoad, incrementalTime, fmt.Errorf("error scanning max %v :: %v", incrementalColumn, err) + } + return initialLoad, incrementalTime, nil + } + } + + if !incrementalTime.IsZero() { + initialLoad = false + } + + return initialLoad, incrementalTime, nil +} + func deletePks(pipeFilesIn <-chan PipeFileInfo, columnInfos []ColumnInfo, transfer Transfer, target System, incremental, initialLoad bool) <-chan PipeFileInfo { if initialLoad || !incremental { return pipeFilesIn diff --git a/cmd/sqlpipe/transfers.go b/cmd/serve/transfers.go similarity index 80% rename from cmd/sqlpipe/transfers.go rename to cmd/serve/transfers.go index 54264441..99de4bca 100644 --- a/cmd/sqlpipe/transfers.go +++ b/cmd/serve/transfers.go @@ -50,6 +50,8 @@ type Transfer struct { Delimiter string `json:"delimiter"` Newline string `json:"newline"` Null string `json:"null"` + IncrementalColumn string `json:"incremental-column,omitempty"` + Vacuum bool `json:"vacuum"` } var transferMap = NewSafeTransferMap() @@ -121,8 +123,8 @@ func createTransferHandler(w http.ResponseWriter, r *http.Request) { TargetUsername string `json:"target-username"` TargetPassword string `json:"target-password"` DropTargetTableIfExists bool `json:"drop-target-table-if-exists"` - CreateTargetSchemaIfNotExists bool `json:"create-target-schema-if-not-exists"` CreateTargetTableIfNotExists bool `json:"create-target-table-if-not-exists"` + CreateTargetSchemaIfNotExists bool `json:"create-target-schema-if-not-exists"` SourceSchema string `json:"source-schema"` SourceTable string `json:"source-table"` TargetSchema string `json:"target-schema"` @@ -131,11 +133,13 @@ func createTransferHandler(w http.ResponseWriter, r *http.Request) { Delimiter string `json:"delimiter"` Newline string `json:"newline"` Null string `json:"null"` + IncrementalColumn string `json:"incremental-column"` + Vacuum bool `json:"vacuum"` } err := readJSON(w, r, &input) if err != nil { - clientErrorResponse(w, r, http.StatusBadRequest, err) + clientErrorResponse(w, http.StatusBadRequest, err) return } @@ -202,6 +206,8 @@ func createTransferHandler(w http.ResponseWriter, r *http.Request) { TargetSchema: input.TargetSchema, TargetTable: input.TargetTable, Query: input.Query, + IncrementalColumn: input.IncrementalColumn, + Vacuum: input.Vacuum, } v := newValidator() @@ -220,22 +226,39 @@ func createTransferHandler(w http.ResponseWriter, r *http.Request) { if transfer.Query == "" { if schemaRequired[transfer.SourceConnectionInfo.Type] { - v.check(transfer.SourceSchema != "", "source-schema", fmt.Sprintf("if query is not provided, must be provided for source type %v", transfer.TargetConnectionInfo.Type)) + v.check(transfer.SourceSchema != "", "source-schema", fmt.Sprintf("if query is not provided, must be provided for source type %v", transfer.SourceConnectionInfo.Type)) } v.check(transfer.SourceTable != "", "source-table", "must be provided if query is not provided") } else { v.check(transfer.SourceSchema == "", "source-schema", "must not be provided if query is provided") v.check(transfer.SourceTable == "", "source-table", "must not be provided if query is provided") + v.check(!transfer.Vacuum, "vacuum", "must not be true if query is provided") } if transfer.SourceSchema == "" && transfer.SourceTable == "" { v.check(transfer.Query != "", "query", "must be provided if source-schema and source-table are not provided") } + if transfer.Vacuum { + v.check(transfer.Query == "", "query", "must not be provided if vacuum is true") + v.check(transfer.SourceSchema != "", "source-schema", "must be provided if vacuum is true") + v.check(transfer.SourceTable != "", "source-table", "must be provided if vacuum is true") + v.check(transfer.IncrementalColumn == "", "incremental-column", "must not be provided if vacuum is true") + v.check(!transfer.CreateTargetTableIfNotExists, "create-target-table-if-not-exists", "must not be true if vacuum is true") + v.check(!transfer.DropTargetTableIfExists, "drop-target-table-if-exists", "must not be true if vacuum is true") + } + if transfer.SourceSchema != "" || transfer.SourceTable != "" { v.check(transfer.Query == "", "query", "must not be provided if source-schema or source-table are provided") } + if transfer.IncrementalColumn != "" { + if schemaRequired[transfer.SourceConnectionInfo.Type] { + v.check(transfer.SourceSchema != "", "source-schema", fmt.Sprintf("must be provided for source type %v if incremental-column is provided", transfer.TargetConnectionInfo.Type)) + } + v.check(transfer.SourceTable != "", "source-table", "must be provided if incremental-column is provided") + } + v.check(transfer.TargetTable != "", "target-table", "must be provided") if schemaRequired[transfer.TargetConnectionInfo.Type] { v.check(transfer.TargetSchema != "", "target-schema", fmt.Sprintf("must be provided for target type %v", transfer.TargetConnectionInfo.Type)) @@ -268,11 +291,10 @@ func createTransferHandler(w http.ResponseWriter, r *http.Request) { v.check(transfer.TargetConnectionInfo.Username != "", "target-username", "must be provided for target type oracle") v.check(transfer.TargetConnectionInfo.Password != "", "target-password", "must be provided for target type oracle") v.check(transfer.TargetConnectionInfo.Database != "", "target-database", "must be provided for target type oracle") - case TypeSnowflake: } if !v.valid() { - failedValidationResponse(w, r, v.errors) + failedValidationResponse(w, v.errors) return } @@ -343,7 +365,7 @@ func listTransfersHandler(w http.ResponseWriter, r *http.Request) { ) if !v.valid() { - failedValidationResponse(w, r, v.errors) + failedValidationResponse(w, v.errors) return } @@ -377,7 +399,7 @@ func cancelTransferHandler(w http.ResponseWriter, r *http.Request) { } if transfer.Status != StatusRunning { - clientErrorResponse(w, r, http.StatusBadRequest, + clientErrorResponse(w, http.StatusBadRequest, fmt.Errorf("cannot cancel transfer with status of %v", transfer.Status), ) return @@ -424,8 +446,11 @@ func runTransfer(transfer Transfer) (err error) { escapedSourceSchemaPeriodTable := getSchemaPeriodTable(transfer.SourceSchema, transfer.SourceTable, source, true) query := transfer.Query + incremental := false initialLoad := true + var incrementalTime time.Time var columnInfos []ColumnInfo + var incrementalColumnInfo ColumnInfo if transfer.SourceTable != "" { @@ -433,8 +458,113 @@ func runTransfer(transfer Transfer) (err error) { if err != nil { return fmt.Errorf("error getting source table column infos :: %v", err) } - query = fmt.Sprintf(`SELECT * FROM %v`, escapedSourceSchemaPeriodTable) + if transfer.IncrementalColumn != "" { + incremental = true + + // check for existence of incremental column in columnInfos + var found bool + for _, columnInfo := range columnInfos { + if strings.EqualFold(columnInfo.Name, transfer.IncrementalColumn) { + found = true + incrementalColumnInfo = columnInfo + break + } + } + if !found { + return fmt.Errorf("incremental column %v not found in source table %v", transfer.IncrementalColumn, transfer.SourceTable) + } + + initialLoad, incrementalTime, err = getIncrementalTime(transfer.TargetSchema, transfer.TargetTable, transfer.IncrementalColumn, initialLoad, target) + if err != nil { + return fmt.Errorf("error getting incremental time :: %v", err) + } + } + + if initialLoad { + query = fmt.Sprintf(`SELECT * FROM %v`, escapedSourceSchemaPeriodTable) + } else { + + sqlFormatters := source.getSqlFormatters() + + timeStringVal, err := sqlFormatters[incrementalColumnInfo.PipeType](incrementalTime.Format(time.RFC3339Nano)) + if err != nil { + return fmt.Errorf("error formatting incremental time :: %v", err) + } + + query = fmt.Sprintf(`SELECT * FROM %v WHERE %v > %v`, escapedSourceSchemaPeriodTable, transfer.IncrementalColumn, timeStringVal) + } + } + + vacuumTableName := "" + schemaPeriodVacuumTableName := "" + + if transfer.Vacuum { + + randomLetters, err := RandomLetters(16) + if err != nil { + return fmt.Errorf("error generating random letters :: %v", err) + } + + vacuumTableName = fmt.Sprintf("sqlpipe_vacuum_%v_%v", randomLetters, transfer.TargetTable) + + // shorten vacuum table name to 64 chars if necessary + if len(vacuumTableName) > 64 { + vacuumTableName = vacuumTableName[:64] + } + + schemaPeriodVacuumTableName = getSchemaPeriodTable(transfer.TargetSchema, vacuumTableName, target, true) + + columnInfos, err = getTableColumnInfos(transfer.SourceSchema, transfer.SourceTable, source) + if err != nil { + return fmt.Errorf("error getting source table column infos :: %v", err) + } + + pkColumnInfos := []ColumnInfo{} + + for _, columnInfo := range columnInfos { + if columnInfo.IsPrimaryKey { + pkColumnInfos = append(pkColumnInfos, columnInfo) + } + } + + columnInfos = pkColumnInfos + + err = createTableIfNotExists(transfer.TargetSchema, vacuumTableName, columnInfos, target, incremental) + if err != nil { + return fmt.Errorf("error creating target table :: %v", err) + } + + err = source.exec(fmt.Sprintf(`DELETE FROM %v`, schemaPeriodVacuumTableName)) + if err != nil { + return fmt.Errorf("error deleting rows from source table :: %v", err) + } + + if !transfer.KeepFiles { + defer func() { + err = dropTableIfExists(transfer.TargetSchema, vacuumTableName, target) + if err != nil { + errorLog.Printf("error dropping vacuum table %v :: %v", vacuumTableName, err) + return + } + infoLog.Printf("vacuum table %v dropped", vacuumTableName) + }() + } + + queryBuilder := strings.Builder{} + + queryBuilder.WriteString("select ") + + for i, columnInfo := range columnInfos { + if i != 0 { + queryBuilder.WriteString(", ") + } + queryBuilder.WriteString(columnInfo.Name) + } + + queryBuilder.WriteString(fmt.Sprintf(" from %v", escapedSourceSchemaPeriodTable)) + + query = queryBuilder.String() } rows, err := source.query(query) @@ -451,21 +581,59 @@ func runTransfer(transfer Transfer) (err error) { } if transfer.CreateTargetTableIfNotExists { - err = createTableIfNotExists(transfer.TargetSchema, transfer.TargetTable, columnInfos, target, false) + err = createTableIfNotExists(transfer.TargetSchema, transfer.TargetTable, columnInfos, target, incremental) if err != nil { return fmt.Errorf("error creating target table :: %v", err) } } - newPipeFiles := createPipeFiles(columnInfos, transfer, rows, source, target, false) + newPipeFiles := createPipeFiles(columnInfos, transfer, rows, source, incremental) - pksProcessedPipeFiles := deletePks(newPipeFiles, columnInfos, transfer, target, false, initialLoad) + pksProcessedPipeFiles := deletePks(newPipeFiles, columnInfos, transfer, target, incremental, initialLoad) err = insertPipeFiles(pksProcessedPipeFiles, transfer, columnInfos, target, "") if err != nil { return fmt.Errorf("error inserting pipe files :: %v", err) } + if transfer.Vacuum { + + escapedTargetSchemaPeriodTable := getSchemaPeriodTable(transfer.TargetSchema, transfer.TargetTable, target, true) + + queryBuilder := strings.Builder{} + + queryBuilder.WriteString(`DELETE FROM `) + queryBuilder.WriteString(escapedTargetSchemaPeriodTable) + queryBuilder.WriteString(` where (`) + for i, columnInfo := range columnInfos { + escapedColumnName := escapeIfNeeded(columnInfo.Name, target) + if i != 0 { + queryBuilder.WriteString(", ") + } + + queryBuilder.WriteString(escapedColumnName) + } + queryBuilder.WriteString(`) not in (select `) + for i, columnInfo := range columnInfos { + escapedColumnName := escapeIfNeeded(columnInfo.Name, target) + if i != 0 { + queryBuilder.WriteString(", ") + } + + queryBuilder.WriteString(escapedColumnName) + } + queryBuilder.WriteString(` from `) + queryBuilder.WriteString(schemaPeriodVacuumTableName) + queryBuilder.WriteString(`)`) + + query = queryBuilder.String() + + err = target.exec(query) + if err != nil { + return fmt.Errorf("error vacuuming target table :: %v", err) + } + } + transferMap.SetStatus(transfer.Id, StatusComplete, transfer) infoLog.Printf("transfer %v complete", transfer.Id) @@ -625,7 +793,7 @@ func handleCliTransfer(cliTransferInput CliTransferInput) { if transfer.Query == "" { if schemaRequired[transfer.SourceConnectionInfo.Type] { - v.check(transfer.SourceSchema != "", "source-schema", fmt.Sprintf("if query is not provided, must be provided for source type %v", transfer.TargetConnectionInfo.Type)) + v.check(transfer.SourceSchema != "", "source-schema", fmt.Sprintf("if query is not provided, must be provided for source type %v", transfer.SourceConnectionInfo.Type)) } v.check(transfer.SourceTable != "", "source-table", "must be provided if query is not provided") } else { @@ -700,6 +868,6 @@ func handleCliTransfer(cliTransferInput CliTransferInput) { if err != nil { transfer.Error = fmt.Sprintf("error running transfer %v :: %v", transfer.Id, err) transferMap.CancelAndSetStatus(transfer.Id, transfer, StatusError) - errorLog.Fatalf(transfer.Error) + errorLog.Fatal(transfer.Error) } } diff --git a/cmd/tests/helpers.go b/cmd/tests/helpers.go new file mode 100644 index 00000000..7baa07b9 --- /dev/null +++ b/cmd/tests/helpers.go @@ -0,0 +1,84 @@ +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" +) + +type ConnectionInfo struct { + SystemType string + Host string + Port int + User string + Password string + DBName string + Account string + ConnectionString string + Schema string + Table string +} + +func makeSqlpipeTransfer(source, target ConnectionInfo) error { + payload := map[string]interface{}{ + "source-name": source.SystemType, + "source-type": source.SystemType, + "source-connection-string": source.ConnectionString, + "source-table": source.Table, + "target-name": target.SystemType, + "target-type": target.SystemType, + "target-hostname": target.Host, + "target-port": target.Port, + "target-username": target.User, + "target-password": target.Password, + "target-connection-string": target.ConnectionString, + "target-table": fmt.Sprintf("%v_%v", target.Table, source.SystemType), + "drop-target-table-if-exists": true, + "create-target-table-if-not-exists": true, + "create-target-schema-if-not-exists": true, + "target-database": target.DBName, + } + + if source.Schema != "" { + payload["source-schema"] = source.Schema + } + + if target.Schema != "" { + payload["target-schema"] = target.Schema + } + + jsonData, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("error marshalling json :: %v", err) + } + + transferRoute := fmt.Sprintf("%s/transfers/create", serverAddress) + + req, err := http.NewRequest("POST", transferRoute, bytes.NewBuffer(jsonData)) + if err != nil { + return fmt.Errorf("error creating request :: %v", err) + } + + req.Header.Set("Content-Type", "application/json") + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return fmt.Errorf("error sending request :: %v", err) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return fmt.Errorf("error reading response body :: %v", err) + } + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + fmt.Println(string(body)) + return fmt.Errorf("error response status :: %v", resp.Status) + } + + return nil +} diff --git a/cmd/tests/main.go b/cmd/tests/main.go new file mode 100644 index 00000000..d14d96fd --- /dev/null +++ b/cmd/tests/main.go @@ -0,0 +1,207 @@ +package main + +import ( + "database/sql" + "flag" + "fmt" + "log/slog" + "os" + + _ "github.com/go-sql-driver/mysql" + _ "github.com/jackc/pgx/v5/stdlib" + _ "github.com/microsoft/go-mssqldb" + _ "github.com/snowflakedb/gosnowflake" +) + +var postgresqlDB *sql.DB +var mysqlDB *sql.DB +var mssqlDB *sql.DB + +// var oracleDB *sql.DB +var snowflakeDB *sql.DB +var logger *slog.Logger + +var postgresqlHost string +var postgresqlPort int +var postgresqlUser string +var postgresqlPassword string +var postgresqlDBName = "mydb" +var postgresqlSchema = "public" +var postgresqlTable = "my_table" + +var mysqlHost string +var mysqlPort int +var mysqlUser string +var mysqlPassword string +var mysqlDBName = "mydb" +var mysqlTable = "my_table" + +var mssqlHost string +var mssqlPort int +var mssqlUser string +var mssqlPassword string +var mssqlDBName = "mydb" +var mssqlSchema = "dbo" +var mssqlTable = "my_table" + +// var oracleHost string +// var oraclePort int +// var oracleUser string +// var oraclePassword string +// var oracleDBName = "XE" +// var oracleTable = "my_table" + +var snowflakeAccount string +var snowflakeUser string +var snowflakePassword string +var snowflakeDBName = "mydb" +var snowflakeSchema = "public" +var snowflakeTable = "my_table" + +var serverAddress string + +func main() { + + flag.StringVar(&postgresqlHost, "postgresql-host", "", "PostgreSQL host") + flag.IntVar(&postgresqlPort, "postgresql-port", 0, "PostgreSQL port") + flag.StringVar(&postgresqlUser, "postgresql-user", "", "PostgreSQL user") + flag.StringVar(&postgresqlPassword, "postgresql-password", "", "PostgreSQL password") + + flag.StringVar(&mysqlHost, "mysql-host", "", "MySQL host") + flag.IntVar(&mysqlPort, "mysql-port", 0, "MySQL port") + flag.StringVar(&mysqlUser, "mysql-user", "", "MySQL user") + flag.StringVar(&mysqlPassword, "mysql-password", "", "MySQL password") + + flag.StringVar(&mssqlHost, "mssql-host", "", "SQL Server host") + flag.IntVar(&mssqlPort, "mssql-port", 0, "SQL Server port") + flag.StringVar(&mssqlUser, "mssql-user", "", "SQL Server user") + flag.StringVar(&mssqlPassword, "mssql-password", "", "SQL Server password") + + // flag.StringVar(&oracleHost, "oracle-host", "", "Oracle host") + // flag.IntVar(&oraclePort, "oracle-port", 0, "Oracle port") + // flag.StringVar(&oracleUser, "oracle-user", "", "Oracle user") + // flag.StringVar(&oraclePassword, "oracle-password", "", "Oracle password") + + flag.StringVar(&snowflakeAccount, "snowflake-account", "", "Snowflake account") + flag.StringVar(&snowflakeUser, "snowflake-user", "", "Snowflake user") + flag.StringVar(&snowflakePassword, "snowflake-password", "", "Snowflake password") + + flag.StringVar(&serverAddress, "server-address", "", "Server address") + + flag.Parse() + + logger = slog.New(slog.NewTextHandler(os.Stdout, nil)) + + var err error + + postgresqlDB, err = sql.Open("pgx", fmt.Sprintf("host=%s port=%v user=%s password=%s dbname=postgres sslmode=disable", postgresqlHost, postgresqlPort, postgresqlUser, postgresqlPassword)) + if err != nil { + logger.Error(fmt.Sprintf("error creating PostgreSQL connection pool :: %v", err)) + os.Exit(1) + } + + err = postgresqlDB.Ping() + if err != nil { + logger.Error(fmt.Sprintf("Error pinging PostgreSQL :: %v", err)) + os.Exit(1) + } + + mysqlDB, err = sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:%v)/mysql", mysqlUser, mysqlPassword, mysqlHost, mysqlPort)) + if err != nil { + logger.Error(fmt.Sprintf("error creating MySQL connection pool :: %v", err)) + os.Exit(1) + } + + err = mysqlDB.Ping() + if err != nil { + logger.Error(fmt.Sprintf("Error pinging MySQL :: %v", err)) + os.Exit(1) + } + + mssqlDB, err = sql.Open("mssql", fmt.Sprintf("server=%s;user id=%s;password=%s;port=%v;database=master", mssqlHost, mssqlUser, mssqlPassword, mssqlPort)) + if err != nil { + logger.Error(fmt.Sprintf("error creating SQL Server connection pool :: %v", err)) + os.Exit(1) + } + + err = mssqlDB.Ping() + if err != nil { + logger.Error(fmt.Sprintf("Error pinging SQL Server :: %v", err)) + os.Exit(1) + } + + // urlOptions := map[string]string{ + // "dba privilege": "sysdba", + // } + + // connStr := go_ora.BuildUrl(oracleHost, oraclePort, oracleDBName, oracleUser, oraclePassword, urlOptions) + + // oracleDB, err = sql.Open("oracle", connStr) + // if err != nil { + // logger.Error(fmt.Sprintf("error creating Oracle connection pool :: %v", err)) + // os.Exit(1) + // } + + // err = oracleDB.Ping() + // if err != nil { + // logger.Error(fmt.Sprintf("error pinging Oracle :: %v", err)) + // os.Exit(1) + // } + + snowflakeDsn := fmt.Sprintf("%s:%s@%s/%s/%v", snowflakeUser, snowflakePassword, snowflakeAccount, snowflakeDBName, snowflakeSchema) + + snowflakeDB, err = sql.Open("snowflake", snowflakeDsn) + if err != nil { + logger.Error(fmt.Sprintf("error creating Snowflake connection pool :: %v", err)) + os.Exit(1) + } + + err = snowflakeDB.Ping() + if err != nil { + logger.Error(fmt.Sprintf("Error pinging Snowflake :: %v", err)) + os.Exit(1) + } + + logger.Info("All connections successful") + + postgresqlConnectionInfo, err := setupPostgreSQL() + if err != nil { + logger.Info(fmt.Sprintf("error setting up PostgreSQL :: %v", err)) + } + + mysqlConnectionInfo, err := setupMySQL() + if err != nil { + logger.Info(fmt.Sprintf("error setting up MySQL :: %v", err)) + } + + mssqlConnectionInfo, err := setupMssql() + if err != nil { + logger.Info(fmt.Sprintf("error setting up SQL Server :: %v", err)) + } + + // oracleConnectionInfo, err := setupOracle() + // if err != nil { + // logger.Info(fmt.Sprintf("error setting up Oracle :: %v", err)) + // } + + snowflakeConnectionInfo, err := setupSnowflake() + if err != nil { + logger.Info(fmt.Sprintf("error setting up Snowflake :: %v", err)) + } + + // sources := []ConnectionInfo{postgresqlConnectionInfo, mysqlConnectionInfo, mssqlConnectionInfo, oracleConnectionInfo, snowflakeConnectionInfo} + // targets := []ConnectionInfo{postgresqlConnectionInfo, mysqlConnectionInfo, mssqlConnectionInfo, oracleConnectionInfo, snowflakeConnectionInfo} + + sources := []ConnectionInfo{postgresqlConnectionInfo, mysqlConnectionInfo, mssqlConnectionInfo, snowflakeConnectionInfo} + targets := []ConnectionInfo{postgresqlConnectionInfo, mysqlConnectionInfo, mssqlConnectionInfo, snowflakeConnectionInfo} + + for _, source := range sources { + for _, target := range targets { + err = makeSqlpipeTransfer(source, target) + if err != nil { + logger.Error(fmt.Sprintf("error transferring data from %v to %v :: %v", source.SystemType, target.SystemType, err)) + } + logger.Info(fmt.Sprintf("transferred data from %v to %v", source.SystemType, target.SystemType)) + } + } +} diff --git a/cmd/tests/mssqlSetup.go b/cmd/tests/mssqlSetup.go new file mode 100644 index 00000000..04ea89f4 --- /dev/null +++ b/cmd/tests/mssqlSetup.go @@ -0,0 +1,224 @@ +package main + +import ( + "context" + "database/sql" + "fmt" + "time" +) + +func setupMssql() (ConnectionInfo, error) { + + var connectionInfo ConnectionInfo + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err := mssqlDB.ExecContext(ctx, "DROP DATABASE mydb") + if err != nil { + logger.Warn(fmt.Sprintf("error dropping mydb in mssql :: %v", err)) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = mssqlDB.ExecContext(ctx, "CREATE DATABASE mydb") + if err != nil { + return connectionInfo, fmt.Errorf("error creating database :: %v", err) + } + + dsn := fmt.Sprintf("server=%s;user id=%s;password=%s;port=%v;database=mydb", mssqlHost, mssqlUser, mssqlPassword, mssqlPort) + mssqlDB, err = sql.Open("mssql", dsn) + if err != nil { + return connectionInfo, fmt.Errorf("error creating mssql connection pool :: %v", err) + } + + err = mssqlDB.Ping() + if err != nil { + return connectionInfo, fmt.Errorf("error pinging mssql :: %v", err) + } + + connectionInfo = ConnectionInfo{ + SystemType: "mssql", + Host: mssqlHost, + User: mssqlUser, + Password: mssqlPassword, + DBName: mssqlDBName, + ConnectionString: dsn, + Schema: mssqlSchema, + Table: mssqlTable, + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = mssqlDB.ExecContext(ctx, ` +CREATE TABLE my_table ( + my_id bigINT IDENTITY(1,1) PRIMARY KEY, + my_nchar NCHAR(4), + my_char CHAR(4), + my_nvarchar_max NVARCHAR(MAX), + my_nvarchar NVARCHAR(50), + my_varchar_max VARCHAR(MAX), + my_varchar VARCHAR(50), + my_empty_varchar VARCHAR(50), + my_bigint BIGINT, + my_int INT, + my_smallint SMALLINT, + my_tinyint TINYINT, + my_float FLOAT, + my_real REAL, + my_decimal DECIMAL(10, 5), + my_money MONEY, + my_smallmoney SMALLMONEY, + my_datetime2 DATETIME2, + my_datetime DATETIME, + my_smalldatetime SMALLDATETIME, + my_datetimeoffset DATETIMEOFFSET, + my_date DATE, + my_time TIME, + my_binary BINARY(50), + my_varbinary VARBINARY(MAX), + my_bit BIT, + my_uniqueidentifier UNIQUEIDENTIFIER, + my_xml XML, + my_timestamp TIMESTAMP, + last_modified DATETIME DEFAULT GETDATE() +)`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating my_table :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = mssqlDB.ExecContext(ctx, ` +CREATE TRIGGER tr_my_table_last_modified +ON my_table +AFTER UPDATE +AS +BEGIN + UPDATE my_table + SET last_modified = GETDATE() + WHERE my_id IN (SELECT DISTINCT my_id FROM inserted) +END`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating tr_my_table_last_modified function :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + for i := 0; i < 10; i++ { + _, err = mssqlDB.ExecContext(ctx, ` +INSERT INTO my_table (my_nchar, my_char, my_nvarchar_max, my_nvarchar, my_varchar_max, my_varchar, my_empty_varchar, my_bigint, my_int, my_smallint, my_tinyint, my_float, my_real, my_decimal, my_money, my_smallmoney, my_datetime2, my_datetime, my_smalldatetime, my_datetimeoffset, my_date, my_time, my_binary, my_varbinary, my_bit, my_uniqueidentifier, my_xml) +VALUES +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data'), +(N'ABCD', 'ABCD', N'This is a "test" message', N'Test message', 'This is a ''test'' message', 'Test message', '', 123456789, 12345, 123, 12, 123.45, 123.45, 123.43, 123.45, 123.45, '2023-07-23T14:30:00.7654321', '2023-07-23T14:30:00.765', '2023-07-23T14:30:00', '2023-07-23T14:30:00.7654321-07:00', '2023-07-23', '14:30:00', 0x010101, 0x010101, 1, NEWID(), 'Some XML data');`) + if err != nil { + return connectionInfo, fmt.Errorf("failed to insert data: %w", err) + } + } + + logger.Info("mssql setup successful") + + return connectionInfo, nil +} diff --git a/cmd/tests/mysqlSetup.go b/cmd/tests/mysqlSetup.go new file mode 100644 index 00000000..77b67ffc --- /dev/null +++ b/cmd/tests/mysqlSetup.go @@ -0,0 +1,221 @@ +package main + +import ( + "context" + "database/sql" + "fmt" + "time" +) + +func setupMySQL() (ConnectionInfo, error) { + + connectionInfo := ConnectionInfo{} + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err := mysqlDB.ExecContext(ctx, fmt.Sprintf("DROP DATABASE %v", mysqlDBName)) + if err != nil { + logger.Warn(fmt.Sprintf("error dropping mydb in mysql :: %v", err)) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = mysqlDB.ExecContext(ctx, "CREATE DATABASE mydb") + if err != nil { + return connectionInfo, fmt.Errorf("error creating database :: %v", err) + } + + mysqlDB, err = sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:%v)/%s", mysqlUser, mysqlPassword, mysqlHost, mysqlPort, "mydb")) + if err != nil { + return connectionInfo, fmt.Errorf("error creating mysql connection pool :: %v", err) + } + + err = mysqlDB.Ping() + if err != nil { + return connectionInfo, fmt.Errorf("error pinging mysql :: %v", err) + } + + connectionInfo = ConnectionInfo{ + SystemType: "mysql", + Host: mysqlHost, + Port: mysqlPort, + User: mysqlUser, + Password: mysqlPassword, + DBName: mysqlDBName, + ConnectionString: fmt.Sprintf("%s:%s@tcp(%s:%v)/%s?parseTime=true&loc=US%%2FPacific", mysqlUser, mysqlPassword, mysqlHost, mysqlPort, "mydb"), + Table: mysqlTable, + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = mysqlDB.ExecContext(ctx, ` +CREATE TABLE my_table ( + my_id BIGINT AUTO_INCREMENT PRIMARY KEY, + my_char CHAR(10), + my_varchar VARCHAR(255), + my_longtext LONGTEXT, + my_mediumtext MEDIUMTEXT, + my_text TEXT, + my_tinytext TINYTEXT, + my_enum ENUM('value1', 'value2'), + my_unsigned_bigint BIGINT UNSIGNED, + my_bigint BIGINT, + my_unsigned_int INT UNSIGNED, + my_int INT, + my_unsigned_mediumint MEDIUMINT UNSIGNED, + my_mediumint MEDIUMINT, + my_unsigned_smallint SMALLINT UNSIGNED, + my_smallint SMALLINT, + my_unsigned_tinyint TINYINT UNSIGNED, + my_tinyint TINYINT, + my_double DOUBLE, + my_float FLOAT, + my_decimal DECIMAL(18, 5), + my_datetime DATETIME(6), + my_timestamp TIMESTAMP(6), + my_date DATE, + my_time TIME(6), + my_year YEAR, + my_binary BINARY(50), + my_varbinary VARBINARY(255), + my_longblob LONGBLOB, + my_mediumblob MEDIUMBLOB, + my_blob BLOB, + my_tinyblob TINYBLOB, + my_geometry GEOMETRY, + my_bit BIT(25), + my_json JSON, + my_set SET('value1', 'value2'), + last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +)`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating my_table :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + for i := 0; i < 10; i++ { + _, err = mysqlDB.ExecContext(ctx, ` +INSERT INTO my_table ( + my_char, my_varchar, my_longtext, my_mediumtext, my_text, my_tinytext, + my_enum, my_unsigned_bigint, my_bigint, my_unsigned_int, my_int, + my_unsigned_mediumint, my_mediumint, my_unsigned_smallint, my_smallint, + my_unsigned_tinyint, my_tinyint, my_double, my_float, my_decimal, + my_datetime, my_timestamp, my_date, my_time, my_year, my_binary, + my_varbinary, my_longblob, my_mediumblob, my_blob, my_tinyblob, my_geometry, + my_bit, my_json, my_set +) +VALUES +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'0001111111', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'0011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1'), +('abc', 'abc', 'This "is" a test', 'This is a test', 'This is a test', 'Test', 'value1', 123456789012345678, 123456789012345678, 12345678, 12345678, 1234567, 1234567, 12345, 12345, 123, 123, 1.23456789012345678, 1.2345678, 123.456, '2023-07-22 12:34:56.765432', '2023-07-22 12:34:56.765432', '2023-07-22', '12:34:56.765432', 2023, 0b110011, 0b110011, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, 0x89504E470D0A1A0A, ST_GeomFromText('POINT(1 1)'), b'1011001101', '{"key": "value"}', 'value1')`) + if err != nil { + return connectionInfo, fmt.Errorf("failed to insert data: %w", err) + } + } + + logger.Info("mysql setup successful") + + return connectionInfo, nil +} diff --git a/cmd/tests/oracleSetup.go b/cmd/tests/oracleSetup.go new file mode 100644 index 00000000..7d271354 --- /dev/null +++ b/cmd/tests/oracleSetup.go @@ -0,0 +1,200 @@ +package main + +// import ( +// "context" +// "database/sql" +// "fmt" +// "time" + +// go_ora "github.com/sijms/go-ora/v2" +// ) + +// func setupOracle() (ConnectionInfo, error) { + +// connectionInfo := ConnectionInfo{} + +// var ctx context.Context +// var cancel context.CancelFunc +// var err error + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, fmt.Sprintf("CREATE PLUGGABLE DATABASE mydb ADMIN USER mydb_admin IDENTIFIED BY %v FILE_NAME_CONVERT = ('/opt/oracle/oradata/XE/pdbseed/', '/opt/oracle/oradata/XE/mydb/')", oraclePassword)) +// if err != nil { +// logger.Warn(fmt.Sprintf("error creating oracle user :: %v", err)) +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, "ALTER PLUGGABLE DATABASE mydb OPEN") +// if err != nil { +// logger.Warn(fmt.Sprintf("error opening mydb :: %v", err)) +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, "ALTER PLUGGABLE DATABASE mydb SAVE STATE") +// if err != nil { +// logger.Warn(fmt.Sprintf("error saving mydb state :: %v", err)) +// } + +// urlOptions := map[string]string{ +// "dba privilege": "sysdba", +// } + +// oracleDB, err = sql.Open("oracle", go_ora.BuildUrl(oracleHost, oraclePort, "mydb", oracleUser, oraclePassword, urlOptions)) +// if err != nil { +// logger.Error(fmt.Sprintf("error creating Oracle connection pool :: %v", err)) +// return connectionInfo, err +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, "CREATE TABLESPACE mydb_tablespace DATAFILE '/opt/oracle/oradata/XE/mydb/mydb_tablespace.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M") +// if err != nil { +// logger.Warn(fmt.Sprintf("error creating mydb_tablespace :: %v", err)) +// } + +// _, err = oracleDB.ExecContext(ctx, "ALTER USER mydb_admin DEFAULT TABLESPACE mydb_tablespace") +// if err != nil { +// logger.Warn(fmt.Sprintf("error setting default tablespace :: %v", err)) +// } + +// _, err = oracleDB.ExecContext(ctx, "ALTER USER mydb_admin QUOTA UNLIMITED ON mydb_tablespace") +// if err != nil { +// logger.Warn(fmt.Sprintf("error granting quota on tablespace :: %v", err)) +// } + +// _, err = oracleDB.ExecContext(ctx, "GRANT SYSDBA TO mydb_admin") +// if err != nil { +// logger.Warn(fmt.Sprintf("error granting sysdba :: %v", err)) +// } + +// _, err = oracleDB.ExecContext(ctx, "grant create table to mydb_admin") +// if err != nil { +// logger.Warn(fmt.Sprintf("error granting creat table :: %v", err)) +// } + +// dsn := go_ora.BuildUrl(oracleHost, oraclePort, "mydb", "mydb_admin", oraclePassword, urlOptions) + +// oracleDB, err = sql.Open("oracle", dsn) +// if err != nil { +// return connectionInfo, fmt.Errorf("error creating Oracle connection pool :: %v", err) +// } + +// err = oracleDB.Ping() +// if err != nil { +// return connectionInfo, fmt.Errorf("error pinging Oracle :: %v", err) +// } + +// connectionInfo = ConnectionInfo{ +// SystemType: "oracle", +// Host: oracleHost, +// Port: oraclePort, +// User: oracleUser, +// Password: oraclePassword, +// DBName: oracleDBName, +// ConnectionString: dsn, +// Schema: "mydb_admin", +// Table: oracleTable, +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, "CREATE TABLE mydb_admin.my_table (my_id NUMBER GENERATED AS IDENTITY primary key, my_nchar NCHAR(10), my_number NUMBER(10,5), my_float FLOAT, my_varchar2 VARCHAR2(128), my_date DATE, my_binaryfloat BINARY_FLOAT, my_binarydouble BINARY_DOUBLE, my_raw RAW(128), my_char CHAR(8), my_timestamp TIMESTAMP, my_timestamptz TIMESTAMP WITH TIME ZONE, my_intervalym INTERVAL YEAR TO MONTH, my_intervalds INTERVAL DAY TO SECOND, my_urowid urowid, my_timestampltz TIMESTAMP WITH LOCAL TIME ZONE, my_clob CLOB, my_blob BLOB, my_nclob NCLOB, my_varchar VARCHAR(128), last_modified TIMESTAMP DEFAULT SYSTIMESTAMP)") +// if err != nil { +// logger.Warn(fmt.Sprintf("error creating oracle table :: %v", err)) +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, "delete from mydb_admin.my_table") +// if err != nil { +// return connectionInfo, fmt.Errorf("error deleting from my_table :: %v", err) +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, ` +// CREATE OR REPLACE TRIGGER mydb_admin.trg_my_table_last_modified +// BEFORE UPDATE ON mydb_admin.my_table +// FOR EACH ROW +// BEGIN +// :NEW.last_modified := SYSTIMESTAMP; +// END; +// `) +// if err != nil { +// return connectionInfo, fmt.Errorf("error creating trg_my_table_last_modified :: %v", err) +// } + +// for i := 0; i < 1000; i++ { +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, ` +// INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column')`) +// if err != nil { +// return connectionInfo, fmt.Errorf("failed to insert data: %w", err) +// } +// } + +// ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) +// defer cancel() + +// _, err = oracleDB.ExecContext(ctx, ` +// INSERT INTO mydb_admin.my_table ( +// my_nchar, +// my_number, +// my_float, +// my_varchar2, +// my_date, +// my_binaryfloat, +// my_binarydouble, +// my_raw, +// my_char, +// my_timestamp, +// my_timestamptz, +// my_intervalym, +// my_intervalds, +// my_urowid, +// my_timestampltz, +// my_clob, +// my_blob, +// my_nclob, +// my_varchar +// ) VALUES ( +// NULL, +// NULL, +// NULL, +// 'one not null', +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL, +// NULL +// )`) +// if err != nil { +// return connectionInfo, fmt.Errorf("failed to insert data: %w", err) +// } + +// logger.Info("Oracle setup successful") + +// return connectionInfo, nil +// } diff --git a/cmd/tests/postgresqlSetup.go b/cmd/tests/postgresqlSetup.go new file mode 100644 index 00000000..fabb0386 --- /dev/null +++ b/cmd/tests/postgresqlSetup.go @@ -0,0 +1,371 @@ +package main + +import ( + "context" + "database/sql" + "fmt" + "time" +) + +func setupPostgreSQL() (ConnectionInfo, error) { + + connectionInfo := ConnectionInfo{} + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err := postgresqlDB.ExecContext(ctx, fmt.Sprintf("DROP DATABASE %v with (force)", postgresqlDBName)) + if err != nil { + logger.Warn(fmt.Sprintf("error dropping mydb in postgresql :: %v", err)) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = postgresqlDB.ExecContext(ctx, "CREATE DATABASE mydb") + if err != nil { + return connectionInfo, fmt.Errorf("error creating database :: %v", err) + } + + dsn := fmt.Sprintf("postgresql://%v:%v@%v:5432/%v?sslmode=disable", postgresqlUser, postgresqlPassword, postgresqlHost, postgresqlDBName) + + postgresqlDB, err = sql.Open("pgx", dsn) + if err != nil { + return connectionInfo, fmt.Errorf("error creating PostgreSQL connection pool :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + err = postgresqlDB.PingContext(ctx) + if err != nil { + return connectionInfo, fmt.Errorf("error pinging PostgreSQL :: %v", err) + } + + connectionInfo = ConnectionInfo{ + SystemType: "postgresql", + Host: postgresqlHost, + Port: postgresqlPort, + User: postgresqlUser, + Password: postgresqlPassword, + DBName: postgresqlDBName, + ConnectionString: dsn, + Schema: postgresqlSchema, + Table: postgresqlTable, + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = postgresqlDB.ExecContext(ctx, ` +CREATE TABLE my_table ( + my_char CHAR, + my_varchar VARCHAR, + my_text TEXT, + my_int8 INT8, + my_int4 INT4, + my_int2 INT2, + my_float8 FLOAT8, + my_float4 FLOAT4, + my_numeric NUMERIC(10, 5), + my_timestamp TIMESTAMP, + my_timestamptz TIMESTAMPTZ, + my_date DATE, + my_time TIME, + my_interval INTERVAL, + my_bytea BYTEA, + my_box BOX, + my_circle CIRCLE, + my_line LINE, + my_path PATH, + my_point POINT, + my_polygon POLYGON, + my_lseg LSEG, + my_bool BOOL, + my_bit BIT, + my_varbit VARBIT, + my_uuid UUID, + my_json JSON, + my_jsonb JSONB, + my_inet INET, + my_macaddr MACADDR, + my_cidr CIDR, + my_xml xml, + my_timetz TIMETZ, + my_pg_lsn pg_lsn, + my_tsquery tsquery, + my_tsvector tsvector, + my_serial SERIAL, + my_bigserial BIGSERIAL primary key, + last_modified timestamp default CURRENT_TIMESTAMP +); +`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating my_table :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = postgresqlDB.ExecContext(ctx, ` +CREATE OR REPLACE FUNCTION update_last_modified() +RETURNS TRIGGER AS $$ +BEGIN + NEW.last_modified = CURRENT_TIMESTAMP; + RETURN NEW; +END; +$$ LANGUAGE plpgsql;`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating update_last_modified function :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = postgresqlDB.ExecContext(ctx, ` + CREATE TRIGGER tr_update_last_modified +BEFORE UPDATE ON my_table +FOR EACH ROW +EXECUTE FUNCTION update_last_modified();`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating tr_update_last_modified trigger :: %w", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = postgresqlDB.ExecContext(ctx, ` +DO $$ +DECLARE + counter INTEGER := 0; +BEGIN + WHILE counter < 1000 LOOP + INSERT INTO my_table ( + my_char, + my_varchar, + my_text, + my_int8, + my_int4, + my_int2, + my_float8, + my_float4, + my_numeric, + my_timestamp, + my_timestamptz, + my_date, + my_time, + my_interval, + my_bytea, + my_box, + my_circle, + my_line, + my_path, + my_point, + my_polygon, + my_lseg, + my_bool, + my_bit, + my_varbit, + my_uuid, + my_json, + my_jsonb, + my_inet, + my_macaddr, + my_cidr, + my_xml, + my_timetz, + my_tsquery, + my_tsvector, + my_pg_lsn + ) + VALUES + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'), + ('A','"Hello" there', 'This is ''a tab test text', 1234567890123456, 12345678,1234, 12345678.12345678, 1234.1234, 123.456, '2023-07-23 12:34:56.643381', '2023-07-23 12:34:56.643381-07:00', '2023-07-23', '12:34:56.643381', '1 day', E'\\xDEADBEEF', '((1,2),(3,4))', '<(1,2),3>', '{1,-2,3}', '((1,2),(3,4))', '(1,2)', '((1,2),(3,4))', '((1,2),(3,4))', true, B'1', B'101', 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', '{"key":"value"}', '{"key":"value"}', '192.168.1.1', '08:00:2B:01:02:03', '192.168.1.0/24', 'Some Content', '12:34:56.765432-07:00', 'super & rat', 'super', '1/3B9ACA00'); + + counter := counter + 1; + END LOOP; +END $$; + + +INSERT INTO my_table +( my_char, + my_varchar, + my_text, + my_int8, + my_int4, + my_int2, + my_float8, + my_float4, + my_numeric, + my_timestamp, + my_timestamptz, + my_date, + my_time, + my_interval, + my_bytea, + my_box, + my_circle, + my_line, + my_path, + my_point, + my_polygon, + my_lseg, + my_bool, + my_bit, + my_varbit, + my_uuid, + my_json, + my_jsonb, + my_inet, + my_macaddr, + my_cidr, + my_xml, + my_timetz, + my_tsquery, + my_tsvector, + my_pg_lsn + ) + values ( + null, + 'one not null', + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null + );`) + if err != nil { + return connectionInfo, fmt.Errorf("failed to insert data: %w", err) + } + + logger.Info("PostgreSQL setup successful") + + return connectionInfo, nil +} diff --git a/cmd/tests/snowflakeSetup.go b/cmd/tests/snowflakeSetup.go new file mode 100644 index 00000000..fc207c30 --- /dev/null +++ b/cmd/tests/snowflakeSetup.go @@ -0,0 +1,195 @@ +package main + +import ( + "context" + "database/sql" + "fmt" + "time" +) + +func setupSnowflake() (ConnectionInfo, error) { + + connectionInfo := ConnectionInfo{} + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err := snowflakeDB.ExecContext(ctx, fmt.Sprintf("DROP DATABASE %v", snowflakeDBName)) + if err != nil { + logger.Warn(fmt.Sprintf("error dropping mydb in snowflake :: %v", err)) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = snowflakeDB.ExecContext(ctx, "CREATE DATABASE mydb") + if err != nil { + return connectionInfo, fmt.Errorf("error creating database :: %v", err) + } + + dsn := fmt.Sprintf("%v:%v@%v/%v/%v", snowflakeUser, snowflakePassword, snowflakeAccount, snowflakeDBName, snowflakeSchema) + + snowflakeDB, err = sql.Open("snowflake", dsn) + if err != nil { + return connectionInfo, fmt.Errorf("error creating snowflake connection pool :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + err = snowflakeDB.PingContext(ctx) + if err != nil { + return connectionInfo, fmt.Errorf("error pinging snowflake :: %v", err) + } + + connectionInfo = ConnectionInfo{ + SystemType: "snowflake", + Account: snowflakeAccount, + User: snowflakeUser, + Password: snowflakePassword, + DBName: snowflakeDBName, + ConnectionString: dsn, + Schema: snowflakeSchema, + Table: snowflakeTable, + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = snowflakeDB.ExecContext(ctx, "DROP SEQUENCE IF EXISTS my_table_seq") + if err != nil { + return connectionInfo, fmt.Errorf("error dropping sequence :: %v", err) + } + + _, err = snowflakeDB.ExecContext(ctx, "CREATE SEQUENCE my_table_seq START 1 INCREMENT 1;") + if err != nil { + return connectionInfo, fmt.Errorf("error creating sequence :: %v", err) + } + + _, err = snowflakeDB.ExecContext(ctx, ` +CREATE TABLE my_table ( + my_serial BIGINT DEFAULT my_table_seq.NEXTVAL, + my_varchar VARCHAR(100), + my_number NUMBER(10, 5), + my_int INTEGER, + my_bigint BIGINT, + my_float FLOAT, + my_double DOUBLE, + my_boolean BOOLEAN, + my_date DATE, + my_time TIME, + my_timestamp TIMESTAMP, + my_timestampltz TIMESTAMP_LTZ, + my_timestampntz TIMESTAMP_NTZ, + my_timestamptz TIMESTAMP_TZ, + my_variant VARIANT, + my_object OBJECT, + my_array ARRAY, + my_binary BINARY, + my_geography GEOGRAPHY +)`) + if err != nil { + return connectionInfo, fmt.Errorf("error creating my_table :: %v", err) + } + + for i := 0; i < 10; i++ { + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = snowflakeDB.ExecContext(ctx, ` +INSERT INTO my_table ( + my_varchar, + my_number, + my_int, + my_bigint, + my_float, + my_double, + my_boolean, + my_date, + my_time, + my_timestamp, + my_timestampltz, + my_timestampntz, + my_timestamptz, + my_variant, + my_object, + my_array, + my_binary, + my_geography +) +SELECT + 'Sample Text' AS my_varchar, + 12345.67890 AS my_number, + 42 AS my_int, + 1234567890123 AS my_bigint, + 3.14159 AS my_float, + 2.7182818284 AS my_double, + TRUE AS my_boolean, + '2023-01-01'::DATE AS my_date, + '12:34:56'::TIME AS my_time, + '2023-01-01 12:34:56'::TIMESTAMP AS my_timestamp, + '2023-01-01 12:34:56 -05:00'::TIMESTAMP_LTZ AS my_timestampltz, + '2023-01-01 12:34:56'::TIMESTAMP_NTZ AS my_timestampntz, + '2023-01-01 12:34:56 -05:00'::TIMESTAMP_TZ AS my_timestamptz, + PARSE_JSON('{"key": "value"}') AS my_variant, + OBJECT_CONSTRUCT('key1', 'value1') AS my_object, + ARRAY_CONSTRUCT(1, 2, 3) AS my_array, + TO_BINARY('FFEE', 'HEX') AS my_binary, + TO_GEOGRAPHY('POINT(-122.35 47.65)') AS my_geography`) + } + if err != nil { + return connectionInfo, fmt.Errorf("error inserting data :: %v", err) + } + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + _, err = snowflakeDB.ExecContext(ctx, ` +INSERT INTO my_table ( + my_varchar, + my_number, + my_int, + my_bigint, + my_float, + my_double, + my_boolean, + my_date, + my_time, + my_timestamp, + my_timestampltz, + my_timestampntz, + my_timestamptz, + my_variant, + my_object, + my_array, + my_binary, + my_geography +) +VALUES ( + NULL, -- my_varchar + NULL, -- my_number + NULL, -- my_int + NULL, -- my_bigint + NULL, -- my_float + NULL, -- my_double + NULL, -- my_boolean + NULL, -- my_date + NULL, -- my_time + NULL, -- my_timestamp + NULL, -- my_timestampltz + NULL, -- my_timestampntz + NULL, -- my_timestamptz + NULL, -- my_variant + NULL, -- my_object + NULL, -- my_array + NULL, -- my_binary + NULL -- my_geography +)`) + if err != nil { + return connectionInfo, fmt.Errorf("error inserting data :: %v", err) + } + + logger.Info("snowflake setup successful") + + return connectionInfo, nil +} diff --git a/cmd/transferInstance/helpers.go b/cmd/transferInstance/helpers.go new file mode 100644 index 00000000..41c5ab13 --- /dev/null +++ b/cmd/transferInstance/helpers.go @@ -0,0 +1,354 @@ +package main + +import ( + "crypto/rand" + "encoding/csv" + "fmt" + "math/big" + "os" + "os/exec" + "path/filepath" + "runtime/debug" + "strconv" + "strings" + "unicode" + + "github.com/sqlpipe/sqlpipe/internal/data" +) + +// misc log keys +const ( + OriginalInstanceId = "instance-id" + OriginalDatabaseName = "database" + OriginalSchemaName = "schema" + OriginalTableName = "table" + BackupInstanceId = "backup-instance-id" + StagingDatabaseName = "staging-database" + TargetDatabaseName = "target-database" + TargetSchemaName = "target-schema" + TargetTableName = "target-table" +) + +var ( + DriverPostgreSQL = "pgx" + DriverMySQL = "mysql" + DriverMSSQL = "sqlserver" + DriverOracle = "oracle" + DriverSnowflake = "snowflake" +) + +var ( + StatusPending = "pending" + StatusRunning = "running" + StatusError = "error" + StatusComplete = "complete" +) + +var dashToUnderscoreReplacer = strings.NewReplacer("-", "_") + +func getFileNum(fileName string) (fileNum int64, err error) { + fileNameClean := filepath.Base(fileName) + fileNumString := strings.Split(fileNameClean, ".")[0] + fileNum, err = strconv.ParseInt(fileNumString, 2, 64) + if err != nil { + return 0, fmt.Errorf("error converting file number to int :: %v", err) + } + + return fileNum, nil +} + +func ProgramVersion() string { + var revision string + var modified bool + + bi, ok := debug.ReadBuildInfo() + if ok { + for _, s := range bi.Settings { + switch s.Key { + case "vcs.revision": + revision = s.Value + case "vcs.modified": + if s.Value == "true" { + modified = true + } + } + } + } + + if modified { + return fmt.Sprintf("%s-dirty", revision) + } + + return revision +} + +func maxColumnByteLength(filename, null string, columnIndex int) (int, error) { + file, err := os.Open(filename) + if err != nil { + return 0, err + } + defer file.Close() + + r := csv.NewReader(file) + maxLength := 0 + + for { + record, err := r.Read() + if err != nil { + break + } + + if columnIndex < 0 || columnIndex >= len(record) { + return 0, fmt.Errorf("invalid column index %d", columnIndex) + } + + length := len(record[columnIndex]) + if length > maxLength { + maxLength = length + } + } + + return maxLength + len(null), nil +} + +func checkDeps(instanceTransfer *data.InstanceTransfer) { + checkPsql(instanceTransfer) + checkBcp(instanceTransfer) + checkSqlLdr(instanceTransfer) +} + +func checkPsql(instanceTransfer *data.InstanceTransfer) { + _, err := exec.Command("psql", "--version").CombinedOutput() + if err != nil { + // logger.Warn(fmt.Sprintf("psql not found. please install psql to transfer data to postgresql :: %v :: %v\n", err, string(output))) + return + } + + instanceTransfer.PsqlAvailable = true +} + +func checkBcp(instanceTransfer *data.InstanceTransfer) { + _, err := exec.Command("bcp", "-v").CombinedOutput() + if err != nil { + // logger.Warn(fmt.Sprintf("bcp not found. please install bcp to transfer data to mssql :: %v :: %v\n", err, string(output))) + return + } + + instanceTransfer.BcpAvailable = true +} + +func checkSqlLdr(instanceTransfer *data.InstanceTransfer) { + _, err := exec.Command("sqlldr", "-help").CombinedOutput() + if err != nil { + // logger.Warn(fmt.Sprintf("sqlldr not found. please install sqllder to transfer data to oracle :: %v :: %v\n", err, string(output))) + return + } + + instanceTransfer.SqlLdrAvailable = true +} + +func containsSpaces(s string) bool { + for _, char := range s { + if unicode.IsSpace(char) { + return true + } + } + return false +} + +func RandomPrintableAsciiCharacters(length int) (string, error) { + randomString := "" + + possibleCharacters := []string{ + `0`, + `1`, + `2`, + `3`, + `4`, + `5`, + `6`, + `7`, + `8`, + `9`, + `A`, + `B`, + `C`, + `D`, + `E`, + `F`, + `G`, + `H`, + `I`, + `J`, + `K`, + `L`, + `M`, + `N`, + `O`, + `P`, + `Q`, + `R`, + `S`, + `T`, + `U`, + `V`, + `W`, + `X`, + `Y`, + `Z`, + `a`, + `b`, + `c`, + `d`, + `e`, + `f`, + `g`, + `h`, + `i`, + `j`, + `k`, + `l`, + `m`, + `n`, + `o`, + `p`, + `q`, + `r`, + `s`, + `t`, + `u`, + `v`, + `w`, + `x`, + `y`, + `z`, + } + + numChars := int64(len(possibleCharacters)) + + for i := 0; i < length; i++ { + nBig, err := rand.Int(rand.Reader, big.NewInt(numChars)) + if err != nil { + err = fmt.Errorf("error generating random number:: %v", err) + return "", err + } + randomInt := int(nBig.Int64()) + + randomString = randomString + possibleCharacters[randomInt] + } + + return randomString, nil +} + +func RandomLetters(length int) (string, error) { + randomString := "" + + possibleCharacters := []string{ + `A`, + `B`, + `C`, + `D`, + `E`, + `F`, + `G`, + `H`, + `I`, + `J`, + `K`, + `L`, + `M`, + `N`, + `O`, + `P`, + `Q`, + `R`, + `S`, + `T`, + `U`, + `V`, + `W`, + `X`, + `Y`, + `Z`, + `a`, + `b`, + `c`, + `d`, + `e`, + `f`, + `g`, + `h`, + `i`, + `j`, + `k`, + `l`, + `m`, + `n`, + `o`, + `p`, + `q`, + `r`, + `s`, + `t`, + `u`, + `v`, + `w`, + `x`, + `y`, + `z`, + } + + numChars := int64(len(possibleCharacters)) + + for i := 0; i < length; i++ { + nBig, err := rand.Int(rand.Reader, big.NewInt(numChars)) + if err != nil { + err = fmt.Errorf("error generating random number:: %v", err) + return "", err + } + randomInt := int(nBig.Int64()) + + randomString = randomString + possibleCharacters[randomInt] + } + + return randomString, nil +} + +const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" +const charsetLength = int64(len(charset)) + +func generateRandomString(length int) (string, error) { + + randomChars := make([]byte, length) + + for i := 0; i < length; i++ { + nBig, err := rand.Int(rand.Reader, big.NewInt(charsetLength)) + if err != nil { + err = fmt.Errorf("error generating random number:: %v", err) + return "", err + } + randomInt := int(nBig.Int64()) + + randomChars[i] = charset[randomInt] + } + + randomString := string(randomChars) + + return randomString, nil + +} + +// func getAdminDbName(dbType string) (string, error) { + +// var adminDbName string + +// switch dbType { +// case data.TypePostgreSQL: +// adminDbName = "postgres" +// default: +// return "", fmt.Errorf("unsupported db type: %s", dbType) +// } + +// return adminDbName, nil + +// } diff --git a/cmd/transferInstance/main.go b/cmd/transferInstance/main.go new file mode 100644 index 00000000..28163236 --- /dev/null +++ b/cmd/transferInstance/main.go @@ -0,0 +1,143 @@ +package main + +import ( + "context" + "flag" + "fmt" + "log/slog" + "os" + "path/filepath" + + "github.com/aws/aws-sdk-go-v2/aws" + awsConfig "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/credentials" + "github.com/aws/aws-sdk-go-v2/service/rds" + "github.com/sqlpipe/sqlpipe/internal/data" + "github.com/sqlpipe/sqlpipe/internal/validator" + "github.com/sqlpipe/sqlpipe/internal/vcs" + + sf "github.com/snowflakedb/gosnowflake" + + _ "github.com/go-sql-driver/mysql" + _ "github.com/jackc/pgx/v5/stdlib" + _ "github.com/microsoft/go-mssqldb" + _ "github.com/sijms/go-ora/v2" +) + +var ( + logger *slog.Logger + version = vcs.Version() + globalTmpDir string + instanceTransfer = &data.InstanceTransfer{ + SourceInstance: &data.Instance{}, + TransferInfos: []*data.TransferInfo{}, + NamingConvention: &data.NamingConvention{}, + } +) + +func main() { + + flag.StringVar(&instanceTransfer.ID, "instance-transfer-id", "", "The UUID of the instance transfer") + flag.StringVar(&instanceTransfer.NamingConvention.DatabaseNameInSnowflake, "database-naming-convention", "", "DB naming template") + flag.StringVar(&instanceTransfer.NamingConvention.SchemaNameInSnowflake, "schema-naming-convention", "", "schema naming template") + flag.StringVar(&instanceTransfer.NamingConvention.SchemaFallbackInSnowflake, "schema-fallback", "", "schema fallback") + flag.StringVar(&instanceTransfer.NamingConvention.TableNameInSnowflake, "table-naming-convention", "", "table naming template") + flag.StringVar(&instanceTransfer.SourceInstance.ID, "source-instance-id", "", "source name") + flag.StringVar(&instanceTransfer.SourceInstance.CloudProvider, "source-instance-cloud-provider", "", "source cloud provider") + flag.StringVar(&instanceTransfer.SourceInstance.CloudAccountID, "source-instance-cloud-account-id", "", "source account id") + flag.StringVar(&instanceTransfer.SourceInstance.Type, "source-instance-type", "", "source type") + flag.StringVar(&instanceTransfer.SourceInstance.Region, "source-instance-region", "", "source region") + flag.StringVar(&instanceTransfer.SourceInstance.Host, "source-instance-host", "", "source host") + flag.IntVar(&instanceTransfer.SourceInstance.Port, "source-instance-port", 0, "source port") + flag.StringVar(&instanceTransfer.SourceInstance.Username, "source-instance-username", "", "source username") + flag.StringVar(&instanceTransfer.SourceInstance.Password, "source-instance-password", "", "source password (if blank, a random password will be generated and applied to the instance)") + flag.StringVar(&instanceTransfer.RestoredInstanceID, "restored-instance-id", "", "backup id") + flag.StringVar(&instanceTransfer.TargetType, "target-type", "", "target type") + flag.StringVar(&instanceTransfer.TargetHost, "target-host", "", "target host") + flag.StringVar(&instanceTransfer.TargetUsername, "target-username", "", "target username") + flag.StringVar(&instanceTransfer.TargetPassword, "target-password", "", "target password") + flag.StringVar(&instanceTransfer.CloudUsername, "cloud-username", "", "account username") + flag.StringVar(&instanceTransfer.CloudPassword, "cloud-password", "", "account password") + flag.BoolVar(&instanceTransfer.ScanForPII, "scan-for-pii", false, "scan for pii") + flag.BoolVar(&instanceTransfer.DeleteRestoredInstanceAfterTransfer, "delete-restored-instance-after-transfer", true, "delete restored instance after transfer") + flag.StringVar(&instanceTransfer.Delimiter, "delimiter", "{dlm}", "delimiter") + flag.StringVar(&instanceTransfer.Newline, "newline", "{nwln}", "newline") + flag.StringVar(&instanceTransfer.Null, "null", "{nll}", "null") + flag.Float64Var(&instanceTransfer.CustomStrategyThreshold, "custom-strategy-threshold", 0.4, "custom strategy threshold") + flag.Float64Var(&instanceTransfer.CustomStrategyPercentile, "custom-strategy-percentile", 0.5, "custom strategy percentile") + flag.IntVar(&instanceTransfer.NumRowsToScannForPII, "num-rows-to-scan-for-pii", 1000, "num rows to scan for pii") + + displayVersion := flag.Bool("version", false, "display version and exit") + + flag.Parse() + + if *displayVersion { + fmt.Printf("version:\t%s\n", version) + os.Exit(0) + } + + logger = slog.New(slog.NewTextHandler(os.Stdout, nil)) + + var err error + + if instanceTransfer.DeleteRestoredInstanceAfterTransfer { + + deleteCredentials := aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider( + instanceTransfer.CloudUsername, + instanceTransfer.CloudPassword, + "", + )) + + deleteCfg, err := awsConfig.LoadDefaultConfig(context.Background(), awsConfig.WithRegion(instanceTransfer.SourceInstance.Region), awsConfig.WithCredentialsProvider(deleteCredentials)) + if err != nil { + logger.Error("failed to load AWS configuration", "error", err) + os.Exit(1) + } + + deleteClient := rds.NewFromConfig(deleteCfg) + + // Input parameters for deletion + input := &rds.DeleteDBInstanceInput{ + DBInstanceIdentifier: aws.String(instanceTransfer.RestoredInstanceID), + SkipFinalSnapshot: aws.Bool(true), + DeleteAutomatedBackups: aws.Bool(true), + } + + defer func() { + _, err = deleteClient.DeleteDBInstance(context.Background(), input) + if err != nil { + logger.Error("failed to terminate RDS instance", BackupInstanceId, instanceTransfer.RestoredInstanceID, "error", err) + os.Exit(1) + } + }() + } + + checkDeps(instanceTransfer) + + globalTmpDir = filepath.Join(os.TempDir(), "sqlpipe") + err = os.MkdirAll(globalTmpDir, 0600) + if err != nil { + logger.Error("failed to create tmp dir", "error", err) + os.Exit(1) + } + + // snowflake driver logs a lot of stuff that we don't want + sf.GetLogger().SetLogLevel("fatal") + + v := validator.New() + + data.ValidateInstanceTransfer(v, instanceTransfer) + + if !v.Valid() { + logger.Error("invalid instance transfer", "errors", fmt.Sprintf("%+v", v.FieldErrors)) + os.Exit(1) + } + + err = transferInstance() + if err != nil { + logger.Error("error transferring instance", "error", err) + os.Exit(1) + } + + logger.Info("instance transfer complete") +} diff --git a/cmd/transferInstance/system_mssql.go b/cmd/transferInstance/system_mssql.go new file mode 100644 index 00000000..83d4c531 --- /dev/null +++ b/cmd/transferInstance/system_mssql.go @@ -0,0 +1,1428 @@ +package main + +import ( + "context" + "database/sql" + "encoding/csv" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "regexp" + "strings" + "sync" + "time" + + "github.com/google/uuid" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +type Mssql struct { + Connection *sql.DB + ConnectionInfo ConnectionInfo +} + +func newMssql(connectionInfo ConnectionInfo) (mssql Mssql, err error) { + + connectionString := fmt.Sprintf("sqlserver://%v:%v@%v:%v?database=%v", connectionInfo.Username, + connectionInfo.Password, connectionInfo.Hostname, connectionInfo.Port, connectionInfo.Database) + + db, err := openConnectionPool(connectionString, DriverMSSQL) + if err != nil { + return mssql, fmt.Errorf("error opening mssql db :: %v", err) + } + + mssql.Connection = db + mssql.ConnectionInfo = connectionInfo + + return mssql, nil +} + +func (system Mssql) closeConnectionPool(printError bool) (err error) { + err = system.Connection.Close() + if err != nil && printError { + logger.Error(fmt.Sprintf("error closing connection pool :: %v", err)) + } + return err +} + +func (system Mssql) query(query string) (rows *sql.Rows, err error) { + rows, err = system.Connection.Query(query) + if err != nil { + return nil, fmt.Errorf("error running dql :: %v :: %v", query, err) + } + return rows, nil +} + +func (system Mssql) queryRow(query string) (row *sql.Row) { + row = system.Connection.QueryRow(query) + return row +} + +func (system Mssql) exec(query string) (err error) { + _, err = system.Connection.Exec(query) + if err != nil { + return fmt.Errorf("error running ddl/dml on :: %v :: %v", query, err) + } + return nil +} + +func (system Mssql) dropTableIfExistsOverride(schema, table string) (overridden bool, err error) { + return false, nil +} + +func (system Mssql) createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) { + + return false, errors.New("not implemented") + + // unescapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, true) + // escapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, true) + + // escapedPrimaryKeys := []string{} + + // for i := range columnInfos { + // if columnInfos[i].IsPrimaryKey { + // escapedPrimaryKeys = append(escapedPrimaryKeys, escapeIfNeeded(columnInfos[i].Name, system)) + // } + // } + + // var queryBuilder = strings.Builder{} + // // IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'YourTableName' AND schema_id = SCHEMA_ID('YourSchemaName')) + // queryBuilder.WriteString("IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = '") + // queryBuilder.WriteString(table) + // queryBuilder.WriteString("' AND schema_id = SCHEMA_ID('") + // queryBuilder.WriteString(schema) + // queryBuilder.WriteString("')) BEGIN CREATE TABLE ") + // queryBuilder.WriteString(escapedSchemaPeriodTable) + // queryBuilder.WriteString(" (") + + // for i := range columnInfos { + // if i > 0 { + // queryBuilder.WriteString(", ") + // } + + // escapedName := escapeIfNeeded(columnInfos[i].Name, system) + + // queryBuilder.WriteString(escapedName) + // queryBuilder.WriteString(" ") + + // createType, err := system.pipeTypeToCreateType(columnInfos[i]) + // if err != nil { + // return false, fmt.Errorf("error getting create type for column %v :: %v", columnInfos[i].Name, err) + // } + + // queryBuilder.WriteString(createType) + // } + + // if incremental && len(escapedPrimaryKeys) > 0 { + // queryBuilder.WriteString(", primary key (") + // queryBuilder.WriteString(strings.Join(escapedPrimaryKeys, ",")) + // queryBuilder.WriteString(")") + // } + + // queryBuilder.WriteString(") END") + + // err = system.exec(queryBuilder.String()) + // if err != nil { + // return false, fmt.Errorf("error running create table %v :: %v", unescapedSchemaPeriodTable, err) + // } + + // logger.Info(fmt.Sprintf("created table %v if not exists", unescapedSchemaPeriodTable)) + + // return true, nil +} + +func (system Mssql) driverTypeToPipeType( + columnType *sql.ColumnType, + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "NVARCHAR": + return "nvarchar", nil + case "NCHAR": + return "nvarchar", nil + case "VARCHAR": + return "varchar", nil + case "CHAR": + return "varchar", nil + case "NTEXT": + return "ntext", nil + case "TEXT": + return "text", nil + case "BIGINT": + return "int64", nil + case "INT": + return "int32", nil + case "SMALLINT": + return "int16", nil + case "TINYINT": + return "int16", nil + case "FLOAT": + return "float64", nil + case "REAL": + return "float32", nil + case "DECIMAL": + return "decimal", nil + case "NUMERIC": + return "decimal", nil + case "MONEY": + return "money", nil + case "SMALLMONEY": + return "money", nil + case "DATETIME2": + return "datetime", nil + case "DATETIME": + return "datetime", nil + case "SMALLDATETIME": + return "datetime", nil + case "DATETIMEOFFSET": + return "datetimetz", nil + case "DATE": + return "date", nil + case "TIME": + return "time", nil + case "BINARY": + return "varbinary", nil + case "IMAGE": + return "blob", nil + case "VARBINARY": + return "blob", nil + case "UNIQUEIDENTIFIER": + return "uuid", nil + case "BIT": + return "bool", nil + case "XML": + return "xml", nil + default: + return "", fmt.Errorf( + "unsupported database type for mssql: %v", columnType.DatabaseTypeName()) + } +} + +func (system Mssql) dbTypeToPipeType( + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "bigint": + return "int64", nil + case "int": + return "int32", nil + case "smallint": + return "int16", nil + case "tinyint": + return "int16", nil + case "float": + return "float64", nil + case "real": + return "float32", nil + case "decimal": + return "decimal", nil + case "numeric": + return "decimal", nil + case "money": + return "money", nil + case "smallmoney": + return "money", nil + case "datetime2": + return "datetime", nil + case "datetime": + return "datetime", nil + case "smalldatetime": + return "datetime", nil + case "datetimeoffset": + return "datetimetz", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "binary": + return "varbinary", nil + case "timestamp": + return "varbinary", nil + case "bit": + return "bool", nil + case "xml": + return "xml", nil + case "nvarchar": + return "nvarchar", nil + case "varchar": + return "varchar", nil + case "nchar": + return "nvarchar", nil + case "char": + return "varchar", nil + case "text": + return "text", nil + case "ntext": + return "ntext", nil + case "varbinary": + return "varbinary", nil + case "image": + return "blob", nil + case "uniqueidentifier": + return "uuid", nil + default: + return "", fmt.Errorf("unsupported database type for mssql: %v", databaseTypeName) + } +} + +func (system Mssql) pipeTypeToCreateType(columnInfo *data.ColumnInfo) (createType string, err error) { + + columnInfo.Length = columnInfo.Length * 2 + + switch columnInfo.PipeType { + case "nvarchar": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + return "nvarchar(max)", nil + } else if columnInfo.Length <= 4000 { + return fmt.Sprintf("nvarchar(%v)", columnInfo.Length), nil + } else { + return "nvarchar(max)", nil + } + } else { + return "nvarchar(4000)", nil + } + case "varchar": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + return "varchar(max)", nil + } else if columnInfo.Length <= 8000 { + return fmt.Sprintf("varchar(%v)", columnInfo.Length), nil + } else { + return "varchar(max)", nil + } + } else { + return "varchar(8000)", nil + } + case "ntext": + return "nvarchar(max)", nil + case "text": + return "varchar(max)", nil + case "int64": + return "bigint", nil + case "int32": + return "integer", nil + case "int16": + return "smallint", nil + case "float64": + return "float", nil + case "float32": + return "real", nil + case "decimal": + scaleOk := false + precisionOk := false + + if columnInfo.DecimalOk { + if columnInfo.Scale > 0 && columnInfo.Scale <= 38 { + scaleOk = true + } + + if columnInfo.Precision > 0 && + columnInfo.Precision <= 38 && + columnInfo.Precision > columnInfo.Scale { + precisionOk = true + } + } + + if scaleOk && precisionOk { + return fmt.Sprintf("decimal(%v,%v)", columnInfo.Precision, columnInfo.Scale), nil + } else { + return "float", nil + } + case "money": + return "money", nil + case "datetime": + return "datetime2", nil + case "datetimetz": + return "datetime2", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "varbinary": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + return "varbinary(max)", nil + } else if columnInfo.Length <= 8000 { + return fmt.Sprintf("varbinary(%v)", columnInfo.Length), nil + } else { + return "varbinary(max)", nil + } + } else { + return "varbinary(8000)", nil + } + case "blob": + return "varbinary(max)", nil + case "uuid": + return "uniqueidentifier", nil + case "bool": + return "bit", nil + case "json": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + return "nvarchar(max)", nil + } else if columnInfo.Length <= 4000 { + return fmt.Sprintf("nvarchar(%v)", columnInfo.Length), nil + } else { + return "nvarchar(max)", nil + } + } else { + return "nvarchar(4000)", nil + } + case "xml": + return "xml", nil + case "varbit": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + return "varchar(max)", nil + } else if columnInfo.Length <= 8000 { + return fmt.Sprintf("varchar(%v)", columnInfo.Length), nil + } else { + return "varchar(max)", nil + } + } else { + return "varchar(8000)", nil + } + default: + return "", fmt.Errorf("unsupported pipeType for mssql: %v", columnInfo.PipeType) + } +} + +func (system Mssql) createPipeFilesOverride(pipeFileChannelIn chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows, +) (pipeFileInfoChannel chan PipeFileInfo, overridden bool) { + return pipeFileChannelIn, false +} + +func (system Mssql) getPipeFileFormatters() ( + pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error), +) { + return map[string]func(interface{}) (pipeFileValue string, err error){ + "nvarchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "ntext": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "text": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "int64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int16": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "float64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "float32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "decimal": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "money": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "datetime": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime mssqlPipeFileFormatters", + ) + } + return valTime.Format(time.RFC3339Nano), nil + }, + "datetimetz": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetimetz mssqlPipeFileFormatters", + ) + } + return valTime.UTC().Format(time.RFC3339Nano), nil + }, + "date": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to date mssqlPipeFileFormatters", + ) + } + return valTime.Format(time.RFC3339Nano), nil + }, + "time": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to time mssqlPipeFileFormatters", + ) + } + return valTime.Format(time.RFC3339Nano), nil + }, + "varbinary": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "blob": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "uuid": func(v interface{}) (pipeFileValue string, err error) { + val, ok := v.([]uint8) + if !ok { + return "", errors.New( + "non byte array value passed to uuid mssqlPipeFileFormatters", + ) + } + return fmt.Sprintf("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X", + val[3], + val[2], + val[1], + val[0], + val[5], + val[4], + val[7], + val[6], + val[8], + val[9], + val[10:], + ), nil + }, + "bool": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%t", v), nil + }, + "json": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "xml": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + } +} + +func (system Mssql) insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) { + return false, nil +} + +func (system Mssql) convertPipeFilesOverride( + pipeFileInfoChannel <-chan PipeFileInfo, + finalCsvInfoChannel chan FinalCsvInfo, + transferInfo *data.TransferInfo, +) (chan FinalCsvInfo, bool) { + // converts a pipe file to a csv that can be uploaded by bcp + + finalCsvChannel := make(chan FinalCsvInfo) + + finalCsvFormatters := system.getFinalCsvFormatters() + + go func() { + + defer close(finalCsvChannel) + + for pipeFileInfo := range pipeFileInfoChannel { + + pipeFile, err := os.Open(pipeFileInfo.FilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error opening pipeFile :: %v", err) + logger.Error(transferInfo.Error) + return + } + + fileNum, err := getFileNum(pipeFileInfo.FilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error getting file num :: %v", err) + logger.Error(transferInfo.Error) + return + } + + finalCsvFile, err := os.Create( + filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%032b.csv", fileNum)), + ) + if err != nil { + transferInfo.Error = fmt.Sprintf("error creating final csv file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + csvReader := csv.NewReader(pipeFile) + csvBuilder := strings.Builder{} + + var value string + + for { + row, err := csvReader.Read() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + transferInfo.Error = fmt.Sprintf("error reading pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + for i := range row { + if i != 0 { + csvBuilder.WriteString(transferInfo.Delimiter) + } + if row[i] == transferInfo.Null { + csvBuilder.WriteString("") + } else { + value, err = finalCsvFormatters[transferInfo.ColumnInfos[i].PipeType](row[i]) + if err != nil { + transferInfo.Error = fmt.Sprintf( + "error formatting value for final csv :: %v", err) + logger.Error(transferInfo.Error) + return + } + csvBuilder.WriteString(value) + } + } + csvBuilder.WriteString(transferInfo.Newline) + } + + _, err = finalCsvFile.WriteString(csvBuilder.String()) + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing to final csv file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + err = finalCsvFile.Close() + if err != nil { + transferInfo.Error = fmt.Sprintf("error closing final csv file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + err = pipeFile.Close() + if err != nil { + if !strings.Contains(err.Error(), "file already closed") { + transferInfo.Error = fmt.Sprintf("error closing pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + } + + select { + case <-transferInfo.Context.Done(): + return + default: + finalCsvInfo := FinalCsvInfo{ + FilePath: finalCsvFile.Name(), + InsertInfo: finalCsvFile.Name(), + } + + finalCsvChannel <- finalCsvInfo + } + + } + logger.Info("finished converting pipe files") + }() + + return finalCsvChannel, true +} + +func (system Mssql) insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Mssql) getFinalCsvFormatters() map[string]func(string) (string, error) { + return map[string]func(string) (string, error){ + "nvarchar": func(v string) (string, error) { + if v == "" { + return "\x00", nil + } + return v, nil + }, + "varchar": func(v string) (string, error) { + if v == "" { + return "\x00", nil + } + return v, nil + }, + "ntext": func(v string) (string, error) { + if v == "" { + return "\x00", nil + } + return v, nil + }, + "text": func(v string) (string, error) { + if v == "" { + return "\x00", nil + } + return v, nil + }, + "int64": func(v string) (string, error) { + return v, nil + }, + "int32": func(v string) (string, error) { + return v, nil + }, + "int16": func(v string) (string, error) { + return v, nil + }, + "float64": func(v string) (string, error) { + return v, nil + }, + "float32": func(v string) (string, error) { + return v, nil + }, + "decimal": func(v string) (string, error) { + return v, nil + }, + "money": func(v string) (string, error) { + return v, nil + }, + "datetime": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to bcp csv :: %v", err) + } + return valTime.Format("2006-01-02 15:04:05.9999999"), nil + }, + "datetimetz": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf( + "error parsing datetimetz value in mssql datetimetz mssql formatter :: %v", + err) + } + + return valTime.UTC().Format("2006-01-02 15:04:05.9999999"), nil + }, + "date": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to bcp csv :: %v", err) + } + return valTime.Format("2006-01-02"), nil + }, + "time": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing time value to bcp csv :: %v", err) + } + + return valTime.Format("15:04:05.999999"), nil + }, + "varbinary": func(v string) (string, error) { + return v, nil + }, + "blob": func(v string) (string, error) { + return v, nil + }, + "uuid": func(v string) (string, error) { + return v, nil + }, + "bool": func(v string) (string, error) { + switch v { + case "true": + return "1", nil + case "false": + return "0", nil + default: + return "", fmt.Errorf("error writing bool value to bcp csv :: %v", v) + } + }, + "json": func(v string) (string, error) { + return v, nil + }, + "xml": func(v string) (string, error) { + return v, nil + }, + "varbit": func(v string) (string, error) { + return v, nil + }, + } +} + +func (system Mssql) runInsertCmd( + finalCsvInfo FinalCsvInfo, + transferInfo *data.TransferInfo, + schema, table string, +) ( + err error, +) { + + // fileNum, err := getFileNum(finalCsvInfo.FilePath) + // if err != nil { + // return fmt.Errorf("error getting file num :: %v", err) + // } + + // escapedSchemaPeriodtable := getSchemaPeriodTable(schema, table, system, true) + + // cmd := exec.CommandContext( + // transferInfo.Context, + // "bcp", + // fmt.Sprintf("%v.%v", + // transferInfo.TargetDatabase, escapedSchemaPeriodtable, + // ), + // "in", + // finalCsvInfo.FilePath, + // "-c", + // "-S", transferInfo.TargetHostname, + // "-U", transferInfo.TargetUsername, + // "-P", transferInfo.TargetPassword, + // "-t", transferInfo.Delimiter, + // "-r", transferInfo.Newline, + // "-e", filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%032b.err", fileNum)), + // ) + + // result, err := cmd.CombinedOutput() + // if err != nil { + // return fmt.Errorf( + // "failed to upload csv to mssql :: stderr %v :: stdout %s", err, string(result), + // ) + // } + + // return nil + + return errors.New("not implemented") +} + +func (system Mssql) schemaRequired() bool { + return true +} + +var mssqlReservedKeywords = map[string]bool{ + "ADD": true, + "ALL": true, + "ALTER": true, + "AND": true, + "ANY": true, + "AS": true, + "ASC": true, + "AUTHORIZATION": true, + "BACKUP": true, + "BEGIN": true, + "BETWEEN": true, + "BREAK": true, + "BROWSE": true, + "BULK": true, + "BY": true, + "CASCADE": true, + "CASE": true, + "CHECK": true, + "CHECKPOINT": true, + "CLOSE": true, + "CLUSTERED": true, + "COALESCE": true, + "COLLATE": true, + "COLUMN": true, + "COMMIT": true, + "COMPUTE": true, + "CONSTRAINT": true, + "CONTAINS": true, + "CONTAINSTABLE": true, + "CONTINUE": true, + "CONVERT": true, + "CREATE": true, + "CROSS": true, + "CURRENT": true, + "CURRENT_DATE": true, + "CURRENT_TIME": true, + "CURRENT_TIMESTAMP": true, + "CURRENT_USER": true, + "CURSOR": true, + "DATABASE": true, + "DBCC": true, + "DEALLOCATE": true, + "DECLARE": true, + "DEFAULT": true, + "DELETE": true, + "DENY": true, + "DESC": true, + "DISK": true, + "DISTINCT": true, + "DISTRIBUTED": true, + "DOUBLE": true, + "DROP": true, + "DUMP": true, + "ELSE": true, + "END": true, + "ERRLVL": true, + "ESCAPE": true, + "EXCEPT": true, + "EXEC": true, + "EXECUTE": true, + "EXISTS": true, + "EXIT": true, + "EXTERNAL": true, + "FETCH": true, + "FILE": true, + "FILLFACTOR": true, + "FOR": true, + "FOREIGN": true, + "FREETEXT": true, + "FREETEXTTABLE": true, + "FROM": true, + "FULL": true, + "FUNCTION": true, + "GOTO": true, + "GRANT": true, + "GROUP": true, + "HAVING": true, + "HOLDLOCK": true, + "IDENTITY": true, + "IDENTITY_INSERT": true, + "IDENTITYCOL": true, + "IF": true, + "IN": true, + "INDEX": true, + "INNER": true, + "INSERT": true, + "INTERSECT": true, + "INTO": true, + "IS": true, + "JOIN": true, + "KEY": true, + "KILL": true, + "LEFT": true, + "LIKE": true, + "LINENO": true, + "LOAD": true, + "MERGE": true, + "NATIONAL": true, + "NOCHECK": true, + "NONCLUSTERED": true, + "NOT": true, + "NULL": true, + "NULLIF": true, + "OF": true, + "OFF": true, + "OFFSETS": true, + "ON": true, + "OPEN": true, + "OPENDATASOURCE": true, + "OPENQUERY": true, + "OPENROWSET": true, + "OPENXML": true, + "OPTION": true, + "OR": true, + "ORDER": true, + "OUTER": true, + "OVER": true, + "PERCENT": true, + "PIVOT": true, + "PLAN": true, + "PRECISION": true, + "PRIMARY": true, + "PRINT": true, + "PROC": true, + "PROCEDURE": true, + "PUBLIC": true, + "RAISEERROR": true, + "RANGE": true, + "READ": true, + "READTEXT": true, + "RECONFIGURE": true, + "REFERENCES": true, + "REPLICATION": true, + "RESTORE": true, + "RESTRICT": true, + "RETURN": true, + "REVERT": true, + "REVOKE": true, + "RIGHT": true, + "ROLLBACK": true, + "ROWCOUNT": true, + "ROWGUIDCOL": true, + "RULE": true, + "SAVE": true, + "SCHEMA": true, + "SECURITYAUDIT": true, + "SELECT": true, + "SEMANTICKEYPHRASETABLE": true, + "SEMANTICSIMILARITYDETAILSTABLE": true, + "SEMANTICSIMILARITYTABLE": true, + "SESSION_USER": true, + "SET": true, + "SETUSER": true, + "SHUTDOWN": true, + "SOME": true, + "STATISTICS": true, + "SYSTEM_USER": true, + "TABLE": true, + "TABLESAMPLE": true, + "TEXTSIZE": true, + "THEN": true, + "TO": true, + "TOP": true, + "TRAN": true, + "TRANSACTION": true, + "TRIGGER": true, + "TRUNCATE": true, + "TRY_CONVERT": true, + "TSEQUAL": true, + "UNION": true, + "UNIQUE": true, + "UNPIVOT": true, + "UPDATE": true, + "UPDATETEXT": true, + "USE": true, + "USER": true, + "VALUES": true, + "VARYING": true, + "VIEW": true, + "WAITFOR": true, + "WHEN": true, + "WHERE": true, + "WHILE": true, + "WITH": true, + "WITHIN GROUP": true, + "WRITETEXT": true, +} + +func (system Mssql) isReservedKeyword(objectName string) bool { + + if _, ok := mssqlReservedKeywords[strings.ToUpper(objectName)]; ok { + return true + } + return false +} + +func (system Mssql) escape(objectName string) (escaped string) { + return fmt.Sprintf("[%v]", objectName) +} + +func (system Mssql) createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) { + + escapedSchema := escapeIfNeeded(schema, system) + + query := fmt.Sprintf(` + IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = '%v') + BEGIN + EXEC('CREATE SCHEMA %v') + END`, + schema, + escapedSchema, + ) + + err = system.exec(query) + if err != nil { + return false, fmt.Errorf("error creating schema %v :: %v", schema, err) + } + + return true, nil +} + +func (system Mssql) getIncrementalTimeOverride(schema, table, incrementalColumn string, initialLoad bool) (time.Time, bool, bool, error) { + return time.Time{}, false, initialLoad, nil +} + +func (system Mssql) IsTableNotFoundError(err error) bool { + return strings.Contains(err.Error(), "Invalid object name") +} + +func (system Mssql) getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) { + + unescapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, false) + + query := fmt.Sprintf(` + SELECT + col.name AS column_name + FROM + sys.indexes idx + JOIN + sys.index_columns idx_col ON idx.object_id = idx_col.object_id AND idx.index_id = idx_col.index_id + JOIN + sys.columns col ON idx.object_id = col.object_id AND idx_col.column_id = col.column_id + WHERE + idx.is_primary_key = 1 + AND idx.object_id = OBJECT_ID('%v')`, + unescapedSchemaPeriodTable) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting primary keys rows :: %v", err) + } + + return rows, nil +} + +var mssqlDatetimeFormat = "2006-01-02 15:04:05.9999999" +var mssqlDateFormat = "2006-01-02" +var mssqlTimeFormat = "15:04:05.9999999" + +func (system Mssql) getSqlFormatters() ( + pipeFileFormatters map[string]func(string) (pipeFileValue string, err error), +) { + return map[string]func(string) (pipeFileValue string, err error){ + "nvarchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "ntext": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "text": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "int64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int16": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "decimal": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "money": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "datetime": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mssql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mssqlDatetimeFormat)), nil + }, + "datetimetz": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mssql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mssqlDatetimeFormat)), nil + }, + "date": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mssql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mssqlDateFormat)), nil + }, + "time": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mssql csv :: %v", err) + } + + return fmt.Sprintf("'%v'", valTime.Format(mssqlTimeFormat)), nil + }, + "varbinary": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`0x%s`, v), nil + }, + "blob": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`0x%s`, v), nil + }, + "uuid": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "bool": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "json": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "xml": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varbit": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + } +} + +func (system Mssql) getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) { + query := fmt.Sprintf(` + WITH PrimaryKeys AS ( + SELECT + c.COLUMN_NAME + FROM + INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc + JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS c + ON tc.CONSTRAINT_NAME = c.CONSTRAINT_NAME + AND tc.TABLE_NAME = c.TABLE_NAME + WHERE + tc.CONSTRAINT_TYPE = 'PRIMARY KEY' + AND tc.TABLE_SCHEMA = '%v' + AND tc.TABLE_NAME = '%v' + ) + + SELECT + columns.COLUMN_NAME AS col_name, + columns.DATA_TYPE AS col_type, + coalesce(columns.NUMERIC_PRECISION, -1) AS col_precision, + coalesce(columns.NUMERIC_SCALE, -1) AS col_scale, + coalesce(columns.CHARACTER_MAXIMUM_LENGTH, -1) AS col_length, + CASE WHEN pk.COLUMN_NAME IS NOT NULL THEN 1 ELSE 0 END AS col_is_primary + FROM + INFORMATION_SCHEMA.COLUMNS AS columns + LEFT JOIN PrimaryKeys pk ON columns.COLUMN_NAME = pk.COLUMN_NAME + WHERE columns.TABLE_SCHEMA = '%v' + AND columns.TABLE_NAME = '%v' + ORDER BY + columns.ORDINAL_POSITION;`, schema, table, schema, table) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting table column infos rows :: %v", err) + } + + return rows, nil +} + +func (system Mssql) createDbIfNotExistsOverride(database string) (overridden bool, err error) { + return false, errors.New("not implemented") +} + +func (system Mssql) discoverStructure(instanceTransfer *data.InstanceTransfer) (*data.InstanceTransfer, error) { + + // Create an ID for the instance tree node based on the instance properties. + treeNodeInstanceID := fmt.Sprintf("%v_%v_%v_%v", + instanceTransfer.SourceInstance.CloudProvider, + instanceTransfer.SourceInstance.CloudAccountID, + instanceTransfer.SourceInstance.Region, + instanceTransfer.SourceInstance.ID, + ) + + instanceTransfer.SchemaTree = &data.SafeTreeNode{ + ID: treeNodeInstanceID, + Name: instanceTransfer.SourceInstance.ID, + ContainsPII: false, + Mu: &sync.Mutex{}, + } + + // List all databases on the SQL Server instance. + databases, err := system.listAllDatabases() + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + // print databases + for _, database := range databases { + fmt.Println(database) + } + + dbConnInfo := system.ConnectionInfo + + for _, database := range databases { + + // Skip SQL Server system databases. + if database == "master" || database == "tempdb" || database == "model" || database == "msdb" || database == "rdsadmin" { + continue + } + + treeNodeDBID := fmt.Sprintf("%v_%v", treeNodeInstanceID, database) + dbNode := instanceTransfer.SchemaTree.AddChild(treeNodeDBID, database) + + // Set the target database in the connection info. + dbConnInfo.Database = database + + // Create a new SQL Server connection using the SQLServer-specific function. + dbSystem, err := newMssql(dbConnInfo) + if err != nil { + return nil, fmt.Errorf("error creating db system :: %v", err) + } + + // List all schemas in the current database. + schemas, err := dbSystem.listAllSchemasInDatabase() + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database %v :: %v", database, err) + } + + placeholders := map[string]string{ + "cloud_provider": instanceTransfer.SourceInstance.CloudProvider, + "cloud_account_id": instanceTransfer.SourceInstance.CloudAccountID, + "cloud_region": instanceTransfer.SourceInstance.Region, + "instance_id": instanceTransfer.SourceInstance.ID, + } + + targetDbTemplate := instanceTransfer.NamingConvention.DatabaseNameInSnowflake + targetSchemaTemplate := instanceTransfer.NamingConvention.SchemaNameInSnowflake + targetTableTemplate := instanceTransfer.NamingConvention.TableNameInSnowflake + + for _, schema := range schemas { + treeNodeSchemaID := fmt.Sprintf("%v_%v", treeNodeDBID, schema) + schemaNode := dbNode.AddChild(treeNodeSchemaID, schema) + + // List all tables in the schema. + tables, err := dbSystem.listAllTablesInSchema(schema) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema %v :: %v", schema, err) + } + for _, table := range tables { + treeNodeTableID := fmt.Sprintf("%v_%v", treeNodeSchemaID, table) + tableNode := schemaNode.AddChild(treeNodeTableID, table) + + id := uuid.New().String() + ctx, cancel := context.WithCancel(context.Background()) + + placeholders["database_name"] = database + placeholders["schema_name"] = schema + placeholders["table_name"] = table + + pattern := regexp.MustCompile(`\[([^\]]+)\]`) + + targetDbName := pattern.ReplaceAllStringFunc(targetDbTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + targetDbName = dashToUnderscoreReplacer.Replace(targetDbName) + + targetSchemaName := pattern.ReplaceAllStringFunc(targetSchemaTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + targetSchemaName = dashToUnderscoreReplacer.Replace(targetSchemaName) + if targetSchemaName == "" { + targetSchemaName = instanceTransfer.NamingConvention.SchemaFallbackInSnowflake + } + + targetTableName := pattern.ReplaceAllStringFunc(targetTableTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + targetTableName = dashToUnderscoreReplacer.Replace(targetTableName) + + // Replace dashes with underscores in the RestoredInstanceID. + stagingDbNameSuffix := strings.ReplaceAll(instanceTransfer.RestoredInstanceID, "-", "_") + stagingDbName := fmt.Sprintf("%v_%v", stagingDbNameSuffix, database) + + transferInfo := &data.TransferInfo{ + ID: id, + Context: ctx, + Cancel: cancel, + SourceInstance: data.Instance{ + ID: instanceTransfer.SourceInstance.ID, + Type: instanceTransfer.SourceInstance.Type, + Host: instanceTransfer.SourceInstance.Host, + Port: instanceTransfer.SourceInstance.Port, + Username: instanceTransfer.SourceInstance.Username, + Password: instanceTransfer.SourceInstance.Password, + }, + SourceDatabase: database, + SourceSchema: schema, + SourceTable: table, + TargetType: instanceTransfer.TargetType, + TargetHost: instanceTransfer.TargetHost, + TargetUsername: instanceTransfer.TargetUsername, + TargetPassword: instanceTransfer.TargetPassword, + TargetDatabase: targetDbName, + TargetSchema: targetSchemaName, + TargetTable: targetTableName, + DropTargetTableIfExists: true, + CreateTargetSchemaIfNotExists: true, + CreateTargetTableIfNotExists: true, + Delimiter: instanceTransfer.Delimiter, + Newline: instanceTransfer.Newline, + Null: instanceTransfer.Null, + PsqlAvailable: instanceTransfer.PsqlAvailable, + BcpAvailable: instanceTransfer.BcpAvailable, + SqlLdrAvailable: instanceTransfer.SqlLdrAvailable, + StagingDbName: stagingDbName, + TableNode: tableNode, + ScanForPII: instanceTransfer.ScanForPII, + } + instanceTransfer.TransferInfos = append(instanceTransfer.TransferInfos, transferInfo) + } + } + } + + return instanceTransfer, nil +} + +func (system Mssql) listAllDatabases() (databases []string, err error) { + rows, err := system.query("SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');") + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + for rows.Next() { + var database string + err = rows.Scan(&database) + if err != nil { + return nil, fmt.Errorf("error scanning database :: %v", err) + } + databases = append(databases, database) + } + + return databases, nil +} + +func (system Mssql) listAllSchemasInDatabase() (schemas []string, err error) { + rows, err := system.query(`SELECT + name +FROM + sys.schemas +WHERE + name NOT IN ('guest', 'sys', 'INFORMATION_SCHEMA', 'db_accessadmin', 'db_backupoperator', +'db_datareader', +'db_datawriter', +'db_ddladmin', +'db_denydatareader', +'db_denydatawriter', +'db_owner', +'db_securityadmin')`) + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database :: %v", err) + } + + for rows.Next() { + var schema string + err = rows.Scan(&schema) + if err != nil { + return nil, fmt.Errorf("error scanning schema :: %v", err) + } + + schemas = append(schemas, schema) + } + + return schemas, nil +} + +func (system Mssql) listAllTablesInSchema(schema string) (tables []string, err error) { + query := fmt.Sprintf(`SELECT t.name + FROM sys.tables t + INNER JOIN sys.schemas s ON t.schema_id = s.schema_id + WHERE s.name = '%v'`, schema) + rows, err := system.query(query) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema :: %v", err) + } + + for rows.Next() { + var table string + err = rows.Scan(&table) + if err != nil { + return nil, fmt.Errorf("error scanning table :: %v", err) + } + + tables = append(tables, table) + } + + return tables, nil +} diff --git a/cmd/transferInstance/system_mysql.go b/cmd/transferInstance/system_mysql.go new file mode 100644 index 00000000..d29e0fda --- /dev/null +++ b/cmd/transferInstance/system_mysql.go @@ -0,0 +1,970 @@ +package main + +import ( + "context" + "database/sql" + "errors" + "fmt" + "regexp" + "strings" + "sync" + "time" + + "github.com/go-sql-driver/mysql" + "github.com/google/uuid" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +type Mysql struct { + Connection *sql.DB + ConnectionInfo ConnectionInfo +} + +func newMysql(connectionInfo ConnectionInfo) (mysql Mysql, err error) { + + connectionString := fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?parseTime=true&loc=US%%2FPacific", connectionInfo.Username, + connectionInfo.Password, connectionInfo.Hostname, connectionInfo.Port, connectionInfo.Database) + + db, err := openConnectionPool(connectionString, DriverMySQL) + if err != nil { + return mysql, fmt.Errorf("error opening mysql db :: %v", err) + } + + mysql.Connection = db + mysql.ConnectionInfo = connectionInfo + + return mysql, nil +} + +func (system Mysql) closeConnectionPool(printError bool) (err error) { + err = system.Connection.Close() + if err != nil && printError { + logger.Error(fmt.Sprintf("error closing connection pool :: %v", err)) + } + return err +} + +func (system Mysql) query(query string) (rows *sql.Rows, err error) { + rows, err = system.Connection.Query(query) + if err != nil { + return nil, fmt.Errorf("error running dql :: %v :: %v", query, err) + } + return rows, nil +} + +func (system Mysql) queryRow(query string) (row *sql.Row) { + row = system.Connection.QueryRow(query) + return row +} + +func (system Mysql) exec(query string) (err error) { + _, err = system.Connection.Exec(query) + if err != nil { + return fmt.Errorf("error running ddl/dml :: %v :: %v", query, err) + } + return nil +} + +func (system Mysql) dropTableIfExistsOverride(schema, table string) (overridden bool, err error) { + return false, nil +} + +func (system Mysql) createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Mysql) driverTypeToPipeType( + columnType *sql.ColumnType, + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "VARCHAR": + return "nvarchar", nil + case "CHAR": + return "nvarchar", nil + case "TEXT": + return "ntext", nil + + case "UNSIGNED BIGINT": + return "int64", nil + case "BIGINT": + return "int64", nil + case "UNSIGNED INT": + return "int64", nil + case "INT": + return "int32", nil + case "MEDIUMINT": + return "int32", nil + case "UNSIGNED SMALLINT": + return "int32", nil + case "YEAR": + return "int16", nil + case "SMALLINT": + return "int16", nil + case "UNSIGNED TINYINT": + return "int16", nil + case "TINYINT": + return "int16", nil + + case "DOUBLE": + return "float64", nil + case "FLOAT": + return "float32", nil + + case "DECIMAL": + return "decimal", nil + + case "DATETIME": + return "datetime", nil + case "TIMESTAMP": + return "datetimetz", nil + case "DATE": + return "date", nil + case "TIME": + return "time", nil + + case "BINARY": + return "blob", nil + case "VARBINARY": + return "blob", nil + case "BLOB": + return "blob", nil + + case "JSON": + return "json", nil + + case "BIT": + return "varbit", nil + + case "GEOMETRY": + return "blob", nil + + default: + return "", fmt.Errorf("unsupported database type for mysql: %v", databaseTypeName) + } +} + +func (system Mysql) pipeTypeToCreateType(columnInfo *data.ColumnInfo) (createType string, err error) { + switch columnInfo.PipeType { + case "nvarchar": + return "longtext", nil + case "varchar": + return "longtext", nil + case "ntext": + return "longtext", nil + case "text": + return "longtext", nil + case "int64": + return "bigint", nil + case "int32": + return "integer", nil + case "int16": + return "smallint", nil + case "float64": + return "double", nil + case "float32": + return "float", nil + case "decimal": + + scaleOk := false + precisionOk := false + + if columnInfo.DecimalOk { + if columnInfo.Scale > 0 && columnInfo.Scale <= 65 { + scaleOk = true + } + + if columnInfo.Precision > 0 && + columnInfo.Precision <= 65 && + columnInfo.Precision > columnInfo.Scale { + precisionOk = true + } + } + + if scaleOk && precisionOk { + return fmt.Sprintf("decimal(%v,%v)", columnInfo.Precision, columnInfo.Scale), nil + } else { + return "double", nil + } + + case "money": + + if columnInfo.DecimalOk { + if columnInfo.Precision > 65 { + return "", fmt.Errorf("precision on column %v is greater than 65", columnInfo.Name) + } + if columnInfo.Scale > 30 { + return "", fmt.Errorf("scale on column %v is greater than 30", columnInfo.Name) + } + return fmt.Sprintf("decimal(%v,%v)", columnInfo.Precision, columnInfo.Scale), nil + } + return "float", nil + + case "datetime": + return "datetime", nil + case "datetimetz": + return "datetime", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "varbinary": + return "blob", nil + case "blob": + return "blob", nil + case "uuid": + return "binary(16)", nil + case "bool": + return "tinyint(1)", nil + case "json": + return "json", nil + case "xml": + return "longtext", nil + case "varbit": + return "longtext", nil + default: + return "", fmt.Errorf("unsupported pipeType for mysql: %v", columnInfo.PipeType) + } +} + +func (system Mysql) createPipeFilesOverride(pipeFileChannelIn chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows, +) (pipeFileInfoChannel chan PipeFileInfo, overridden bool) { + return pipeFileChannelIn, false +} + +func (system Mysql) getPipeFileFormatters() ( + pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error), +) { + pipeFileFormatters = map[string]func(interface{}) (pipeFileValue string, err error){ + "nvarchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "ntext": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "text": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "int64": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to int64 mysqlPipeFileFormatter") + } + return string(valBytes), nil + }, + "int32": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to int32 mysqlPipeFileFormatter") + } + return string(valBytes), nil + }, + "int16": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to int16 mysqlPipeFileFormatter") + } + return string(valBytes), nil + }, + "float64": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to float64 mysqlPipeFileFormatter") + } + return string(valBytes), nil + }, + "float32": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to float32 mysqlPipeFileFormatter") + } + return string(valBytes), nil + }, + "decimal": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "money": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "datetime": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime mysqlPipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "datetimetz": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime mysqlPipeFileFormatters") + } + return valTime.UTC().Format(time.RFC3339Nano), nil + }, + "date": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime mysqlPipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "time": func(v interface{}) (pipeFileValue string, err error) { + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to time mysqlPipeFileFormatter") + } + + valTime, err := time.Parse("15:04:05.999999", string(valBytes)) + if err != nil { + return "", fmt.Errorf( + "error parsing time value in mysqlPipeFileFormatter :: %v", err) + } + + return valTime.Format(time.RFC3339Nano), nil + }, + "varbinary": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "blob": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "uuid": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "bool": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%t", v), nil + }, + "json": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "xml": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varbit": func(v interface{}) (pipeFileValue string, err error) { + + varbitBuilder := strings.Builder{} + + valBytes, ok := v.([]byte) + if !ok { + return "", errors.New("non []uint8 value passed to varbit mysqlPipeFileFormatter") + } + + for _, b := range valBytes { + varbitBuilder.WriteString(fmt.Sprintf("%b", b)) + } + + return strings.TrimLeft(varbitBuilder.String(), "0"), nil + }, + } + + return pipeFileFormatters +} + +func (system Mysql) insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) { + return false, nil +} + +func (system Mysql) convertPipeFilesOverride(pipeFilePath <-chan PipeFileInfo, finalCsvInfoChannelIn chan FinalCsvInfo, transferInfo *data.TransferInfo) (finalCsvInfoChannel chan FinalCsvInfo, overridden bool) { + return finalCsvInfoChannelIn, false +} + +func (system Mysql) getFinalCsvFormatters() ( + finalCsvFormatters map[string]func(string) (finalCsvValue string, err error)) { + return map[string]func(string) (finalCsvValue string, err error){ + "nvarchar": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "varchar": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "ntext": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "text": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "int64": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "int32": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "int16": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "float64": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "float32": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "decimal": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "money": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "datetime": func(v string) (finalCsvValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf( + "error parsing datetimetz value in mysql datetime mysql formatter :: %v", err) + } + + return valTime.Format("2006-01-02 15:04:05.999999"), nil + }, + "datetimetz": func(v string) (finalCsvValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf( + "error parsing datetimetz value in mysql datetimetz mysql formatter :: %v", + err) + } + + return valTime.Format("2006-01-02 15:04:05.999999"), nil + }, + "date": func(v string) (finalCsvValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mysql csv :: %v", err) + } + return valTime.Format("2006-01-02"), nil + }, + "time": func(v string) (finalCsvValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing time value to mysql csv :: %v", err) + } + + return valTime.Format("15:04:05.999999"), nil + }, + "varbinary": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "blob": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "uuid": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "bool": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "json": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "xml": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + "varbit": func(v string) (finalCsvValue string, err error) { + return v, nil + }, + } +} + +func (system Mysql) insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Mysql) runInsertCmd( + finalCsvInfo FinalCsvInfo, + transferInfo *data.TransferInfo, + schema, table string, +) ( + err error, +) { + mysql.RegisterLocalFile(finalCsvInfo.FilePath) + defer mysql.DeregisterLocalFile(finalCsvInfo.FilePath) + + escapedTable := system.escape(table) + + copyQuery := fmt.Sprintf( + `load data local infile '%v' into table %v fields escaped by '' terminated by ',' + optionally enclosed by '"' lines terminated by '\n';`, finalCsvInfo.FilePath, escapedTable) + + err = system.exec(copyQuery) + if err != nil { + return fmt.Errorf("error inserting csv into mysql :: %v", err) + } + + return nil +} + +func (system Mysql) escape(objectName string) (escaped string) { + return fmt.Sprintf("`%v`", objectName) +} + +func (system Mysql) isReservedKeyword(objectName string) bool { + return false +} + +func (system Mysql) schemaRequired() bool { + return false +} + +// func (system Mysql) getPkQuery(table Table) (query string) { +// return fmt.Sprintf(` +// SELECT +// COLUMN_NAME AS column_name +// FROM +// INFORMATION_SCHEMA.KEY_COLUMN_USAGE +// WHERE +// CONSTRAINT_NAME = 'PRIMARY' +// AND TABLE_SCHEMA = '%v' +// AND TABLE_NAME = '%v' +// ORDER BY +// ORDINAL_POSITION ASC; +// `, table.UnescapedSourceSchema, table.EscapedName) +// } + +func (system Mysql) createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) { + err = system.exec(fmt.Sprintf("create database if not exists %v", schema)) + if err != nil { + return false, fmt.Errorf("error creating schema :: %v", err) + } + + return true, nil +} + +// func (system Mysql) getColumnNamesQuery(schema, table string) string { +// return fmt.Sprintf(` +// SELECT +// COLUMN_NAME +// FROM +// INFORMATION_SCHEMA.COLUMNS +// WHERE +// TABLE_SCHEMA = '%v' +// AND TABLE_NAME = '%v' +// ORDER BY +// ORDINAL_POSITION; +// `, table.UnescapedSourceSchema, table.EscapedName) +// } + +func (system Mysql) dbTypeToPipeType( + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "bigint": + return "int64", nil + case "char": + return "nvarchar", nil + case "varchar": + return "nvarchar", nil + case "longtext": + return "ntext", nil + case "mediumtext": + return "ntext", nil + case "text": + return "ntext", nil + case "tinytext": + return "ntext", nil + case "enum": + return "nvarchar", nil + case "int": + return "int32", nil + case "mediumint": + return "int32", nil + case "smallint": + return "int16", nil + case "tinyint": + return "int16", nil + case "double": + return "float64", nil + case "float": + return "float32", nil + case "decimal": + return "decimal", nil + case "datetime": + return "datetime", nil + case "timestamp": + return "datetime", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "year": + return "varchar", nil + case "binary": + return "varbinary", nil + case "varbinary": + return "varbinary", nil + case "longblob": + return "blob", nil + case "mediumblob": + return "blob", nil + case "blob": + return "blob", nil + case "tinyblob": + return "blob", nil + case "geometry": + return "blob", nil + case "bit": + return "varbit", nil + case "json": + return "json", nil + case "set": + return "nvarchar", nil + + default: + return "", fmt.Errorf("unsupported database type for mysql: %v", databaseTypeName) + } +} + +func (system Mysql) IsTableNotFoundError(err error) bool { + return strings.Contains(err.Error(), "doesn't exist") +} + +func (system Mysql) getIncrementalTimeOverride(schema, table, incrementalColumn string, initialLoad bool) (time.Time, bool, bool, error) { + return time.Time{}, false, initialLoad, nil +} + +func (system Mysql) getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) { + + unescapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, false) + + query := fmt.Sprintf(` + SELECT + COLUMN_NAME + FROM + information_schema.KEY_COLUMN_USAGE + WHERE lower(TABLE_NAME) = lower('%v') + AND CONSTRAINT_NAME = 'PRIMARY'; + + `, + unescapedSchemaPeriodTable) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting primary keys rows :: %v", err) + } + + return rows, nil +} + +var mysqlDatetimeFormat = "2006-01-02 15:04:05.999999" +var mysqlDateFormat = "2006-01-02" +var mysqlTimeFormat = "15:04:05.999999" + +func (system Mysql) getSqlFormatters() ( + pipeFileFormatters map[string]func(string) (pipeFileValue string, err error), +) { + return map[string]func(string) (pipeFileValue string, err error){ + "nvarchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "ntext": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "text": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "int64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int16": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "decimal": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "money": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "datetime": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mysql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mysqlDatetimeFormat)), nil + }, + "datetimetz": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mysql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mysqlDatetimeFormat)), nil + }, + "date": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mysql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(mysqlDateFormat)), nil + }, + "time": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to mysql csv :: %v", err) + } + + return fmt.Sprintf("'%v'", valTime.Format(mysqlTimeFormat)), nil + }, + "varbinary": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`UNHEX('%s')`, v), nil + }, + "blob": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`UNHEX('%s'`, v), nil + }, + "uuid": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "bool": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "json": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "xml": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varbit": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + } +} + +func (system Mysql) getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) { + query := fmt.Sprintf(` + WITH PrimaryKeys AS ( + SELECT + kcu.COLUMN_NAME + FROM + information_schema.KEY_COLUMN_USAGE AS kcu + JOIN information_schema.TABLE_CONSTRAINTS AS tc + ON kcu.CONSTRAINT_NAME = tc.CONSTRAINT_NAME + AND kcu.TABLE_NAME = tc.TABLE_NAME + WHERE + tc.CONSTRAINT_TYPE = 'PRIMARY KEY' + AND kcu.TABLE_NAME = '%v' + ) + + SELECT + columns.COLUMN_NAME AS col_name, + columns.DATA_TYPE AS col_type, + COALESCE(columns.NUMERIC_PRECISION, -1) AS col_precision, + COALESCE(columns.NUMERIC_SCALE, -1) AS col_scale, + COALESCE(columns.CHARACTER_MAXIMUM_LENGTH, -1) AS col_length, + CASE WHEN pk.COLUMN_NAME IS NOT NULL THEN true ELSE false END AS col_is_primary + FROM + information_schema.COLUMNS AS columns + LEFT JOIN PrimaryKeys pk ON columns.COLUMN_NAME = pk.COLUMN_NAME + WHERE + columns.TABLE_NAME = '%v' + ORDER BY + columns.ORDINAL_POSITION; + `, table, table) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting table column infos rows :: %v", err) + } + + return rows, nil +} + +func (system Mysql) listAllDatabases() (databases []string, err error) { + rows, err := system.query(`SELECT SCHEMA_NAME +FROM INFORMATION_SCHEMA.SCHEMATA +WHERE SCHEMA_NAME NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys')`) + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + for rows.Next() { + var database string + err = rows.Scan(&database) + if err != nil { + return nil, fmt.Errorf("error scanning database :: %v", err) + } + + databases = append(databases, database) + } + + return databases, nil +} + +func (system Mysql) listAllTablesInDatabase(database string) (tables []string, err error) { + rows, err := system.query(fmt.Sprintf(`SELECT table_name + FROM information_schema.tables + WHERE table_schema = '%v' + AND table_type = 'BASE TABLE'`, database)) + if err != nil { + return nil, fmt.Errorf("error listing all tables in database :: %v", err) + } + + for rows.Next() { + var table string + err = rows.Scan(&table) + if err != nil { + return nil, fmt.Errorf("error scanning table :: %v", err) + } + + tables = append(tables, table) + } + + return tables, nil +} + +func (system Mysql) createDbIfNotExistsOverride(database string) (overridden bool, err error) { + return false, errors.New("not implemented") +} + +func (system Mysql) discoverStructure(instanceTransfer *data.InstanceTransfer) (*data.InstanceTransfer, error) { + + treeNodeInstanceID := fmt.Sprintf("%v_%v_%v_%v", instanceTransfer.SourceInstance.CloudProvider, instanceTransfer.SourceInstance.CloudAccountID, instanceTransfer.SourceInstance.Region, instanceTransfer.SourceInstance.ID) + + instanceTransfer.SchemaTree = &data.SafeTreeNode{ + ID: treeNodeInstanceID, + Name: instanceTransfer.SourceInstance.ID, + ContainsPII: false, + Mu: &sync.Mutex{}, + } + + databases, err := system.listAllDatabases() + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + dbConnInfo := system.ConnectionInfo + + for _, database := range databases { + + treeNodeDBID := fmt.Sprintf("%v_%v", treeNodeInstanceID, database) + dbNode := instanceTransfer.SchemaTree.AddChild(treeNodeDBID, database) + + dbConnInfo.Database = database + + dbSystem, err := newMysql(dbConnInfo) + if err != nil { + return nil, fmt.Errorf("error creating db system :: %v", err) + } + + placeholders := map[string]string{ + "cloud_provider": instanceTransfer.SourceInstance.CloudProvider, + "cloud_account_id": instanceTransfer.SourceInstance.CloudAccountID, + "cloud_region": instanceTransfer.SourceInstance.Region, + "instance_id": instanceTransfer.SourceInstance.ID, + } + + targetDbTemplate := instanceTransfer.NamingConvention.DatabaseNameInSnowflake + targetSchemaTemplate := instanceTransfer.NamingConvention.SchemaFallbackInSnowflake + targetTableTemplate := instanceTransfer.NamingConvention.TableNameInSnowflake + + tables, err := dbSystem.listAllTablesInDatabase(database) + if err != nil { + return nil, fmt.Errorf("error listing all tables in database %v :: %v", database, err) + } + for _, table := range tables { + treeNodeTableID := fmt.Sprintf("%v_%v", database, table) + + tableNode := dbNode.AddChild(treeNodeTableID, table) + + id := uuid.New().String() + ctx, cancel := context.WithCancel(context.Background()) + + placeholders["database_name"] = database + placeholders["table_name"] = table + + pattern := regexp.MustCompile(`\[([^\]]+)\]`) + + targetDbName := pattern.ReplaceAllStringFunc(targetDbTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetDbName = dashToUnderscoreReplacer.Replace(targetDbName) + + targetSchemaName := pattern.ReplaceAllStringFunc(targetSchemaTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetSchemaName = dashToUnderscoreReplacer.Replace(targetSchemaName) + + if targetSchemaName == "" { + targetSchemaName = instanceTransfer.NamingConvention.SchemaFallbackInSnowflake + } + + targetTableName := pattern.ReplaceAllStringFunc(targetTableTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetTableName = dashToUnderscoreReplacer.Replace(targetTableName) + + // replace dashes with underscores in instanceTransferID + stagingDbNameSuffix := strings.ReplaceAll(instanceTransfer.RestoredInstanceID, "-", "_") + stagingDbName := fmt.Sprintf("%v_%v", stagingDbNameSuffix, database) + + transferInfo := &data.TransferInfo{ + ID: id, + Context: ctx, + Cancel: cancel, + SourceInstance: data.Instance{ + ID: instanceTransfer.SourceInstance.ID, + Type: instanceTransfer.SourceInstance.Type, + Host: instanceTransfer.SourceInstance.Host, + Port: instanceTransfer.SourceInstance.Port, + Username: instanceTransfer.SourceInstance.Username, + Password: instanceTransfer.SourceInstance.Password, + }, + SourceDatabase: database, + SourceTable: table, + TargetType: instanceTransfer.TargetType, + TargetHost: instanceTransfer.TargetHost, + TargetUsername: instanceTransfer.TargetUsername, + TargetPassword: instanceTransfer.TargetPassword, + TargetDatabase: targetDbName, + TargetSchema: targetSchemaName, + TargetTable: targetTableName, + DropTargetTableIfExists: true, + CreateTargetSchemaIfNotExists: true, + CreateTargetTableIfNotExists: true, + Delimiter: instanceTransfer.Delimiter, + Newline: instanceTransfer.Newline, + Null: instanceTransfer.Null, + PsqlAvailable: instanceTransfer.PsqlAvailable, + BcpAvailable: instanceTransfer.BcpAvailable, + SqlLdrAvailable: instanceTransfer.SqlLdrAvailable, + StagingDbName: stagingDbName, + TableNode: tableNode, + ScanForPII: instanceTransfer.ScanForPII, + } + instanceTransfer.TransferInfos = append(instanceTransfer.TransferInfos, transferInfo) + } + } + + return instanceTransfer, nil +} diff --git a/cmd/transferInstance/system_oracle.go b/cmd/transferInstance/system_oracle.go new file mode 100644 index 00000000..0ca4ce09 --- /dev/null +++ b/cmd/transferInstance/system_oracle.go @@ -0,0 +1,1161 @@ +package main + +import ( + "context" + "database/sql" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "regexp" + "strings" + "sync" + "time" + + go_ora "github.com/sijms/go-ora/v2" + + "github.com/google/uuid" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +type Oracle struct { + Connection *sql.DB + ConnectionInfo ConnectionInfo +} + +func newOracle(connectionInfo ConnectionInfo) (oracle Oracle, err error) { + + connectionString := go_ora.BuildUrl(connectionInfo.Hostname, connectionInfo.Port, connectionInfo.Database, connectionInfo.Username, connectionInfo.Password, nil) + + // connectionString := fmt.Sprintf("%v/%v@%v:%v/%v", connectionInfo.Username, + // connectionInfo.Password, connectionInfo.Hostname, connectionInfo.Port, connectionInfo.Database) + + db, err := openConnectionPool(connectionString, DriverOracle) + if err != nil { + return oracle, fmt.Errorf("error opening oracle db :: %v", err) + } + + oracle.Connection = db + oracle.ConnectionInfo = connectionInfo + + return oracle, nil +} + +func (system Oracle) query(query string) (rows *sql.Rows, err error) { + rows, err = system.Connection.Query(query) + if err != nil { + return nil, fmt.Errorf("error running dql :: %v :: %v", query, err) + } + return rows, nil +} + +func (system Oracle) queryRow(query string) (row *sql.Row) { + return system.Connection.QueryRow(query) +} + +func (system Oracle) exec(query string) (err error) { + _, err = system.Connection.Exec(query) + if err != nil { + return fmt.Errorf("error running ddl/dml on :: %v :: %v", query, err) + } + return nil +} + +func (system Oracle) dropTableIfExistsOverride(schema, table string) (overridden bool, err error) { + + dropped := getSchemaPeriodTable(schema, table, system, true) + + query := fmt.Sprintf("drop table %v", dropped) + err = system.exec(query) + if err != nil { + if !strings.Contains(err.Error(), "ORA-00942") { + return true, fmt.Errorf("error dropping %v :: %v", dropped, err) + } + } + + return true, nil +} + +func (system Oracle) createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) { + + escapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, true) + + queryBuilder := strings.Builder{} + + queryBuilder.WriteString("declare v_exists number(1); begin select count(*) into v_exists from all_tables where table_name = upper('") + queryBuilder.WriteString(table) + queryBuilder.WriteString("') and owner = upper('") + queryBuilder.WriteString(schema) + queryBuilder.WriteString("'); if v_exists = 0 then execute immediate 'create table ") + queryBuilder.WriteString(escapedSchemaPeriodTable) + queryBuilder.WriteString(" (") + + for i, columnInfo := range transferInfo.ColumnInfos { + createType, err := system.pipeTypeToCreateType(columnInfo) + if err != nil { + return false, fmt.Errorf("error getting pipe type :: %v", err) + } + + if i > 0 { + queryBuilder.WriteString(", ") + } + queryBuilder.WriteString(columnInfo.Name) + queryBuilder.WriteString(" ") + queryBuilder.WriteString(createType) + } + + queryBuilder.WriteString(")'; end if; exception when others then raise; end;") + + query := queryBuilder.String() + + err = system.exec(query) + if err != nil { + return false, fmt.Errorf("error creating table :: %v", err) + } + + return true, nil +} + +func (system Oracle) driverTypeToPipeType( + columnType *sql.ColumnType, + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "NCHAR": + pipeType = "nvarchar" + case "CHAR": + pipeType = "nvarchar" + case "OCIClobLocator": + pipeType = "ntext" + case "LONG": + pipeType = "ntext" + case "IBDouble": + pipeType = "float64" + case "IBFloat": + pipeType = "float32" + case "NUMBER": + pipeType = "decimal" + case "TimeStampDTY": + pipeType = "datetime" + case "TimeStampTZ_DTY": + pipeType = "datetimetz" + case "TimeStampLTZ_DTY": + pipeType = "datetimetz" + case "DATE": + pipeType = "date" + case "RAW": + pipeType = "varbinary" + case "OCIBlobLocator": + pipeType = "blob" + case "OCIFileLocator": + pipeType = "blob" + case "ROWID": + pipeType = "nvarchar" + case "UROWID": + pipeType = "nvarchar" + case "IntervalYM_DTY": + pipeType = "nvarchar" + case "IntervalDS_DTY": + pipeType = "nvarchar" + default: + return "", fmt.Errorf( + "unsupported database type for oracle: %v", columnType.DatabaseTypeName()) + } + + return pipeType, nil +} + +func (system Oracle) pipeTypeToCreateType(columnInfo *data.ColumnInfo) (createType string, err error) { + + length := columnInfo.Length * 4 + + switch columnInfo.PipeType { + case "nvarchar", "varchar": + if columnInfo.LengthOk { + if length <= 0 { + createType = "varchar2(4000)" + } else if length <= 4000 { + createType = fmt.Sprintf("varchar2(%v)", length) + } else { + createType = "clob" + } + } else { + createType = "varchar2(4000)" + } + case "ntext", "text": + createType = "clob" + case "int64": + createType = "number(19)" + case "int32": + createType = "number(10)" + case "int16": + createType = "number(5)" + case "float64": + createType = "BINARY_DOUBLE" + case "float32": + createType = "BINARY_FLOAT" + case "decimal": + + precisionOk := false + scaleOk := false + + if columnInfo.DecimalOk { + if columnInfo.Precision >= 0 && columnInfo.Precision <= 38 { + precisionOk = true + } + if columnInfo.Scale >= 0 && columnInfo.Scale <= 38 { + scaleOk = true + } + } + + if precisionOk && scaleOk { + createType = fmt.Sprintf("decimal(%v, %v)", columnInfo.Precision, columnInfo.Scale) + } else { + createType = "BINARY_DOUBLE" + } + + case "money": + if columnInfo.DecimalOk { + createType = fmt.Sprintf("decimal(%v, %v)", columnInfo.Precision, columnInfo.Scale) + } else { + createType = fmt.Sprintf("decimal(%v, %v)", 38, 4) + } + case "datetime": + createType = "timestamp" + case "datetimetz": + createType = "timestamp" + case "date": + createType = "date" + case "time": + createType = "varchar2(256)" + case "varbinary": + if columnInfo.LengthOk { + if columnInfo.Length <= 0 { + createType = "raw(2000)" + } else if columnInfo.Length <= 2000 { + createType = fmt.Sprintf("raw(%v)", columnInfo.Length) + } else { + createType = "blob" + } + } else { + createType = "raw(2000)" + } + case "blob": + createType = "blob" + case "uuid": + createType = "raw(16)" + case "bool": + createType = "number(1)" + case "json": + createType = "clob" + case "xml": + if columnInfo.LengthOk { + if length <= 0 { + createType = "varchar2(4000)" + } else if length <= 4000 { + createType = fmt.Sprintf("varchar2(%v)", length) + } else { + createType = "clob" + } + } else { + createType = "varchar2(4000)" + } + case "varbit": + if columnInfo.LengthOk { + if length <= 0 { + createType = "varchar2(4000)" + } else if length <= 4000 { + createType = fmt.Sprintf("varchar2(%v)", length) + } else { + createType = "clob" + } + } else { + createType = "varchar2(4000)" + } + default: + return "", fmt.Errorf("unsupported pipe type for oracle: %v", columnInfo.PipeType) + } + + return createType, nil +} + +func (system Oracle) createPipeFilesOverride(pipeFileChannelIn chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows, +) (pipeFileInfoChannel chan PipeFileInfo, overridden bool) { + return pipeFileChannelIn, false +} + +func (system Oracle) getPipeFileFormatters() ( + pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error), +) { + return map[string]func(interface{}) (pipeFileValue string, err error){ + "nvarchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "ntext": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "text": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "int64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int16": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "float64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%v", v), nil + }, + "float32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%v", v), nil + }, + "decimal": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%v", v), nil + }, + "money": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%v", v), nil + }, + "datetime": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime oraclePipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "datetimetz": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetimetz oraclePipeFileFormatters") + } + return valTime.UTC().Format(time.RFC3339Nano), nil + }, + "date": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to date oraclePipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "time": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varbinary": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "blob": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "uuid": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "bool": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%t", v), nil + }, + "json": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "xml": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + } +} + +func (system Oracle) insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) { + finalCsvChannel := convertPipeFiles(pipeFileInfoChannel, transferInfo, system) + + table := transferInfo.TargetTable + + finalCsvPlusCtlFileChannel := system.createCtlFiles(finalCsvChannel, transferInfo, table) + + err = insertFinalCsvs(finalCsvPlusCtlFileChannel, transferInfo, system, transferInfo.TargetSchema, table) + if err != nil { + return true, fmt.Errorf("error inserting final csvs :: %v", err) + } + + return true, nil +} +func (system Oracle) convertPipeFilesOverride(pipeFilePath <-chan PipeFileInfo, finalCsvInfoChannelIn chan FinalCsvInfo, transferInfo *data.TransferInfo, +) (finalCsvInfoChannel chan FinalCsvInfo, overridden bool) { + return finalCsvInfoChannelIn, false +} + +func (system Oracle) createCtlFiles(finalCsvsIn <-chan FinalCsvInfo, transferInfo *data.TransferInfo, table string) <-chan FinalCsvInfo { + + finalCsvChannelOut := make(chan FinalCsvInfo) + + go func() { + defer close(finalCsvChannelOut) + + for finalCsvInfo := range finalCsvsIn { + + finalCsvFile, err := os.Open(finalCsvInfo.FilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error opening final csv file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + defer func() { + finalCsvFile.Close() + }() + + oracleCtlFile, err := os.Create(filepath.Join(transferInfo.FinalCsvDir, + fmt.Sprintf("%v.ctl", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv")))) + if err != nil { + transferInfo.Error = fmt.Sprintf("error creating oracle ctl file :: %v", err) + logger.Error(transferInfo.Error) + return + } + defer oracleCtlFile.Close() + + controlFileBuilder := strings.Builder{} + + controlFileBuilder.WriteString(`LOAD DATA CHARACTERSET 'AL32UTF8' infile '`) + controlFileBuilder.WriteString(filepath.Join(transferInfo.FinalCsvDir, + fmt.Sprintf("%v.csv", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv")))) + controlFileBuilder.WriteString(`' append into table `) + if transferInfo.TargetSchema != "" { + controlFileBuilder.WriteString(transferInfo.TargetSchema) + controlFileBuilder.WriteString(".") + } + + escapedTable := escapeIfNeeded(table, system) + + controlFileBuilder.WriteString(escapedTable) + controlFileBuilder.WriteString( + ` fields csv with embedded terminated by ',' optionally enclosed by '"' (`) + + firstCol := true + + for i, column := range transferInfo.ColumnInfos { + + if !firstCol { + controlFileBuilder.WriteString(" ,") + } + + controlFileBuilder.WriteString(column.Name) + + switch column.PipeType { + case "date": + controlFileBuilder.WriteString(" date 'YYYY-MM-DD'") + case "datetime": + controlFileBuilder.WriteString(" timestamp 'YYYY-MM-DD HH24:MI:SS.FF'") + case "datetimetz": + controlFileBuilder.WriteString( + " timestamp with time zone 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM'") + default: + maxLen, err := maxColumnByteLength(finalCsvInfo.FilePath, transferInfo.Null, i) + if err != nil { + transferInfo.Error = fmt.Sprintf("error getting max column length :: %v", err) + logger.Error(transferInfo.Error) + return + } + controlFileBuilder.WriteString(" char(") + controlFileBuilder.WriteString(fmt.Sprint(maxLen)) + controlFileBuilder.WriteString(") PRESERVE BLANKS") + } + + controlFileBuilder.WriteString(" nullif ") + controlFileBuilder.WriteString(column.Name) + controlFileBuilder.WriteString("='") + controlFileBuilder.WriteString(transferInfo.Null) + controlFileBuilder.WriteString("'") + + firstCol = false + } + + controlFileBuilder.WriteString(")") + + // write frontmatter to oracle file + _, err = oracleCtlFile.WriteString(controlFileBuilder.String()) + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing to oracle ctl file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + err = oracleCtlFile.Close() + if err != nil { + transferInfo.Error = fmt.Sprintf("error closing oracle ctl file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + finalCsvChannelOut <- finalCsvInfo + } + + logger.Info("transferInfo %v finished creating sqllder ctl files") + }() + + return finalCsvChannelOut +} + +func (system Oracle) insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Oracle) getFinalCsvFormatters() map[string]func(string) (string, error) { + return map[string]func(string) (string, error){ + "nvarchar": func(v string) (string, error) { + return v, nil + }, + "varchar": func(v string) (string, error) { + return v, nil + }, + "ntext": func(v string) (string, error) { + return v, nil + }, + "text": func(v string) (string, error) { + return v, nil + }, + "int64": func(v string) (string, error) { + return v, nil + }, + "int32": func(v string) (string, error) { + return v, nil + }, + "int16": func(v string) (string, error) { + return v, nil + }, + "float64": func(v string) (string, error) { + return v, nil + }, + "float32": func(v string) (string, error) { + return v, nil + }, + "decimal": func(v string) (string, error) { + return v, nil + }, + "money": func(v string) (string, error) { + return v, nil + }, + "datetime": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing datetime value to oracle csv :: %v", err) + } + return valTime.Format("2006-01-02 15:04:05.999999"), nil + }, + "datetimetz": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing datetime value to oracle csv :: %v", err) + } + return valTime.UTC().Format("2006-01-02 15:04:05.999999 -07:00"), nil + }, + "date": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to oracle csv :: %v", err) + } + return valTime.Format("2006-01-02"), nil + }, + "time": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing time value to oracle csv :: %v", err) + } + + return valTime.Format("15:04:05.999999"), nil + }, + "varbinary": func(v string) (string, error) { + return v, nil + }, + "blob": func(v string) (string, error) { + return v, nil + }, + "uuid": func(v string) (string, error) { + return strings.Replace(v, "-", "", -1), nil + }, + "bool": func(v string) (string, error) { + if v == "1" || v == "true" { + return "1", nil + } + return "0", nil + }, + "json": func(v string) (string, error) { + return v, nil + }, + "xml": func(v string) (string, error) { + return v, nil + }, + "varbit": func(v string) (string, error) { + return v, nil + }, + } +} + +func (system Oracle) runInsertCmd( + finalCsvInfo FinalCsvInfo, + transferInfo *data.TransferInfo, + schema, table string, +) ( + err error, +) { + + ctlFileName := filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%v.ctl", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv"))) + logFileName := filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%v.log", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv"))) + badFileName := filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%v.bad", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv"))) + discardFileName := filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%v.discard", strings.TrimSuffix(filepath.Base(finalCsvInfo.FilePath), ".csv"))) + + if !transferInfo.KeepFiles { + defer os.Remove(logFileName) + defer os.Remove(badFileName) + defer os.Remove(discardFileName) + defer os.Remove(ctlFileName) + } + + cmd := exec.CommandContext( + transferInfo.Context, + "sqlldr", + fmt.Sprintf("%s/%s@%s:%d/%s", transferInfo.TargetUsername, transferInfo.TargetPassword, + transferInfo.TargetHost, transferInfo.TargetPort, transferInfo.TargetDatabase), + fmt.Sprintf("control=%s", ctlFileName), + fmt.Sprintf("LOG=%s", logFileName), + fmt.Sprintf("BAD=%s", badFileName), + fmt.Sprintf("DISCARD=%s", discardFileName), + ) + + result, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf( + "failed to upload csv to oracle :: stderr %v :: stdout %s", err, string(result)) + } + + return nil +} + +func (system Oracle) schemaRequired() bool { + return true +} + +func (system Oracle) escape(objectName string) (escaped string) { + return fmt.Sprintf(`"%v"`, objectName) +} + +func (system Oracle) isReservedKeyword(objectName string) bool { + return false +} + +func (system Oracle) createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) { + var count int + + // Check if the user/schema already exists + err = system.queryRow(fmt.Sprintf("SELECT COUNT(1) FROM dba_users WHERE username = UPPER('%v')", schema)).Scan(&count) + if err != nil { + return true, fmt.Errorf("error checking if user exists :: %v", err) + } + + if count == 0 { + randomChars, err := RandomPrintableAsciiCharacters(20) + if err != nil { + return true, fmt.Errorf("error generating random password :: %v", err) + } + + // Create the user/schema + err = system.exec(fmt.Sprintf(`CREATE USER %s identified by "%v"`, schema, randomChars)) + if err != nil { + return true, err + } + logger.Info(fmt.Sprintf("Created user %s in oracle with password %s", schema, randomChars)) + } + + return true, nil +} + +func (system Oracle) IsTableNotFoundError(err error) bool { + return strings.Contains(err.Error(), "does not exist") +} + +func (system Oracle) closeConnectionPool(printError bool) (err error) { + err = system.Connection.Close() + if err != nil && printError { + logger.Error(fmt.Sprintf("error closing connection pool :: %v", err)) + } + return err +} + +func (system Oracle) dbTypeToPipeType( + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "NUMBER": + return "decimal", nil + case "NCHAR": + return "nvarchar", nil + case "FLOAT": + return "float64", nil + case "VARCHAR2": + return "nvarchar", nil + case "DATE": + return "date", nil + case "BINARY_FLOAT": + return "float32", nil + case "BINARY_DOUBLE": + return "float64", nil + case "RAW": + return "varbinary", nil + case "CHAR": + return "nvarchar", nil + case "TIMESTAMP": + return "datetime", nil + case "TIMESTAMP WITH TIME ZONE": + return "datetimetz", nil + case "INTERVAL": + return "nvarchar", nil + case "UROWID": + return "nvarchar", nil + case "TIMESTAMP WITH LOCAL TIME ZONE": + return "datetimetz", nil + case "CLOB": + return "ntext", nil + case "BLOB": + return "blob", nil + case "NCLOB": + return "ntext", nil + default: + return "", fmt.Errorf("unsupported database type for oracle: %v", databaseTypeName) + } +} + +func (system Oracle) getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) { + query := fmt.Sprintf(` + WITH PrimaryKeys AS ( + SELECT + cols.column_name + FROM + all_constraints cons + JOIN all_cons_columns cols + ON cons.constraint_name = cols.constraint_name + AND cons.owner = cols.owner + WHERE + cons.constraint_type = 'P' + AND cons.owner = upper('%v') + AND cons.table_name = upper('%v') + ) + + SELECT + col.column_name AS col_name, + CASE + WHEN col.data_type LIKE 'TIMESTAMP(%%) WITH%%' THEN + REPLACE(col.data_type, SUBSTR(col.data_type, INSTR(col.data_type, '('), INSTR(col.data_type, ')') - INSTR(col.data_type, '(') + 1), '') + WHEN col.data_type LIKE 'TIMESTAMP(%%)' THEN + REPLACE(col.data_type, SUBSTR(col.data_type, INSTR(col.data_type, '('), INSTR(col.data_type, ')') - INSTR(col.data_type, '(') + 1), '') + WHEN col.data_type LIKE 'INTERVAL%%' THEN + 'INTERVAL' + ELSE + col.data_type + END AS col_type, + COALESCE(col.data_precision, -1) AS col_precision, + COALESCE(col.data_scale, -1) AS col_scale, + COALESCE(col.data_length, -1) AS col_length, + CASE WHEN pk.column_name IS NOT NULL THEN 1 ELSE 0 END AS col_is_primary + FROM + all_tab_columns col + LEFT JOIN PrimaryKeys pk ON col.column_name = pk.column_name + WHERE + col.owner = upper('%v') + AND col.table_name = upper('%v') + ORDER BY + col.column_id`, + schema, table, schema, table, + ) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting table column infos rows :: %v", err) + } + + return rows, nil +} + +func (system Oracle) getIncrementalTimeOverride(schema, table, incrementalColumn string, initialLoad bool) (time.Time, bool, bool, error) { + return time.Time{}, false, initialLoad, nil +} + +func (system Oracle) getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) { + + query := fmt.Sprintf(` + SELECT + acc.column_name + FROM + all_constraints ac + JOIN + all_cons_columns acc ON ac.constraint_name = acc.constraint_name AND ac.owner = acc.owner + WHERE + ac.constraint_type = 'P' + AND ac.owner = upper('%v') + AND ac.table_name = upper('%v') + ORDER BY + acc.position;`, + schema, table) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting primary keys rows :: %v", err) + } + + return rows, nil +} + +var oracleDatetimeFormat = "2006-01-02 15:04:05.999999" +var oracleDateFormat = "2006-01-02" +var oracleTimeFormat = "15:04:05.999999" + +func (system Oracle) getSqlFormatters() ( + pipeFileFormatters map[string]func(string) (pipeFileValue string, err error), +) { + return map[string]func(string) (pipeFileValue string, err error){ + "nvarchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "ntext": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "text": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "int64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int16": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "decimal": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "money": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "datetime": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to oracle csv :: %v", err) + } + return fmt.Sprintf("TO_TIMESTAMP('%v', 'YYYY-MM-DD HH24:MI:SS.FF6')", valTime.Format(oracleDatetimeFormat)), nil + }, + "datetimetz": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to oracle csv :: %v", err) + } + return fmt.Sprintf("TO_TIMESTAMP('%v', 'YYYY-MM-DD HH24:MI:SS.FF6')", valTime.Format(oracleDatetimeFormat)), nil + }, + "date": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to oracle csv :: %v", err) + } + return fmt.Sprintf("TO_DATE('%v', 'YYYY-MM-DD')", valTime.Format(oracleDateFormat)), nil + }, + "time": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to oracle csv :: %v", err) + } + + return fmt.Sprintf("'%v'", valTime.Format(oracleTimeFormat)), nil + }, + "varbinary": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`HEXTORAW('%s')`, v), nil + }, + "blob": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`HEXTORAW('%s')`, v), nil + }, + "uuid": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "bool": func(v string) (pipeFileValue string, err error) { + if v == "true" { + return "1", nil + } + return "0", nil + }, + "json": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "xml": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varbit": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + } +} + +func (system Oracle) listAllDatabases() (databases []string, err error) { + rows, err := system.query("SELECT name AS database_name FROM v$database") + if err != nil { + return nil, fmt.Errorf("error querying databases :: %v", err) + } + defer rows.Close() + + var database string + if rows.Next() { + err = rows.Scan(&database) + if err != nil { + return nil, fmt.Errorf("error scanning database name :: %v", err) + } + } + + return []string{database}, nil +} + +func (system Oracle) listAllSchemasInDatabase() (schemas []string, err error) { + rows, err := system.query(`SELECT username AS schema_name +FROM all_users +WHERE username NOT IN ( + 'ANONYMOUS', + 'APPQOSSYS', + 'AUDSYS', + 'CTXSYS', + 'DBSFWUSER', + 'DBSNMP', + 'DIP', + 'GGSYS', + 'GSMADMIN_INTERNAL', + 'GSMCATUSER', + 'GSMUSER', + 'OUTLN', + 'RDSADMIN', + 'REMOTE_SCHEDULER_AGENT', + 'SYS', + 'SYS$UMF', + 'SYSBACKUP', + 'SYSDG', + 'SYSKM', + 'SYSRAC', + 'SYSTEM', + 'XDB', + 'XS$NULL' +) +ORDER BY username`) + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database :: %v", err) + } + + for rows.Next() { + var schema string + err = rows.Scan(&schema) + if err != nil { + return nil, fmt.Errorf("error scanning schema :: %v", err) + } + + schemas = append(schemas, schema) + } + + return schemas, nil +} + +func (system Oracle) listAllTablesInSchema(schema string) (tables []string, err error) { + rows, err := system.query(fmt.Sprintf(`SELECT table_name + FROM all_tables + WHERE owner = UPPER('%v')`, schema)) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema :: %v", err) + } + + for rows.Next() { + var table string + err = rows.Scan(&table) + if err != nil { + return nil, fmt.Errorf("error scanning table :: %v", err) + } + + tables = append(tables, table) + } + + return tables, nil +} + +func (system Oracle) discoverStructure(instanceTransfer *data.InstanceTransfer) (*data.InstanceTransfer, error) { + + treeNodeInstanceID := fmt.Sprintf("%v_%v_%v_%v", + instanceTransfer.SourceInstance.CloudProvider, + instanceTransfer.SourceInstance.CloudAccountID, + instanceTransfer.SourceInstance.Region, + instanceTransfer.SourceInstance.ID, + ) + + instanceTransfer.SchemaTree = &data.SafeTreeNode{ + ID: treeNodeInstanceID, + Name: instanceTransfer.SourceInstance.ID, + ContainsPII: false, + Mu: &sync.Mutex{}, + } + + databases, err := system.listAllDatabases() + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + dbConnInfo := system.ConnectionInfo + + for _, database := range databases { + + // skip rdsadmin database + if database == "rdsadmin" { + continue + } + + treeNodeDBID := fmt.Sprintf("%v_%v", treeNodeInstanceID, database) + dbNode := instanceTransfer.SchemaTree.AddChild(treeNodeDBID, database) + + dbConnInfo.Database = database + + dbSystem, err := newOracle(dbConnInfo) + if err != nil { + return nil, fmt.Errorf("error creating db system :: %v", err) + } + + schemas, err := dbSystem.listAllSchemasInDatabase() + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database %v :: %v", database, err) + } + + placeholders := map[string]string{ + "cloud_provider": instanceTransfer.SourceInstance.CloudProvider, + "cloud_account_id": instanceTransfer.SourceInstance.CloudAccountID, + "cloud_region": instanceTransfer.SourceInstance.Region, + "instance_id": instanceTransfer.SourceInstance.ID, + } + + targetDbTemplate := instanceTransfer.NamingConvention.DatabaseNameInSnowflake + targetSchemaTemplate := instanceTransfer.NamingConvention.SchemaNameInSnowflake + targetTableTemplate := instanceTransfer.NamingConvention.TableNameInSnowflake + + for _, schema := range schemas { + treeNodeSchemaID := fmt.Sprintf("%v_%v", treeNodeDBID, schema) + + schemaNode := dbNode.AddChild(treeNodeSchemaID, schema) + + tables, err := dbSystem.listAllTablesInSchema(schema) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema %v :: %v", schema, err) + } + for _, table := range tables { + treeNodeTableID := fmt.Sprintf("%v_%v", treeNodeSchemaID, table) + + tableNode := schemaNode.AddChild(treeNodeTableID, table) + + id := uuid.New().String() + ctx, cancel := context.WithCancel(context.Background()) + + placeholders["database_name"] = database + placeholders["schema_name"] = schema + placeholders["table_name"] = table + + pattern := regexp.MustCompile(`\[([^\]]+)\]`) + + targetDbName := pattern.ReplaceAllStringFunc(targetDbTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetDbName = dashToUnderscoreReplacer.Replace(targetDbName) + + targetSchemaName := pattern.ReplaceAllStringFunc(targetSchemaTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetSchemaName = dashToUnderscoreReplacer.Replace(targetSchemaName) + + if targetSchemaName == "" { + targetSchemaName = instanceTransfer.NamingConvention.SchemaFallbackInSnowflake + } + + targetTableName := pattern.ReplaceAllStringFunc(targetTableTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetTableName = dashToUnderscoreReplacer.Replace(targetTableName) + + // replace dashes with underscores in instanceTransferID + stagingDbNameSuffix := strings.ReplaceAll(instanceTransfer.RestoredInstanceID, "-", "_") + stagingDbName := fmt.Sprintf("%v_%v", stagingDbNameSuffix, database) + + transferInfo := &data.TransferInfo{ + ID: id, + Context: ctx, + Cancel: cancel, + SourceInstance: data.Instance{ + ID: instanceTransfer.SourceInstance.ID, + Type: instanceTransfer.SourceInstance.Type, + Host: instanceTransfer.SourceInstance.Host, + Port: instanceTransfer.SourceInstance.Port, + Username: instanceTransfer.SourceInstance.Username, + Password: instanceTransfer.SourceInstance.Password, + }, + SourceDatabase: database, + SourceSchema: schema, + SourceTable: table, + TargetType: instanceTransfer.TargetType, + TargetHost: instanceTransfer.TargetHost, + TargetUsername: instanceTransfer.TargetUsername, + TargetPassword: instanceTransfer.TargetPassword, + TargetDatabase: targetDbName, + TargetSchema: targetSchemaName, + TargetTable: targetTableName, + DropTargetTableIfExists: true, + CreateTargetSchemaIfNotExists: true, + CreateTargetTableIfNotExists: true, + Delimiter: instanceTransfer.Delimiter, + Newline: instanceTransfer.Newline, + Null: instanceTransfer.Null, + PsqlAvailable: instanceTransfer.PsqlAvailable, + BcpAvailable: instanceTransfer.BcpAvailable, + SqlLdrAvailable: instanceTransfer.SqlLdrAvailable, + StagingDbName: stagingDbName, + TableNode: tableNode, + ScanForPII: instanceTransfer.ScanForPII, + } + instanceTransfer.TransferInfos = append(instanceTransfer.TransferInfos, transferInfo) + } + } + } + + return instanceTransfer, nil +} + +func (system Oracle) createDbIfNotExistsOverride(database string) (overridden bool, err error) { + return false, errors.New("not implemented") +} diff --git a/cmd/transferInstance/system_postgresql.go b/cmd/transferInstance/system_postgresql.go new file mode 100644 index 00000000..46aaf802 --- /dev/null +++ b/cmd/transferInstance/system_postgresql.go @@ -0,0 +1,1051 @@ +package main + +import ( + "context" + "database/sql" + "errors" + "fmt" + "os/exec" + "regexp" + "strings" + "sync" + "time" + + "github.com/google/uuid" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +type Postgresql struct { + Connection *sql.DB + ConnectionInfo ConnectionInfo +} + +func newPostgresql(connectionInfo ConnectionInfo) (postgresql Postgresql, err error) { + + // connectionString := fmt.Sprintf("postgresql://%v:%v@%v:%v/%v?sslmode=verify-full", connectionInfo.Username, + connectionString := fmt.Sprintf("postgresql://%v:%v@%v:%v/%v", connectionInfo.Username, + connectionInfo.Password, connectionInfo.Hostname, connectionInfo.Port, connectionInfo.Database) + + db, err := openConnectionPool(connectionString, DriverPostgreSQL) + if err != nil { + return postgresql, fmt.Errorf("error opening postgresql db :: %v", err) + } + + postgresql.Connection = db + postgresql.ConnectionInfo = connectionInfo + + return postgresql, nil +} + +func (system Postgresql) closeConnectionPool(printError bool) (err error) { + err = system.Connection.Close() + if err != nil && printError { + logger.Error(fmt.Sprintf("error closing connection pool :: %v", err)) + } + return err +} + +func (system Postgresql) query(query string) (rows *sql.Rows, err error) { + rows, err = system.Connection.Query(query) + if err != nil { + return nil, fmt.Errorf("error running dql :: %v :: %v", query, err) + } + return rows, nil +} + +func (system Postgresql) queryRow(query string) (row *sql.Row) { + return system.Connection.QueryRow(query) +} + +func (system Postgresql) exec(query string) (err error) { + _, err = system.Connection.Exec(query) + if err != nil { + return fmt.Errorf("error running ddl/dml :: %v :: %v", query, err) + } + return nil +} + +func (system Postgresql) dropTableIfExistsOverride(schema, table string) (overridden bool, err error) { + return false, nil +} + +func (system Postgresql) driverTypeToPipeType( + columnType *sql.ColumnType, + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch columnType.DatabaseTypeName() { + case "VARCHAR": + return "nvarchar", nil + case "BPCHAR": + return "nvarchar", nil + case "TEXT": + return "ntext", nil + case "INT8": + return "int64", nil + case "INT4": + return "int32", nil + case "INT2": + return "int16", nil + case "FLOAT8": + return "float64", nil + case "FLOAT4": + return "float32", nil + case "NUMERIC": + return "decimal", nil + case "TIMESTAMP": + return "datetime", nil + case "TIMESTAMPTZ": + return "datetimetz", nil + case "DATE": + return "date", nil + case "INTERVAL": + return "nvarchar", nil + case "TIME": + return "time", nil + case "BYTEA": + return "blob", nil + case "UUID": + return "uuid", nil + case "BOOL": + return "bool", nil + case "JSON": + return "json", nil + case "JSONB": + return "json", nil + case "142": + return "xml", nil + case "BIT": + return "varbit", nil + case "VARBIT": + return "varbit", nil + case "BOX": + return "nvarchar", nil + case "CIRCLE": + return "nvarchar", nil + case "LINE": + return "nvarchar", nil + case "PATH": + return "nvarchar", nil + case "POINT": + return "nvarchar", nil + case "POLYGON": + return "nvarchar", nil + case "LSEG": + return "nvarchar", nil + case "INET": + return "nvarchar", nil + case "MACADDR": + return "nvarchar", nil + case "1266": + return "nvarchar", nil + case "774": + return "nvarchar", nil + case "CIDR": + return "nvarchar", nil + case "3220": + return "nvarchar", nil + case "5038": + return "nvarchar", nil + case "3615": + return "nvarchar", nil + case "3614": + return "nvarchar", nil + case "2970": + return "nvarchar", nil + default: + return "", fmt.Errorf("unsupported database type for postgresql: %v", columnType.DatabaseTypeName()) + } +} + +func (system Postgresql) dbTypeToPipeType( + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "character varying": + return "nvarchar", nil + case "character": + return "nvarchar", nil + case "text": + return "ntext", nil + case "bigint": + return "int64", nil + case "integer": + return "int32", nil + case "smallint": + return "int16", nil + case "double precision": + return "float64", nil + case "real": + return "float32", nil + case "numeric": + return "decimal", nil + case "timestamp without time zone": + return "datetime", nil + case "timestamp with time zone": + return "datetimetz", nil + case "date": + return "date", nil + case "interval": + return "nvarchar", nil + case "time without time zone": + return "time", nil + case "time with time zone": + return "nvarchar", nil + case "bytea": + return "blob", nil + case "uuid": + return "uuid", nil + case "boolean": + return "bool", nil + case "json": + return "json", nil + case "jsonb": + return "json", nil + case "xml": + return "xml", nil + case "bit": + return "varbit", nil + case "bit varying": + return "varbit", nil + case "box": + return "nvarchar", nil + case "circle": + return "nvarchar", nil + case "line": + return "nvarchar", nil + case "path": + return "nvarchar", nil + case "point": + return "nvarchar", nil + case "polygon": + return "nvarchar", nil + case "lseg": + return "nvarchar", nil + case "inet": + return "nvarchar", nil + case "macaddr": + return "nvarchar", nil + case "cidr": + return "nvarchar", nil + case "tsvector": + return "nvarchar", nil + case "tsquery": + return "nvarchar", nil + case "txid_snapshot": + return "nvarchar", nil + case "pg_lsn": + return "nvarchar", nil + case "pg_snapshot": + return "nvarchar", nil + case "USER-DEFINED": + return "nvarchar", nil + default: + return "", fmt.Errorf("unsupported database type for postgresql: %v", databaseTypeName) + } +} + +func (system Postgresql) pipeTypeToCreateType( + columnInfo *data.ColumnInfo, +) ( + createType string, + err error, +) { + switch columnInfo.PipeType { + case "nvarchar": + return "text", nil + case "varchar": + return "text", nil + case "ntext": + return "text", nil + case "text": + return "text", nil + case "int64": + return "bigint", nil + case "int32": + return "integer", nil + case "int16": + return "smallint", nil + case "float64": + return "double precision", nil + case "float32": + return "float", nil + case "decimal": + scaleOk := false + precisionOk := false + + if columnInfo.DecimalOk { + if columnInfo.Scale > 0 && columnInfo.Scale <= 1000 { + scaleOk = true + } + + if columnInfo.Precision > 0 && columnInfo.Precision <= 1000 && columnInfo.Precision > columnInfo.Scale { + precisionOk = true + } + } + + if scaleOk && precisionOk { + return fmt.Sprintf("decimal(%v,%v)", columnInfo.Precision, columnInfo.Scale), nil + } else { + return "decimal", nil + } + case "money": + return "money", nil + case "datetime": + return "timestamp", nil + case "datetimetz": + return "timestamp", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "varbinary": + return "bytea", nil + case "blob": + return "bytea", nil + case "uuid": + return "uuid", nil + case "bool": + return "boolean", nil + case "json": + return "jsonb", nil + case "xml": + return "xml", nil + case "varbit": + return "varbit", nil + default: + return "", fmt.Errorf("unsupported pipeType for postgresql: %v", columnInfo.PipeType) + } +} + +func (system Postgresql) createPipeFilesOverride(pipeFileChannelIn chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows, +) (pipeFileInfoChannel chan PipeFileInfo, overridden bool) { + return pipeFileChannelIn, false +} + +func (system Postgresql) getPipeFileFormatters() ( + pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error), +) { + return map[string]func(interface{}) (pipeFileValue string, err error){ + "nvarchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "varchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "ntext": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "text": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "int64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int16": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "float64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "float32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "decimal": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "money": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "datetime": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New("non time.Time value passed to datetime postgresqlPipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "datetimetz": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New("non time.Time value passed to datetimetz postgresqlPipeFileFormatters") + } + return valTime.UTC().Format(time.RFC3339Nano), nil + }, + "date": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New("non time.Time value passed to date postgresqlPipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "time": func(v interface{}) (pipeFileValue string, err error) { + timeString, ok := v.(string) + if !ok { + return "", errors.New("unable to cast value to string in postgresqlPipeFileFormatters") + } + + timeVal, err := time.Parse("15:04:05.999999", timeString) + if err != nil { + fmt.Println(timeString) + return "", errors.New("error parsing time value in postgresqlPipeFileFormatters") + } + + return timeVal.Format(time.RFC3339Nano), nil + }, + "varbinary": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "blob": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "uuid": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "bool": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%t", v), nil + }, + "json": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "xml": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + "varbit": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprint(v), nil + }, + } +} + +var singleQuoteReplacer = strings.NewReplacer("'", "''") +var postgresqlTimeFormatString = "2006-01-02 15:04:05.999999" + +func (system Postgresql) getSqlFormatters() ( + pipeFileFormatters map[string]func(string) (pipeFileValue string, err error), +) { + return map[string]func(string) (pipeFileValue string, err error){ + "nvarchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "ntext": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "text": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "int64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int16": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "decimal": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "money": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "datetime": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to psql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(postgresqlTimeFormatString)), nil + }, + "datetimetz": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to psql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(postgresqlTimeFormatString)), nil + }, + "date": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to psql csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(postgresqlTimeFormatString)), nil + }, + "time": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to psql csv :: %v", err) + } + + return fmt.Sprintf("'%v'", valTime.Format(postgresqlTimeFormatString)), nil + }, + "varbinary": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`\x%s`, v), nil + }, + "blob": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`\x%s`, v), nil + }, + "uuid": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "bool": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "json": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "xml": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varbit": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + } +} + +func (system Postgresql) insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) { + return false, nil +} + +func (system Postgresql) convertPipeFilesOverride(pipeFilePath <-chan PipeFileInfo, finalCsvInfoChannelIn chan FinalCsvInfo, transferInfo *data.TransferInfo) (finalCsvInfoChannel chan FinalCsvInfo, overridden bool) { + return finalCsvInfoChannelIn, false +} + +func (system Postgresql) getFinalCsvFormatters() ( + finalCsvFormatters map[string]func(string) (finalCsvValue string, err error), +) { + return map[string]func(string) (string, error){ + "nvarchar": func(v string) (string, error) { + return v, nil + }, + "varchar": func(v string) (string, error) { + return v, nil + }, + "ntext": func(v string) (string, error) { + return v, nil + }, + "text": func(v string) (string, error) { + return v, nil + }, + "int64": func(v string) (string, error) { + return v, nil + }, + "int32": func(v string) (string, error) { + return v, nil + }, + "int16": func(v string) (string, error) { + return v, nil + }, + "float64": func(v string) (string, error) { + return v, nil + }, + "float32": func(v string) (string, error) { + return v, nil + }, + "decimal": func(v string) (string, error) { + return v, nil + }, + "money": func(v string) (string, error) { + return v, nil + }, + "datetime": func(v string) (string, error) { + return v, nil + }, + "datetimetz": func(v string) (string, error) { + return v, nil + }, + "date": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to psql csv :: %v", err) + } + return valTime.Format("2006-01-02"), nil + }, + "time": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing time value to psql csv :: %v", err) + } + + return valTime.Format("15:04:05.999999"), nil + }, + "varbinary": func(v string) (string, error) { + return fmt.Sprintf(`\x%s`, v), nil + }, + "blob": func(v string) (string, error) { + return fmt.Sprintf(`\x%s`, v), nil + }, + "uuid": func(v string) (string, error) { + return v, nil + }, + "bool": func(v string) (string, error) { + return v, nil + }, + "json": func(v string) (string, error) { + return v, nil + }, + "xml": func(v string) (string, error) { + return v, nil + }, + "varbit": func(v string) (string, error) { + return v, nil + }, + } +} + +func (system Postgresql) insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Postgresql) runInsertCmd( + finalCsvInfo FinalCsvInfo, + transferInfo *data.TransferInfo, + schema, table string, +) ( + err error, +) { + + escapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, true) + + copyCmd := fmt.Sprintf(`\copy %v FROM '%s' WITH + (FORMAT csv, HEADER false, DELIMITER ',', QUOTE '"', ESCAPE '"', NULL '%v', ENCODING 'UTF8')`, + escapedSchemaPeriodTable, finalCsvInfo.FilePath, transferInfo.Null) + + cmd := exec.CommandContext(transferInfo.Context, "psql", transferInfo.TargetConnectionString, "-c", copyCmd) + + result, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to upload csv to postgresql :: stderr %v :: stdout %s", + err, string(result)) + } + + return nil +} + +func (system Postgresql) schemaRequired() bool { + return true +} + +func (system Postgresql) isReservedKeyword(keyword string) bool { + if _, ok := postgresqlReservedKeywords[keyword]; ok { + return true + } + + return false +} + +func (system Postgresql) escape(objectName string) (escaped string) { + return fmt.Sprintf(`"%v"`, objectName) +} + +var postgresqlReservedKeywords = map[string]bool{ + "all": true, + "analyse": true, + "analyze": true, + "and": true, + "any": true, + "array": true, + "as": true, + "asc": true, + "asymmetric": true, + "both": true, + "case": true, + "cast": true, + "check": true, + "collate": true, + "column": true, + "constraint": true, + "create": true, + "current_catalog": true, + "current_date": true, + "current_role": true, + "current_time": true, + "current_timestamp": true, + "current_user": true, + "default": true, + "desc": true, + "distinct": true, + "do": true, + "else": true, + "end": true, + "except": true, + "false": true, + "for": true, + "foreign": true, + "from": true, + "full": true, + "grant": true, + "group": true, + "having": true, + "in": true, + "initially": true, + "inner": true, + "intersect": true, + "into": true, + "is": true, + "join": true, + "leading": true, + "left": true, + "like": true, + "limit": true, + "localtime": true, + "localtimestamp": true, + "natural": true, + "not": true, + "null": true, + "offset": true, + "on": true, + "only": true, + "or": true, + "order": true, + "outer": true, + "overlaps": true, + "placing": true, + "primary": true, + "references": true, + "returning": true, + "right": true, + "select": true, + "session_user": true, + "similar": true, + "some": true, + "symmetric": true, + "table": true, + "then": true, + "to": true, + "trailing": true, + "true": true, + "union": true, + "unique": true, + "user": true, + "using": true, + "variadic": true, + "verbose": true, + "when": true, + "where": true, + "window": true, + "with": true, +} + +// func (system Postgresql) createReplicationPipeFile(schema, table string, replicationCycle, version int64, replication Replication) (pipeFilePath string, columnInfos []ColumnInfo, err error) { +// return createReplicationPipeFileCommon(table, replicationCycle, version, replication, system) +// } + +func (system Postgresql) getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) { + query := fmt.Sprintf(` + WITH PrimaryKeys AS ( + SELECT + kcu.column_name + FROM + information_schema.key_column_usage AS kcu + JOIN information_schema.table_constraints AS tc + ON kcu.constraint_name = tc.constraint_name + AND kcu.table_name = tc.table_name + AND kcu.table_schema = tc.table_schema + WHERE + tc.constraint_type = 'PRIMARY KEY' + AND kcu.table_schema = '%v' + AND kcu.table_name = '%v' + ) + + SELECT + columns.column_name AS col_name, + columns.data_type AS col_type, + coalesce(columns.numeric_precision, -1) AS col_precision, + coalesce(columns.numeric_scale, -1) AS col_scale, + coalesce(columns.character_maximum_length, -1) AS col_length, + CASE WHEN pk.column_name IS NOT NULL THEN true ELSE false END AS col_is_primary + FROM + information_schema.columns + LEFT JOIN PrimaryKeys pk ON columns.column_name = pk.column_name + WHERE columns.table_schema = '%v' + AND columns.table_name = '%v' + ORDER BY + columns.ordinal_position;`, schema, table, schema, table) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting table column infos rows :: %v", err) + } + + return rows, nil +} + +func (system Postgresql) getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) { + + unescapedSchemaPeriodTable := getSchemaPeriodTable(schema, table, system, false) + + query := fmt.Sprintf(` + SELECT + att.attname AS column_name + FROM + pg_index idx + JOIN + pg_attribute att ON att.attnum = ANY(idx.indkey) AND att.attrelid = idx.indrelid + JOIN + pg_class cls ON cls.oid = idx.indrelid + WHERE + idx.indisprimary = TRUE + AND cls.oid = '%v'::regclass + `, + unescapedSchemaPeriodTable) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting primary keys rows :: %v", err) + } + + return rows, nil +} + +func (system Postgresql) listAllDatabases() (databases []string, err error) { + rows, err := system.query("SELECT datname FROM pg_database WHERE datistemplate = false;") + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + for rows.Next() { + var database string + err = rows.Scan(&database) + if err != nil { + return nil, fmt.Errorf("error scanning database :: %v", err) + } + + databases = append(databases, database) + } + + return databases, nil +} + +func (system Postgresql) listAllSchemasInDatabase() (schemas []string, err error) { + rows, err := system.query(`SELECT schema_name + FROM information_schema.schemata + WHERE schema_name NOT IN ('pg_catalog', 'information_schema') + AND schema_name NOT LIKE 'pg_%'`) + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database :: %v", err) + } + + for rows.Next() { + var schema string + err = rows.Scan(&schema) + if err != nil { + return nil, fmt.Errorf("error scanning schema :: %v", err) + } + + schemas = append(schemas, schema) + } + + return schemas, nil +} + +func (system Postgresql) listAllTablesInSchema(schema string) (tables []string, err error) { + rows, err := system.query(fmt.Sprintf(`SELECT table_name + FROM information_schema.tables + WHERE table_schema = '%v' + AND table_type = 'BASE TABLE'`, schema)) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema :: %v", err) + } + + for rows.Next() { + var table string + err = rows.Scan(&table) + if err != nil { + return nil, fmt.Errorf("error scanning table :: %v", err) + } + + tables = append(tables, table) + } + + return tables, nil +} + +func (system Postgresql) createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) { + return false, nil +} + +func (system Postgresql) createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Postgresql) getIncrementalTimeOverride(schema, table, incrementalColumn string, initialLoad bool) (time.Time, bool, bool, error) { + return time.Time{}, false, initialLoad, nil +} + +func (system Postgresql) IsTableNotFoundError(err error) bool { + return strings.Contains(err.Error(), "does not exist") +} + +func (system Postgresql) discoverStructure(instanceTransfer *data.InstanceTransfer) (*data.InstanceTransfer, error) { + + treeNodeInstanceID := fmt.Sprintf("%v_%v_%v_%v", instanceTransfer.SourceInstance.CloudProvider, instanceTransfer.SourceInstance.CloudAccountID, instanceTransfer.SourceInstance.Region, instanceTransfer.SourceInstance.ID) + + instanceTransfer.SchemaTree = &data.SafeTreeNode{ + ID: treeNodeInstanceID, + Name: instanceTransfer.SourceInstance.ID, + ContainsPII: false, + Mu: &sync.Mutex{}, + } + + databases, err := system.listAllDatabases() + if err != nil { + return nil, fmt.Errorf("error listing all databases :: %v", err) + } + + dbConnInfo := system.ConnectionInfo + + for _, database := range databases { + + // skip rdsadmin database + if database == "rdsadmin" { + continue + } + + treeNodeDBID := fmt.Sprintf("%v_%v", treeNodeInstanceID, database) + dbNode := instanceTransfer.SchemaTree.AddChild(treeNodeDBID, database) + + dbConnInfo.Database = database + + dbSystem, err := newPostgresql(dbConnInfo) + if err != nil { + return nil, fmt.Errorf("error creating db system :: %v", err) + } + + schemas, err := dbSystem.listAllSchemasInDatabase() + if err != nil { + return nil, fmt.Errorf("error listing all schemas in database %v :: %v", database, err) + } + + placeholders := map[string]string{ + "cloud_provider": instanceTransfer.SourceInstance.CloudProvider, + "cloud_account_id": instanceTransfer.SourceInstance.CloudAccountID, + "cloud_region": instanceTransfer.SourceInstance.Region, + "instance_id": instanceTransfer.SourceInstance.ID, + } + + targetDbTemplate := instanceTransfer.NamingConvention.DatabaseNameInSnowflake + targetSchemaTemplate := instanceTransfer.NamingConvention.SchemaNameInSnowflake + targetTableTemplate := instanceTransfer.NamingConvention.TableNameInSnowflake + + for _, schema := range schemas { + treeNodeSchemaID := fmt.Sprintf("%v_%v", treeNodeDBID, schema) + + schemaNode := dbNode.AddChild(treeNodeSchemaID, schema) + + tables, err := dbSystem.listAllTablesInSchema(schema) + if err != nil { + return nil, fmt.Errorf("error listing all tables in schema %v :: %v", schema, err) + } + for _, table := range tables { + treeNodeTableID := fmt.Sprintf("%v_%v", treeNodeSchemaID, table) + + tableNode := schemaNode.AddChild(treeNodeTableID, table) + + id := uuid.New().String() + ctx, cancel := context.WithCancel(context.Background()) + + placeholders["database_name"] = database + placeholders["schema_name"] = schema + placeholders["table_name"] = table + + pattern := regexp.MustCompile(`\[([^\]]+)\]`) + + targetDbName := pattern.ReplaceAllStringFunc(targetDbTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetDbName = dashToUnderscoreReplacer.Replace(targetDbName) + + targetSchemaName := pattern.ReplaceAllStringFunc(targetSchemaTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetSchemaName = dashToUnderscoreReplacer.Replace(targetSchemaName) + + if targetSchemaName == "" { + targetSchemaName = instanceTransfer.NamingConvention.SchemaFallbackInSnowflake + } + + targetTableName := pattern.ReplaceAllStringFunc(targetTableTemplate, func(m string) string { + key := m[1 : len(m)-1] + if val, found := placeholders[key]; found { + return val + } + return m + }) + + targetTableName = dashToUnderscoreReplacer.Replace(targetTableName) + + // replace dashes with underscores in instanceTransferID + stagingDbNameSuffix := strings.ReplaceAll(instanceTransfer.RestoredInstanceID, "-", "_") + stagingDbName := fmt.Sprintf("%v_%v", stagingDbNameSuffix, database) + + transferInfo := &data.TransferInfo{ + ID: id, + Context: ctx, + Cancel: cancel, + SourceInstance: data.Instance{ + ID: instanceTransfer.SourceInstance.ID, + Type: instanceTransfer.SourceInstance.Type, + Host: instanceTransfer.SourceInstance.Host, + Port: instanceTransfer.SourceInstance.Port, + Username: instanceTransfer.SourceInstance.Username, + Password: instanceTransfer.SourceInstance.Password, + }, + SourceDatabase: database, + SourceSchema: schema, + SourceTable: table, + TargetType: instanceTransfer.TargetType, + TargetHost: instanceTransfer.TargetHost, + TargetUsername: instanceTransfer.TargetUsername, + TargetPassword: instanceTransfer.TargetPassword, + TargetDatabase: targetDbName, + TargetSchema: targetSchemaName, + TargetTable: targetTableName, + DropTargetTableIfExists: true, + CreateTargetSchemaIfNotExists: true, + CreateTargetTableIfNotExists: true, + Delimiter: instanceTransfer.Delimiter, + Newline: instanceTransfer.Newline, + Null: instanceTransfer.Null, + PsqlAvailable: instanceTransfer.PsqlAvailable, + BcpAvailable: instanceTransfer.BcpAvailable, + SqlLdrAvailable: instanceTransfer.SqlLdrAvailable, + StagingDbName: stagingDbName, + TableNode: tableNode, + ScanForPII: instanceTransfer.ScanForPII, + } + instanceTransfer.TransferInfos = append(instanceTransfer.TransferInfos, transferInfo) + } + } + } + + return instanceTransfer, nil +} + +func (system Postgresql) createDbIfNotExistsOverride(database string) (overridden bool, err error) { + return false, errors.New("not implemented") +} diff --git a/cmd/transferInstance/system_snowflake.go b/cmd/transferInstance/system_snowflake.go new file mode 100644 index 00000000..033c8636 --- /dev/null +++ b/cmd/transferInstance/system_snowflake.go @@ -0,0 +1,712 @@ +package main + +import ( + "database/sql" + "errors" + "fmt" + "strings" + "time" + + "github.com/google/uuid" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +type Snowflake struct { + Name string + Connection *sql.DB +} + +func newSnowflake(connectionInfo ConnectionInfo) (snowflake Snowflake, err error) { + + connectionString := fmt.Sprintf("%v:%v@%v/%v", connectionInfo.Username, + connectionInfo.Password, connectionInfo.Hostname, connectionInfo.Database) + + db, err := openConnectionPool(connectionString, DriverSnowflake) + if err != nil { + return snowflake, fmt.Errorf("error opening snowflake db :: %v", err) + } + snowflake.Connection = db + return snowflake, nil +} + +func (system Snowflake) closeConnectionPool(printError bool) (err error) { + err = system.Connection.Close() + if err != nil && printError { + logger.Error(fmt.Sprintf("error closing %v connection pool :: %v", system.Name, err)) + } + return err +} + +func (system Snowflake) query(query string) (rows *sql.Rows, err error) { + rows, err = system.Connection.Query(query) + if err != nil { + return nil, fmt.Errorf("error running dql on %v :: %v :: %v", system.Name, query, err) + } + return rows, nil +} + +func (system Snowflake) queryRow(query string) (row *sql.Row) { + row = system.Connection.QueryRow(query) + return row +} + +func (system Snowflake) exec(query string) (err error) { + _, err = system.Connection.Exec(query) + if err != nil { + return fmt.Errorf("error running ddl/dml on %v :: %v :: %v", system.Name, query, err) + } + return nil +} + +func (system Snowflake) dropTableIfExistsOverride(schema, table string) (overridden bool, err error) { + return false, nil +} + +func (system Snowflake) escape(objectName string) (escaped string) { + return fmt.Sprintf(`"%v"`, objectName) +} + +func (system Snowflake) isReservedKeyword(keyword string) bool { + if _, ok := snowflakeReservedKeywords[keyword]; ok { + return true + } + + return false +} + +func (system Snowflake) createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Snowflake) driverTypeToPipeType( + columnType *sql.ColumnType, + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch columnType.DatabaseTypeName() { + case "TEXT": + return "nvarchar", nil + case "REAL": + return "float64", nil + case "FIXED": + return "decimal", nil + case "TIMESTAMP_NTZ": + return "datetime", nil + case "TIMESTAMP_LTZ": + return "datetimetz", nil + case "TIMESTAMP_TZ": + return "datetimetz", nil + case "DATE": + return "date", nil + case "TIME": + return "time", nil + case "BINARY": + return "varbinary", nil + case "BOOLEAN": + return "bool", nil + case "VARIANT": + return "nvarchar", nil + case "OBJECT": + return "nvarchar", nil + case "ARRAY": + return "nvarchar", nil + default: + return "", fmt.Errorf("unsupported database type for snowflake: %v", columnType.DatabaseTypeName()) + } +} + +func (system Snowflake) pipeTypeToCreateType( + columnInfo *data.ColumnInfo, +) ( + createType string, + err error, +) { + switch columnInfo.PipeType { + case "nvarchar": + return "text", nil + case "varchar": + return "text", nil + case "ntext": + return "text", nil + case "text": + return "text", nil + case "int64": + return "number", nil + case "int32": + return "number", nil + case "int16": + return "number", nil + case "float64": + return "real", nil + case "float32": + return "real", nil + case "decimal": + return "number", nil + case "money": + return "number", nil + case "datetime": + return "datetime", nil + case "datetimetz": + return "timestamp_tz", nil + case "date": + return "date", nil + case "time": + return "time", nil + case "varbinary": + return "varbinary", nil + case "blob": + return "varbinary", nil + case "uuid": + return "varbinary", nil + case "bool": + return "boolean", nil + case "json": + return "variant", nil + case "xml": + return "text", nil + case "varbit": + return "text", nil + default: + return "", fmt.Errorf("unsupported pipeType for snowflake: %v", columnInfo.PipeType) + } +} + +func (system Snowflake) createPipeFilesOverride(pipeFileChannelIn chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows, +) (pipeFileInfoChannel chan PipeFileInfo, overridden bool) { + return pipeFileChannelIn, false +} + +func (system Snowflake) getPipeFileFormatters() ( + pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error), +) { + return map[string]func(interface{}) (pipeFileValue string, err error){ + "nvarchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varchar": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "ntext": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "text": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "int64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "int16": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%d", v), nil + }, + "float64": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "float32": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%f", v), nil + }, + "decimal": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "money": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "datetime": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetime snowflakePipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "datetimetz": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to datetimetz snowflakePipeFileFormatters") + } + return valTime.UTC().Format(time.RFC3339Nano), nil + }, + "date": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to date snowflakePipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "time": func(v interface{}) (pipeFileValue string, err error) { + valTime, ok := v.(time.Time) + if !ok { + return "", errors.New( + "non time.Time value passed to time snowflakePipeFileFormatters") + } + return valTime.Format(time.RFC3339Nano), nil + }, + "varbinary": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "blob": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%x", v), nil + }, + "uuid": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "bool": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%t", v), nil + }, + "json": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "xml": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + "varbit": func(v interface{}) (pipeFileValue string, err error) { + return fmt.Sprintf("%s", v), nil + }, + } +} + +func (system Snowflake) insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) { + + table := transferInfo.TargetTable + + escapedSchemaName := escapeIfNeeded(transferInfo.TargetSchema, system) + + fileFormatQuery := fmt.Sprintf( + `CREATE FILE FORMAT if not exists %s.%s.sqlpipe_csv type = CSV ESCAPE_UNENCLOSED_FIELD = 'NONE' + FIELD_OPTIONALLY_ENCLOSED_BY = '\"' NULL_IF = ('%s');`, + transferInfo.StagingDbName, escapedSchemaName, transferInfo.Null) + err = system.exec(fileFormatQuery) + if err != nil { + return true, fmt.Errorf("error creating snowflake file format :: %v", err) + } + logger.Info(fmt.Sprintf("created %v.sqlpipe_csv file format if not exists in snowflake", escapedSchemaName)) + + createStageQuery := fmt.Sprintf( + `CREATE STAGE if not exists %s.%v.sqlpipe_stage;`, transferInfo.StagingDbName, + escapedSchemaName) + err = system.exec(createStageQuery) + if err != nil { + return true, fmt.Errorf("error creating sqlpipe_stage in snowflake :: %v", err) + } + logger.Info(fmt.Sprintf("created %v.sqlpipe_stage if not exists in snowflake", escapedSchemaName)) + + finalCsvChannel := convertPipeFiles(pipeFileInfoChannel, transferInfo, system) + + putCsvsChannel := system.putCsvs(finalCsvChannel, transferInfo) + + err = insertFinalCsvs(putCsvsChannel, transferInfo, system, transferInfo.TargetSchema, table) + if err != nil { + return true, fmt.Errorf("error inserting final csvs :: %v", err) + } + + return true, nil +} + +func (system Snowflake) insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) { + return false, nil +} + +func (system Snowflake) convertPipeFilesOverride(pipeFilePath <-chan PipeFileInfo, finalCsvInfoChannelIn chan FinalCsvInfo, transferInfo *data.TransferInfo) (finalCsvInfoChannel chan FinalCsvInfo, overridden bool) { + return finalCsvInfoChannelIn, false +} + +func (system Snowflake) putCsvs( + finalCsvChannelIn <-chan FinalCsvInfo, + transferInfo *data.TransferInfo, +) <-chan FinalCsvInfo { + + finalCsvChannelOut := make(chan FinalCsvInfo) + + go func() { + + defer close(finalCsvChannelOut) + + for finalCsvInfo := range finalCsvChannelIn { + + escapedSchema := escapeIfNeeded(transferInfo.TargetSchema, system) + + finalCsvInfo.InsertInfo = fmt.Sprintf("%v.csv", uuid.New().String()) + + putQuery := fmt.Sprintf(`PUT file://%v @%s.%v.sqlpipe_stage/%v`, finalCsvInfo.FilePath, transferInfo.StagingDbName, escapedSchema, finalCsvInfo.InsertInfo) + + err := system.exec(putQuery) + if err != nil { + transferInfo.Error = fmt.Sprintf("error putting csv into snowflake :: %v", err) + logger.Error(transferInfo.Error) + return + } + + finalCsvChannelOut <- finalCsvInfo + } + + logger.Info(fmt.Sprintf("transfer %v finished uploading snowflake csvs", transferInfo.ID)) + }() + + return finalCsvChannelOut +} + +func (system Snowflake) getFinalCsvFormatters() ( + finalCsvFormatters map[string]func(string) (finalCsvValue string, err error), +) { + return map[string]func(string) (string, error){ + "nvarchar": func(v string) (string, error) { + return v, nil + }, + "varchar": func(v string) (string, error) { + return v, nil + }, + "ntext": func(v string) (string, error) { + return v, nil + }, + "text": func(v string) (string, error) { + return v, nil + }, + "int64": func(v string) (string, error) { + return v, nil + }, + "int32": func(v string) (string, error) { + return v, nil + }, + "int16": func(v string) (string, error) { + return v, nil + }, + "float64": func(v string) (string, error) { + return v, nil + }, + "float32": func(v string) (string, error) { + return v, nil + }, + "decimal": func(v string) (string, error) { + return v, nil + }, + "money": func(v string) (string, error) { + return v, nil + }, + "datetime": func(v string) (string, error) { + return v, nil + }, + "datetimetz": func(v string) (string, error) { + return v, nil + }, + "date": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to snowflake csv :: %v", err) + } + return valTime.Format("2006-01-02"), nil + }, + "time": func(v string) (string, error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing time value to snowflake csv :: %v", err) + } + + return valTime.Format("15:04:05.999999"), nil + }, + "varbinary": func(v string) (string, error) { + return v, nil + }, + "blob": func(v string) (string, error) { + return v, nil + }, + "uuid": func(v string) (string, error) { + return strings.Replace(v, "-", "", -1), nil + }, + "bool": func(v string) (string, error) { + return v, nil + }, + "json": func(v string) (string, error) { + return v, nil + }, + "xml": func(v string) (string, error) { + return v, nil + }, + "varbit": func(v string) (string, error) { + return v, nil + }, + } +} + +func (system Snowflake) runInsertCmd( + finalCsvInfo FinalCsvInfo, + transferInfo *data.TransferInfo, + schema, table string, +) ( + err error, +) { + + escapedSchemaPeriodtable := getSchemaPeriodTable(schema, table, system, true) + escapedSchema := escapeIfNeeded(schema, system) + + copyQuery := fmt.Sprintf(` + COPY INTO %v + FROM @%v.sqlpipe_stage/%v + FILE_FORMAT = (FORMAT_NAME = %v.sqlpipe_csv)`, + escapedSchemaPeriodtable, + escapedSchema, + finalCsvInfo.InsertInfo, + escapedSchema, + ) + + err = system.exec(copyQuery) + if err != nil { + return fmt.Errorf("error copying csv into snowflake :: %v", err) + } + + return nil +} + +func (system Snowflake) schemaRequired() bool { + return true +} + +func (system Snowflake) createDbIfNotExistsOverride(database string) (overridden bool, err error) { + return false, nil +} + +func (system Snowflake) createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) { + return false, nil +} + +var snowflakeReservedKeywords = map[string]bool{ + "alter": true, + "and": true, + "as": true, + "between": true, + "by": true, + "case": true, + "cast": true, + "check": true, + "collate": true, + "column": true, + "create": true, + "current_date": true, + "current_time": true, + "current_timestamp": true, + "delete": true, + "desc": true, + "distinct": true, + "drop": true, + "else": true, + "exists": true, + "false": true, + "for": true, + "from": true, + "full": true, + "grant": true, + "group": true, + "having": true, + "in": true, + "inner": true, + "insert": true, + "intersect": true, + "into": true, + "is": true, + "join": true, + "left": true, + "like": true, + "not": true, + "null": true, + "on": true, + "or": true, + "order": true, + "outer": true, + "revoke": true, + "right": true, + "select": true, + "set": true, + "table": true, + "then": true, + "true": true, + "union": true, + "update": true, + "using": true, + "values": true, + "when": true, + "where": true, + "with": true, +} + +func (system Snowflake) IsTableNotFoundError(err error) bool { + return strings.Contains(err.Error(), "does not exist") +} + +func (system Snowflake) dbTypeToPipeType( + databaseTypeName string, +) ( + pipeType string, + err error, +) { + switch databaseTypeName { + case "NUMBER": + return "decimal", nil + case "FLOAT": + return "float64", nil + case "TEXT": + return "nvarchar", nil + case "BINARY": + return "varbinary", nil + case "BOOLEAN": + return "bool", nil + case "DATE": + return "date", nil + case "TIME": + return "time", nil + case "TIMESTAMP_LTZ": + return "datetimetz", nil + case "TIMESTAMP_NTZ": + return "datetime", nil + case "TIMESTAMP_TZ": + return "datetimetz", nil + case "VARIANT": + return "nvarchar", nil + case "OBJECT": + return "varbinary", nil + case "ARRAY": + return "nvarchar", nil + case "GEOGRAPHY": + return "varbinary", nil + case "GEOMETRY": + return "varbinary", nil + default: + return "", fmt.Errorf("unsupported database type for snowflake: %v", databaseTypeName) + } +} + +func (system Snowflake) getIncrementalTimeOverride(schema, table, incrementalColumn string, initialLoad bool) (time.Time, bool, bool, error) { + return time.Time{}, false, initialLoad, nil +} + +func (system Snowflake) getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) { + return nil, errors.New("snowflake does not enforce primary keys") +} + +func (system Snowflake) getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) { + query := fmt.Sprintf(` + SELECT + columns.COLUMN_NAME AS col_name, + columns.DATA_TYPE AS col_type, + coalesce(columns.NUMERIC_PRECISION, -1) AS col_precision, + coalesce(columns.NUMERIC_SCALE, -1) AS col_scale, + coalesce(columns.CHARACTER_MAXIMUM_LENGTH, -1) AS col_length, + false as is_primary_key + FROM + INFORMATION_SCHEMA.COLUMNS columns + WHERE + upper(columns.TABLE_SCHEMA) = upper('%v') + AND upper(columns.TABLE_NAME) = upper('%v') + ORDER BY + columns.ORDINAL_POSITION;`, + schema, table) + + rows, err = system.query(query) + if err != nil { + return nil, fmt.Errorf("error getting table column infos rows :: %v", err) + } + + return rows, nil +} + +var snowflakeDatetimeFormatter = "2006-01-02 15:04:05.999999999" +var snowflakeDateFormatter = "2006-01-02" +var snowflakeTimeFormatter = "15:04:05.999999999" + +func (system Snowflake) getSqlFormatters() ( + pipeFileFormatters map[string]func(string) (pipeFileValue string, err error), +) { + return map[string]func(string) (pipeFileValue string, err error){ + "nvarchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varchar": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "ntext": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "text": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "int64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "int16": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float64": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "float32": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "decimal": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "money": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "datetime": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to snowflake csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(snowflakeDatetimeFormatter)), nil + }, + "datetimetz": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to snowflake csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(snowflakeDatetimeFormatter)), nil + }, + "date": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to snowflake csv :: %v", err) + } + return fmt.Sprintf("'%v'", valTime.Format(snowflakeDateFormatter)), nil + }, + "time": func(v string) (pipeFileValue string, err error) { + valTime, err := time.Parse(time.RFC3339Nano, v) + if err != nil { + return "", fmt.Errorf("error writing date value to snowflake csv :: %v", err) + } + + return fmt.Sprintf("'%v'", valTime.Format(snowflakeTimeFormatter)), nil + }, + "varbinary": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`0x%s`, v), nil + }, + "blob": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf(`0x%s`, v), nil + }, + "uuid": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "bool": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + "json": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "xml": func(v string) (pipeFileValue string, err error) { + return fmt.Sprintf("'%v'", singleQuoteReplacer.Replace(v)), nil + }, + "varbit": func(v string) (pipeFileValue string, err error) { + return v, nil + }, + } +} + +func (system Snowflake) discoverStructure(instnaceTransfer *data.InstanceTransfer) (instanceTransfer *data.InstanceTransfer, err error) { + return nil, errors.New("snowflake does not support discovering structure") +} diff --git a/cmd/transferInstance/systems.go b/cmd/transferInstance/systems.go new file mode 100644 index 00000000..e4f28426 --- /dev/null +++ b/cmd/transferInstance/systems.go @@ -0,0 +1,890 @@ +package main + +import ( + "context" + "database/sql" + "encoding/csv" + "encoding/json" + "errors" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + "time" + "unicode" + + "github.com/sqlpipe/sqlpipe/internal/data" + "golang.org/x/sync/errgroup" +) + +type ConnectionInfo struct { + Type string + Hostname string + Port int + Database string + Username string + Password string +} + +type FinalCsvInfo struct { + FilePath string + InsertInfo string +} + +type System interface { + // The system interface abstracts differences between different database systems + + // ********************* + // ** database basics ** + // ********************* + + query(query string) (rows *sql.Rows, err error) + queryRow(query string) (row *sql.Row) + exec(query string) (err error) + + closeConnectionPool(printError bool) (err error) + + // getNowSyntax() string + schemaRequired() bool + isReservedKeyword(word string) (isReserved bool) + escape(objectName string) (escaped string) + getPrimaryKeysRows(schema, table string) (rows *sql.Rows, err error) + getTableColumnInfosRows(schema, table string) (rows *sql.Rows, err error) + IsTableNotFoundError(err error) (isTableNotFound bool) + + // ----------------- + // -- translators -- + // ----------------- + + dbTypeToPipeType(databaseTypeName string) (pipeType string, err error) + driverTypeToPipeType(columnType *sql.ColumnType, databaseTypeName string) (pipeType string, err error) + pipeTypeToCreateType(columnInfo *data.ColumnInfo) (createType string, err error) + + getPipeFileFormatters() (pipeFileFormatters map[string]func(interface{}) (pipeFileValue string, err error)) + getSqlFormatters() (sqlFormatters map[string]func(string) (sqlValue string, err error)) + getFinalCsvFormatters() (finalCsvFormatters map[string]func(string) (finalCsvValue string, err error)) + + // ------------------- + // -- DDL overrides -- + // ------------------- + + createSchemaIfNotExistsOverride(schema string) (overridden bool, err error) + createTableIfNotExistsOverride(schema, table string, transferInfo *data.TransferInfo) (overridden bool, err error) + dropTableIfExistsOverride(schema, table string) (overridden bool, err error) + createDbIfNotExistsOverride(database string) (overridden bool, err error) + + // ******************* + // ** Data movement ** + // ******************* + + createPipeFilesOverride(pipeFileInfoChannel chan PipeFileInfo, transferInfo *data.TransferInfo, rows *sql.Rows) (pipeFileChannel chan PipeFileInfo, overridden bool) + convertPipeFilesOverride(pipeFileInfoChannel <-chan PipeFileInfo, finalCsvInfoChannel chan FinalCsvInfo, transferInfo *data.TransferInfo) (finalCsvChannel chan FinalCsvInfo, overridden bool) + insertPipeFilesOverride(transferInfo *data.TransferInfo, pipeFileInfoChannel <-chan PipeFileInfo) (overridden bool, err error) + insertFinalCsvsOverride(transferInfo *data.TransferInfo) (overridden bool, err error) + runInsertCmd(finalCsvInfo FinalCsvInfo, transferInfo *data.TransferInfo, schema, table string) (err error) + getIncrementalTimeOverride(schema, table, incrementalColumn string, intialLoad bool) (incrementalTime time.Time, overridden bool, initialLoad bool, err error) + + // -------------------- + // -- Data discovery -- + // -------------------- + + discoverStructure(instanceTransfer *data.InstanceTransfer) (*data.InstanceTransfer, error) +} + +func newSystem(connectionInfo ConnectionInfo) (system System, err error) { + // creates a new system + + switch connectionInfo.Type { + case "postgresql": + return newPostgresql(connectionInfo) + case "mssql": + return newMssql(connectionInfo) + case "mysql": + return newMysql(connectionInfo) + case "oracle": + return newOracle(connectionInfo) + case "snowflake": + return newSnowflake(connectionInfo) + default: + return system, fmt.Errorf("unsupported system type %v", connectionInfo.Type) + } +} + +func openConnectionPool(connectionString, driverName string) (connectionPool *sql.DB, err error) { + + connectionPool, err = sql.Open(driverName, connectionString) + if err != nil { + return nil, fmt.Errorf("error opening connection :: %v", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + err = connectionPool.PingContext(ctx) + if err != nil { + return nil, fmt.Errorf("error pinging :: %v", err) + } + + return connectionPool, nil +} + +func createTableIfNotExists( + transferInfo *data.TransferInfo, + target System, +) ( + err error, +) { + + overridden, err := target.createTableIfNotExistsOverride(transferInfo.TargetSchema, transferInfo.TargetTable, transferInfo) + if overridden { + return err + } + + schemaPeriodTable := getSchemaPeriodTable(transferInfo.TargetSchema, transferInfo.TargetTable, target, true) + + var queryBuilder = strings.Builder{} + + queryBuilder.WriteString("create table if not exists ") + queryBuilder.WriteString(schemaPeriodTable) + queryBuilder.WriteString(" (") + + for i := range transferInfo.ColumnInfos { + if i > 0 { + queryBuilder.WriteString(", ") + } + + escapedName := escapeIfNeeded(transferInfo.ColumnInfos[i].Name, target) + + queryBuilder.WriteString(escapedName) + queryBuilder.WriteString(" ") + + createType, err := target.pipeTypeToCreateType(transferInfo.ColumnInfos[i]) + if err != nil { + return fmt.Errorf("error getting create type for column %v :: %v", transferInfo.ColumnInfos[i].Name, err) + } + + queryBuilder.WriteString(createType) + } + + queryBuilder.WriteString(")") + + err = target.exec(queryBuilder.String()) + if err != nil { + return fmt.Errorf("error running create table %v :: %v", schemaPeriodTable, err) + } + + logger.Info("table created if not exists", "database", transferInfo.TargetDatabase, "staging-database", transferInfo.StagingDbName, "schema", transferInfo.TargetSchema, "table", transferInfo.TargetTable) + + return nil +} + +type PipeFileInfo struct { + FilePath string + PkFilePath string +} + +func createPipeFiles( + transferInfo *data.TransferInfo, + rows *sql.Rows, + source System, +) <-chan PipeFileInfo { + + pipeFileInfoChannel := make(chan PipeFileInfo) + + pipeFileInfoChannel, overridden := source.createPipeFilesOverride(pipeFileInfoChannel, transferInfo, rows) + if overridden { + return pipeFileInfoChannel + } + + go func() { + + defer close(pipeFileInfoChannel) + + pipeFileFormatters := source.getPipeFileFormatters() + + pipeFileNum := 0 + + pipeFile, err := os.Create( + filepath.Join(transferInfo.PipeFileDir, fmt.Sprintf("%032b.pipe", pipeFileNum))) + if err != nil { + transferInfo.Error = fmt.Sprintf("error creating temp file :: %v", err) + logger.Error(transferInfo.Error) + return + } + defer pipeFile.Close() + + numCols := len(transferInfo.ColumnInfos) + + csvWriter := csv.NewWriter(pipeFile) + csvLength := 0 + + values := make([]interface{}, numCols) + valuePtrs := make([]interface{}, numCols) + for i := 0; i < numCols; i++ { + valuePtrs[i] = &values[i] + } + + dataInRam := false + csvRow := make([]string, numCols) + + eg := errgroup.Group{} + + for rows.Next() { + + err := rows.Scan(valuePtrs...) + if err != nil { + transferInfo.Error = fmt.Sprintf("error scanning row :: %v", err) + logger.Error(transferInfo.Error) + return + } + + eg.Go(func() error { + for i := 0; i < numCols; i++ { + if values[i] == nil { + csvRow[i] = transferInfo.Null + csvLength += len(transferInfo.Null) + } else { + csvRow[i], err = pipeFileFormatters[transferInfo.ColumnInfos[i].PipeType](values[i]) + if err != nil { + err = fmt.Errorf("error formatting pipe file :: %v", err) + transferInfo.Error = err.Error() + logger.Error(transferInfo.Error) + return err + } + csvLength += len(csvRow[i]) + } + } + return nil + }) + + err = eg.Wait() + if err != nil { + transferInfo.Error = fmt.Sprintf("error formatting pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + eg.Go(func() error { + err = csvWriter.Write(csvRow) + if err != nil { + err = fmt.Errorf("error writing csv row :: %v", err) + transferInfo.Error = err.Error() + logger.Error(transferInfo.Error) + return err + } + return nil + }) + + err = eg.Wait() + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + dataInRam = true + + if csvLength > 10_000_000 { + + eg.Go(func() error { + csvWriter.Flush() + + err = pipeFile.Close() + if err != nil { + err = fmt.Errorf("error closing pipe file :: %v", err) + transferInfo.Error = err.Error() + logger.Error(transferInfo.Error) + return err + } + return nil + }) + + err = eg.Wait() + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + select { + case <-transferInfo.Context.Done(): + return + default: + } + + pkFilePath := "" + + pipeFileInfo := PipeFileInfo{ + FilePath: pipeFile.Name(), + PkFilePath: pkFilePath, + } + + pipeFileInfoChannel <- pipeFileInfo + + pipeFileNum++ + + eg.Go(func() error { + pipeFileName := filepath.Join( + transferInfo.PipeFileDir, fmt.Sprintf("%032b.pipe", pipeFileNum)) + + pipeFile, err = os.Create(pipeFileName) + if err != nil { + err = fmt.Errorf("error creating temp file :: %v", err) + transferInfo.Error = err.Error() + logger.Error(transferInfo.Error) + return err + } + csvWriter = csv.NewWriter(pipeFile) + + return nil + }) + defer pipeFile.Close() + dataInRam = false + csvLength = 0 + + err = eg.Wait() + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + } + } + + if err := rows.Err(); err != nil { + transferInfo.Error = fmt.Sprintf("error iterating rows :: %v", err) + return + } + + if dataInRam { + + eg.Go(func() error { + csvWriter.Flush() + + err = pipeFile.Close() + if err != nil { + err = fmt.Errorf("error closing pipe file :: %v", err) + transferInfo.Error = err.Error() + logger.Error(transferInfo.Error) + return err + } + return nil + }) + + err = eg.Wait() + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + pkFilePath := "" + + pipeFileInfo := PipeFileInfo{ + FilePath: pipeFile.Name(), + PkFilePath: pkFilePath, + } + + pipeFileInfoChannel <- pipeFileInfo + } + + logger.Info(fmt.Sprintf("transfer %v finished writing pipe files", transferInfo.ID)) + }() + + return pipeFileInfoChannel +} + +func insertPipeFiles(pipeFileChannel <-chan PipeFileInfo, transferInfo *data.TransferInfo, target System) (err error) { + + overridden, err := target.insertPipeFilesOverride(transferInfo, pipeFileChannel) + if overridden { + return err + } + + finalCsvChannel := convertPipeFiles(pipeFileChannel, transferInfo, target) + + table := transferInfo.TargetTable + + err = insertFinalCsvs(finalCsvChannel, transferInfo, target, transferInfo.TargetSchema, table) + if err != nil { + return fmt.Errorf("error inserting final csvs :: %v", err) + } + + return nil +} + +func scanPipeFilesForPii(pipeFileInfoChannel <-chan PipeFileInfo, transferInfo *data.TransferInfo) <-chan PipeFileInfo { + scannedPipeFileChannel := make(chan PipeFileInfo) + + go func() { + defer close(scannedPipeFileChannel) + + for pipeFileInfo := range pipeFileInfoChannel { + + select { + case <-transferInfo.Context.Done(): + return + default: + } + + if !transferInfo.ScannedForPII { + + // Create a new pipe file with column names as the first row + columnNamesFile, err := os.Create(filepath.Join(transferInfo.PipeFileDir, "column_names.pipe")) + if err != nil { + transferInfo.Error = fmt.Sprintf("error creating column names file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + columnNamesWriter := csv.NewWriter(columnNamesFile) + columnNames := make([]string, len(transferInfo.ColumnInfos)) + for i, colInfo := range transferInfo.ColumnInfos { + columnNames[i] = colInfo.Name + } + + err = columnNamesWriter.Write(columnNames) + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing column names to file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + // Write the contents of the current pipe file to the columnNamesFile + pipeFile, err := os.Open(pipeFileInfo.FilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error opening pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + pipeReader := csv.NewReader(pipeFile) + for { + record, err := pipeReader.Read() + if err == io.EOF { + break + } + if err != nil { + transferInfo.Error = fmt.Sprintf("error reading pipe file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + err = columnNamesWriter.Write(record) + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing to column names file :: %v", err) + logger.Error(transferInfo.Error) + return + } + } + + columnNamesWriter.Flush() + columnNamesFile.Close() + pipeFile.Close() + + // find python binary location by getting text written at /python_location.txt + pythonLocationBytes, err := os.ReadFile("/python_location.txt") + if err != nil { + transferInfo.Error = fmt.Sprintf("error reading python location :: %v", err) + logger.Error(transferInfo.Error) + return + } + + logger.Info("running pii_scan.py", "python_file", columnNamesFile.Name(), "custom_strategry_threshold", instanceTransfer.CustomStrategyThreshold, "custom_strategy_percentile", instanceTransfer.CustomStrategyPercentile, "num_ros_to_scan_for_pii", instanceTransfer.NumRowsToScannForPII) + + // Command to run the Python script + cmd := exec.Command(string(pythonLocationBytes), "/pii_scan.py", columnNamesFile.Name(), fmt.Sprintf("%f", instanceTransfer.CustomStrategyThreshold), fmt.Sprintf("%f", instanceTransfer.CustomStrategyPercentile), fmt.Sprintf("%d", instanceTransfer.NumRowsToScannForPII)) + + // Capture standard output and error + output, err := cmd.CombinedOutput() + if err != nil { + transferInfo.Error = fmt.Sprintf("error scanning for PII :: %v", string(output)) + logger.Error("error scanning for PII", "output", string(output), "error", err) + return + } + + // Parse the JSON output + var result map[string]interface{} + if err := json.Unmarshal(output, &result); err != nil { + transferInfo.Error = fmt.Sprintf("error parsing JSON output :: %v", err) + logger.Error(transferInfo.Error) + return + } + + os.Remove(columnNamesFile.Name()) + + // Output the result + fmt.Printf("Analysis Result: %+v\n", result) + + for columnName := range result { + columnNode, exists := transferInfo.TableNode.FindChildNodeByName(columnName) + if !exists { + logger.Error("column not found in tree", "column", columnName) + return + } else { + // logger.Info("found node", "node", node.Name) + columnNode.ChangeContainsPII(true, result[columnName].(string)) + } + } + } + + transferInfo.ScannedForPII = true + + scannedPipeFileChannel <- pipeFileInfo + } + }() + + return scannedPipeFileChannel +} + +func convertPipeFiles( + pipeFileInfoChannel <-chan PipeFileInfo, + transferInfo *data.TransferInfo, + target System, +) <-chan FinalCsvInfo { + + finalCsvInfoChannel := make(chan FinalCsvInfo) + + finalCsvInfoChannel, overridden := target.convertPipeFilesOverride(pipeFileInfoChannel, finalCsvInfoChannel, transferInfo) + if overridden { + return finalCsvInfoChannel + } + + finalCsvFormatters := target.getFinalCsvFormatters() + + go func() { + + defer close(finalCsvInfoChannel) + + for pipeFileInfo := range pipeFileInfoChannel { + + pkFilePath := pipeFileInfo.PkFilePath + defer os.Remove(pkFilePath) + + pipeFilePath := pipeFileInfo.FilePath + + pipeFile, err := os.Open(pipeFilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error opening pipeFile :: %v", err) + logger.Error(transferInfo.Error) + return + } + + fileNum, err := getFileNum(pipeFilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error getting fileNum :: %v", err) + logger.Error(transferInfo.Error) + return + } + + csvFileName := filepath.Join(transferInfo.FinalCsvDir, fmt.Sprintf("%032v.csv", fileNum)) + csvFile, err := os.Create(csvFileName) + if err != nil { + transferInfo.Error = fmt.Sprintf("error creating csv file :: %v", err) + logger.Error(transferInfo.Error) + return + } + + csvReader := csv.NewReader(pipeFile) + csvWriter := csv.NewWriter(csvFile) + + for { + row, err := csvReader.Read() + if err != nil { + if errors.Is(err, io.EOF) { + break + } + transferInfo.Error = fmt.Sprintf("error reading csv row :: %v", err) + logger.Error(transferInfo.Error) + return + } + + for i := range row { + if row[i] != transferInfo.Null { + row[i], err = finalCsvFormatters[transferInfo.ColumnInfos[i].PipeType](row[i]) + if err != nil { + transferInfo.Error = fmt.Sprintf("error formatting final csv :: %v", err) + logger.Error(transferInfo.Error) + return + } + } + } + + err = csvWriter.Write(row) + if err != nil { + transferInfo.Error = fmt.Sprintf("error writing csv row :: %v", err) + logger.Error(transferInfo.Error) + return + } + } + + err = pipeFile.Close() + if err != nil { + transferInfo.Error = fmt.Sprintf("error closing pipeFile :: %v", err) + logger.Error(transferInfo.Error) + return + } + + csvWriter.Flush() + + err = csvFile.Close() + if err != nil { + transferInfo.Error = fmt.Sprintf("error closing csvFile :: %v", err) + logger.Error(transferInfo.Error) + return + } + + select { + case <-transferInfo.Context.Done(): + return + default: + } + + finalCsvInfo := FinalCsvInfo{ + FilePath: csvFile.Name(), + InsertInfo: csvFile.Name(), + } + + finalCsvInfoChannel <- finalCsvInfo + + if !transferInfo.KeepFiles { + err = os.Remove(pipeFilePath) + if err != nil { + transferInfo.Error = fmt.Sprintf("error removing pipeFile :: %v", err) + return + } + } + } + + logger.Info(fmt.Sprintf("transfer %v finished converting pipe files to final csvs", transferInfo.ID)) + }() + + return finalCsvInfoChannel +} + +func insertFinalCsvs( + finalCsvChannel <-chan FinalCsvInfo, + transferInfo *data.TransferInfo, + target System, + schema, table string, +) ( + err error, +) { + // inserts final csvs into the target system + + for finalCsvinfo := range finalCsvChannel { + + select { + case <-transferInfo.Context.Done(): + return errors.New("context cancelled") + default: + } + + err = target.runInsertCmd(finalCsvinfo, transferInfo, schema, table) + if err != nil { + return fmt.Errorf("error inserting final csv :: %v", err) + } + + if !transferInfo.KeepFiles { + err = os.Remove(finalCsvinfo.FilePath) + if err != nil { + return fmt.Errorf("error removing final csv :: %v", err) + } + } + } + + logger.Info(fmt.Sprintf("transfer %v finished inserting final csvs", transferInfo.ID)) + + return nil +} + +func getSchemaPeriodTable(schema, table string, system System, escapeIfNeededIn bool) (schemaPeriodTable string) { + + if escapeIfNeededIn { + schema = escapeIfNeeded(schema, system) + table = escapeIfNeeded(table, system) + } + + if system.schemaRequired() { + return fmt.Sprintf("%v.%v", schema, table) + } + + return table +} + +func needsEscaping(objectName string, system System) (needsEscaping bool) { + + if objectName == "" { + return false + } + + if system.isReservedKeyword(objectName) { + return true + } + + if containsSpaces(objectName) { + return true + } + + firstRune := rune(objectName[0]) + if !(unicode.IsLetter(firstRune) || firstRune == '_' || firstRune == '@' || firstRune == '#') { + return true + } + + for _, char := range objectName[1:] { + if !(unicode.IsLetter(char) || unicode.IsDigit(char) || char == '_') { + return true + } + } + + return false +} + +func escapeIfNeeded(objectName string, system System) (objectNameOut string) { + if needsEscaping(objectName, system) { + return system.escape(objectName) + } + return objectName +} + +func createDbIfNotExists(transferInfo *data.TransferInfo, system System) (err error) { + + database := transferInfo.TargetDatabase + + overridden, err := system.createDbIfNotExistsOverride(database) + if overridden { + return err + } + + query := fmt.Sprintf(`CREATE DATABASE IF NOT EXISTS %v`, escapeIfNeeded(database, system)) + err = system.exec(query) + if err != nil { + return fmt.Errorf("error creating database %v :: %v", database, err) + } + + logger.Info("database created if not exists", "database", transferInfo.TargetDatabase) + + return nil +} + +func createStagingDbIfNotExists(transferInfo *data.TransferInfo, system System) (err error) { + + database := transferInfo.StagingDbName + + overridden, err := system.createDbIfNotExistsOverride(database) + if overridden { + return err + } + + query := fmt.Sprintf(`CREATE DATABASE IF NOT EXISTS %v`, escapeIfNeeded(database, system)) + err = system.exec(query) + if err != nil { + return fmt.Errorf("error creating database %v :: %v", database, err) + } + + logger.Info("staging database created if not exists", "staging-database", transferInfo.StagingDbName, "database", transferInfo.TargetDatabase) + + return nil +} + +func createSchemaIfNotExists(transferInfo *data.TransferInfo, system System) (err error) { + overridden, err := system.createSchemaIfNotExistsOverride(transferInfo.TargetSchema) + if overridden { + return err + } + + query := fmt.Sprintf(`CREATE SCHEMA IF NOT EXISTS %v`, escapeIfNeeded(transferInfo.TargetSchema, system)) + + err = system.exec(query) + if err != nil { + return fmt.Errorf("error creating schema %v :: %v", transferInfo.TargetSchema, err) + } + + logger.Info("schema created if not exists", "database", transferInfo.TargetDatabase, "staging-database", transferInfo.StagingDbName, "schema", transferInfo.TargetSchema) + + return nil +} + +func dropTableIfExists(transferInfo *data.TransferInfo, system System) (err error) { + overridden, err := system.dropTableIfExistsOverride(transferInfo.TargetSchema, transferInfo.TargetTable) + if overridden { + return err + } + + escapedSchemaPeriodTable := getSchemaPeriodTable(transferInfo.TargetSchema, transferInfo.TargetTable, system, true) + + query := fmt.Sprintf("drop table if exists %v", escapedSchemaPeriodTable) + err = system.exec(query) + if err != nil { + return fmt.Errorf("error dropping table %v :: %v", escapedSchemaPeriodTable, err) + } + + logger.Info("dropped table if exists", "database", transferInfo.TargetDatabase, "staging-database", transferInfo.StagingDbName, "schema", transferInfo.TargetSchema, "table", transferInfo.TargetTable) + + return nil +} + +func getTableColumnInfos(transferInfo *data.TransferInfo, system System) (err error) { + + schema, table := transferInfo.TargetSchema, transferInfo.TargetTable + + rows, err := system.getTableColumnInfosRows(schema, table) + if err != nil { + return fmt.Errorf("error getting table column infos rows :: %v", err) + } + + var columnName string + var columnType string + var columnPrecision int64 + var columnScale int64 + var columnLength int64 + var columnIsPrimary bool + + for rows.Next() { + err := rows.Scan(&columnName, &columnType, &columnPrecision, &columnScale, &columnLength, &columnIsPrimary) + if err != nil { + return fmt.Errorf("error scanning table column infos rows :: %v", err) + } + + pipeType, err := system.dbTypeToPipeType(columnType) + if err != nil { + return fmt.Errorf("error getting pipe type for column %v :: %v", columnName, err) + } + + decimalOk := false + if columnPrecision > 0 || columnScale > 0 { + decimalOk = true + } + + lengthOk := false + if columnLength > 0 { + lengthOk = true + } + + columnInfo := &data.ColumnInfo{ + Name: columnName, + PipeType: pipeType, + DecimalOk: decimalOk, + Precision: columnPrecision, + Scale: columnScale, + LengthOk: lengthOk, + Length: columnLength, + IsPrimaryKey: columnIsPrimary, + } + + transferInfo.ColumnInfos = append(transferInfo.ColumnInfos, columnInfo) + + columnTreeID := fmt.Sprintf("%v_%v", transferInfo.TableNode.ID, columnName) + + transferInfo.TableNode.AddChild(columnTreeID, columnName) + } + + if len(transferInfo.ColumnInfos) == 0 { + return fmt.Errorf("no columns found for table %v.%v", schema, table) + } + + return nil +} diff --git a/cmd/transferInstance/transferInstance.go b/cmd/transferInstance/transferInstance.go new file mode 100644 index 00000000..4991d68c --- /dev/null +++ b/cmd/transferInstance/transferInstance.go @@ -0,0 +1,194 @@ +package main + +import ( + "context" + "errors" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials" + "github.com/aws/aws-sdk-go-v2/service/rds" + "golang.org/x/sync/errgroup" +) + +func transferInstance() error { + + var err error + + if instanceTransfer.SourceInstance.Password == "" { + awsConfig := aws.Config{ + Credentials: credentials.NewStaticCredentialsProvider(instanceTransfer.CloudUsername, instanceTransfer.CloudPassword, ""), + Region: instanceTransfer.SourceInstance.Region, + } + + rdsClient := rds.NewFromConfig(awsConfig) + instanceTransfer.SourceInstance.Password, err = generateRandomString(20) + if err != nil { + return fmt.Errorf("error generating random password :: %v", err) + } + + changePasswordInput := &rds.ModifyDBInstanceInput{ + DBInstanceIdentifier: aws.String(instanceTransfer.RestoredInstanceID), + MasterUserPassword: aws.String(instanceTransfer.SourceInstance.Password), + ApplyImmediately: aws.Bool(true), + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + logger.Info("changing backup instances password", BackupInstanceId, instanceTransfer.RestoredInstanceID) + + _, err = rdsClient.ModifyDBInstance(ctx, changePasswordInput) + if err != nil { + return fmt.Errorf("error changing source password :: %v", err) + } + + // it takes a few seconds for the password change process to start + time.Sleep(30 * time.Second) + + ctx, cancel = context.WithTimeout(context.Background(), 10*time.Minute) + defer cancel() + + for { + + if ctx.Err() != nil { + return fmt.Errorf("timeout waiting for instance to be available") + } + + time.Sleep(5 * time.Second) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + dbInstances, err := rdsClient.DescribeDBInstances(ctx, &rds.DescribeDBInstancesInput{ + DBInstanceIdentifier: aws.String(instanceTransfer.RestoredInstanceID), + }) + if err != nil { + return fmt.Errorf("error describing backup instance :: %v", err) + } + + if len(dbInstances.DBInstances) == 0 { + return fmt.Errorf("backup instance id %v not found", instanceTransfer.RestoredInstanceID) + } + + logger.Info("now checking instance", "instance status", fmt.Sprintf("%v", *dbInstances.DBInstances[0].DBInstanceStatus)) + + if *dbInstances.DBInstances[0].DBInstanceStatus == "available" { + break + } + } + + logger.Info("source instance password has changed, starting transfer", BackupInstanceId, instanceTransfer.RestoredInstanceID) + } + var dbName string + + if instanceTransfer.SourceInstance.Type == "oracle" { + + awsConfig := aws.Config{ + Credentials: credentials.NewStaticCredentialsProvider(instanceTransfer.CloudUsername, instanceTransfer.CloudPassword, ""), + Region: instanceTransfer.SourceInstance.Region, + } + + rdsClient := rds.NewFromConfig(awsConfig) + + describeDBInstancesInput := &rds.DescribeDBInstancesInput{ + DBInstanceIdentifier: aws.String(instanceTransfer.RestoredInstanceID), + } + + dbInstances, err := rdsClient.DescribeDBInstances(context.Background(), describeDBInstancesInput) + if err != nil { + return fmt.Errorf("error describing DB instances: %v", err) + } + + if len(dbInstances.DBInstances) == 0 { + return fmt.Errorf("no DB instances found with identifier: %v", instanceTransfer.RestoredInstanceID) + } + + dbInstance := dbInstances.DBInstances[0] + if dbInstance.Engine != nil && *dbInstance.Engine == "oracle-se2" { + dbName = *dbInstance.DBName + } else { + return fmt.Errorf("DB instance is not a single tenant Oracle DB") + } + + if dbName == "" { + return fmt.Errorf("no database name found for instance %v", instanceTransfer.RestoredInstanceID) + } + } + + sourceConnectionInfo := ConnectionInfo{ + Type: instanceTransfer.SourceInstance.Type, + Hostname: instanceTransfer.SourceInstance.Host, + Port: instanceTransfer.SourceInstance.Port, + Username: instanceTransfer.SourceInstance.Username, + Password: instanceTransfer.SourceInstance.Password, + Database: dbName, + } + + source, err := newSystem(sourceConnectionInfo) + if err != nil { + return fmt.Errorf("error creating source system :: %v", err) + } + defer source.closeConnectionPool(true) + + instanceTransfer, err = source.discoverStructure(instanceTransfer) + if err != nil { + return fmt.Errorf("error getting instance structure :: %v", err) + } + + transferErrG := errgroup.Group{} + + transferErrG.SetLimit(5) + + for _, transferInfo := range instanceTransfer.TransferInfos { + transferInfo := transferInfo + + logger.Info("starting transfer", OriginalDatabaseName, transferInfo.SourceDatabase, "schema", transferInfo.SourceSchema, "table", transferInfo.SourceTable) + + transferErrG.Go(func() error { + err = runTransfer(transferInfo) + if err != nil { + logger.Error("error running transfer", "error", err, "database", transferInfo.SourceDatabase, "schema", transferInfo.SourceSchema, "table", transferInfo.SourceTable) + return err + } + + return nil + }) + } + + err = transferErrG.Wait() + if err != nil { + return errors.New("error running one or more transfers. please check logs for more information") + } + + targetConnectionInfo := ConnectionInfo{ + Type: instanceTransfer.TargetType, + Hostname: instanceTransfer.TargetHost, + Username: instanceTransfer.TargetUsername, + Password: instanceTransfer.TargetPassword, + } + + target, err := newSystem(targetConnectionInfo) + if err != nil { + return fmt.Errorf("error creating target system :: %v", err) + } + + for _, dbName := range instanceTransfer.StagingDbNames { + dropStagingDbQuery := fmt.Sprintf(`DROP DATABASE IF EXISTS %v`, dbName) + err := target.exec(dropStagingDbQuery) + if err != nil { + logger.Error("error dropping staging database", "error", err) + } + } + + instanceTransfer.SchemaTree.RecursivelySearchForPII() + + schemaTreeJson, err := instanceTransfer.SchemaTree.ToJSON() + if err != nil { + return fmt.Errorf("error converting schema tree to json :: %v", err) + } + + fmt.Printf("SCHEMATREERAWJSON%v\n", schemaTreeJson) + + return nil +} diff --git a/cmd/transferInstance/transfers.go b/cmd/transferInstance/transfers.go new file mode 100644 index 00000000..72f721eb --- /dev/null +++ b/cmd/transferInstance/transfers.go @@ -0,0 +1,139 @@ +package main + +import ( + "fmt" + + "github.com/sqlpipe/sqlpipe/internal/commonHelpers" + "github.com/sqlpipe/sqlpipe/internal/data" +) + +func runTransfer(transferInfo *data.TransferInfo) error { + + var err error + + transferInfo.TmpDir, transferInfo.PipeFileDir, transferInfo.FinalCsvDir, err = commonHelpers.CreateTransferTmpDirs(transferInfo.ID, globalTmpDir, logger) + if err != nil { + return fmt.Errorf("error creating transfer tmp dirs :: %v", err) + } + + sourceConnectionInfo := ConnectionInfo{ + Type: transferInfo.SourceInstance.Type, + Hostname: transferInfo.SourceInstance.Host, + Port: transferInfo.SourceInstance.Port, + Database: transferInfo.SourceDatabase, + Username: transferInfo.SourceInstance.Username, + Password: transferInfo.SourceInstance.Password, + } + + source, err := newSystem(sourceConnectionInfo) + if err != nil { + return fmt.Errorf("error creating source system :: %v", err) + } + defer source.closeConnectionPool(true) + + targetConnectionInfo := ConnectionInfo{ + Type: transferInfo.TargetType, + Hostname: transferInfo.TargetHost, + Port: transferInfo.TargetPort, + Username: transferInfo.TargetUsername, + Password: transferInfo.TargetPassword, + } + + target, err := newSystem(targetConnectionInfo) + if err != nil { + return fmt.Errorf("error creating target system :: %v", err) + } + defer target.closeConnectionPool(true) + + err = createDbIfNotExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error creating target database :: %v", err) + } + + err = createStagingDbIfNotExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error creating staging database :: %v", err) + } + + instanceTransfer.StagingDbNames = append(instanceTransfer.StagingDbNames, transferInfo.StagingDbName) + + targetConnectionInfo.Database = transferInfo.StagingDbName + + target, err = newSystem(targetConnectionInfo) + if err != nil { + return fmt.Errorf("error creating target system :: %v", err) + } + defer target.closeConnectionPool(true) + + if target.schemaRequired() && transferInfo.CreateTargetSchemaIfNotExists { + err = createSchemaIfNotExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error creating target schema :: %v", err) + } + } + + if transferInfo.DropTargetTableIfExists { + err = dropTableIfExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error dropping target table :: %v", err) + } + } + + escapedSourceSchemaPeriodTable := getSchemaPeriodTable(transferInfo.SourceSchema, transferInfo.SourceTable, source, true) + + err = getTableColumnInfos(transferInfo, source) + if err != nil { + return fmt.Errorf("error getting source table column infos :: %v", err) + } + + rows, err := source.query(fmt.Sprintf(`SELECT * FROM %v`, escapedSourceSchemaPeriodTable)) + if err != nil { + return fmt.Errorf("error querying source :: %v", err) + } + defer rows.Close() + + if transferInfo.CreateTargetTableIfNotExists { + err = createTableIfNotExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error creating target table :: %v", err) + } + } + + pipeFiles := createPipeFiles(transferInfo, rows, source) + + if transferInfo.ScanForPII { + pipeFiles = scanPipeFilesForPii(pipeFiles, transferInfo) + } + + err = insertPipeFiles(pipeFiles, transferInfo, target) + if err != nil { + return fmt.Errorf("error inserting pipe files :: %v", err) + } + + // drop the target db name if exists, replace with the staging db name + targetConnectionInfo.Database = transferInfo.TargetDatabase + + target, err = newSystem(targetConnectionInfo) + if err != nil { + return fmt.Errorf("error creating target system :: %v", err) + } + + err = createSchemaIfNotExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error creating target schema :: %v", err) + } + + err = dropTableIfExists(transferInfo, target) + if err != nil { + return fmt.Errorf("error dropping target table :: %v", err) + } + + err = target.exec(fmt.Sprintf(`ALTER TABLE %v.%v.%v RENAME TO %v.%v.%v`, transferInfo.StagingDbName, transferInfo.TargetSchema, transferInfo.TargetTable, transferInfo.TargetDatabase, transferInfo.TargetSchema, transferInfo.TargetTable)) + if err != nil { + return fmt.Errorf("error renaming staging table to target table :: %v", err) + } + + logger.Info("transfer complete", "transfer-id", transferInfo.ID) + + return nil +} diff --git a/docker-compose.yml b/docker-compose.yml index da6e9586..e0e7f63d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,42 +1,41 @@ -version: '3.3' - services: +# sqlpipe: +# build: +# context: . +# dockerfile: sqlpipe.dockerfile +# container_name: sqlpipe +# platform: linux/amd64 +# ports: +# - "9000:9000" +# deploy: +# resources: +# limits: +# memory: 4G - sqlpipe: + tests: build: context: . - dockerfile: sqlpipe.dockerfile - container_name: sqlpipe - ports: - - "9000:9000" + dockerfile: tests.dockerfile + container_name: tests + platform: linux/amd64 deploy: resources: limits: - memory: 8G + memory: 4G mssql: image: mcr.microsoft.com/mssql/server + platform: linux/amd64 container_name: mssql environment: ACCEPT_EULA: Y SA_PASSWORD: Mypass123 - platform: linux/amd64 - volumes: - - ./setup-sql/mssql.sql:/setup.sql - command: > - /bin/bash -c " - export TZ=US/Pacific - /opt/mssql/bin/sqlservr & - sleep 25; - /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Mypass123' -d master -i /setup.sql - tail -f /dev/null - " ports: - "1433:1433" deploy: resources: limits: - memory: 16G + memory: 4G postgresql: image: postgres @@ -46,42 +45,34 @@ services: - 5432:5432 environment: POSTGRES_PASSWORD: Mypass123 - volumes: - - ./setup-sql/postgresql-simple.sql:/docker-entrypoint-initdb.d/setup-1.sql - - ./setup-sql/postgresql-complex.sql:/docker-entrypoint-initdb.d/setup-2.sql deploy: resources: limits: - memory: 16G + memory: 4G mysql: - image: mysql:8.0 + image: mysql platform: linux/amd64 container_name: mysql environment: - MYSQL_ROOT_PASSWORD=Mypass123 ports: - "3306:3306" - volumes: - - ./setup-sql/mysql.sql:/docker-entrypoint-initdb.d/setup.sql deploy: resources: limits: - memory: 8G + memory: 4G command: --local-infile=1 - - # oracle: - # image: sqlpipe/oracle:21.3.0 - # container_name: oracle - # ports: - # - "1521:1521" - # environment: - # - ORACLE_PWD=Mypass123 - # - NLS_CHARACTERSET=AL32UTF8 - # volumes: - # - ./setup-sql/oracle.sql:/opt/oracle/scripts/startup/setup.sql - # deploy: - # resources: - # limits: - # memory: 16G \ No newline at end of file +# oracle: +# container_name: oracle +# image: oracle/database:21CXE +# ports: +# - "1521:1521" +# environment: +# - ORACLE_PWD=Mypass123 +# - NLS_CHARACTERSET=AL32UTF8 +# deploy: +# resources: +# limits: +# memory: 8G diff --git a/go.mod b/go.mod index 0a521e56..5fc49398 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,14 @@ -module github.com/sqlpipe/sqlpipe-pro +module github.com/sqlpipe/sqlpipe -go 1.20 +go 1.21 + +toolchain go1.23.3 require ( + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/config v1.28.7 + github.com/aws/aws-sdk-go-v2/credentials v1.17.48 + github.com/aws/aws-sdk-go-v2/service/rds v1.93.2 github.com/go-sql-driver/mysql v1.7.1 github.com/google/uuid v1.4.0 github.com/jackc/pgx/v5 v5.5.0 @@ -23,19 +29,22 @@ require ( github.com/andybalholm/brotli v1.0.6 // indirect github.com/apache/arrow/go/v12 v12.0.1 // indirect github.com/apache/thrift v0.19.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.22.2 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1 // indirect - github.com/aws/smithy-go v1.16.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 // indirect + github.com/aws/smithy-go v1.22.1 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect diff --git a/go.sum b/go.sum index d2786ae8..36c11acd 100644 --- a/go.sum +++ b/go.sum @@ -5,14 +5,19 @@ github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTB github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.2.0/go.mod h1:c+Lifp3EDEamAkPVzMooRNOK6CZjNSdEnf1A7jsI9u4= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0 h1:yfJe15aSwEQ6Oo6J+gdfdulPNoZ3TEhmbhLIoxZcA+U= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 h1:gggzg0SUMs6SQbEw+3LoSsYf9YMjkupeAnHMX8O9mmY= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0/go.mod h1:+6KLcKIVgxoBDMqMO/Nvy7bZ9a0nbU3I1DtFQK3YvB4= github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0 h1:HCc0+LpPfpCKs6LGGLAhwBARt9632unrVcI6i8s/8os= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.0/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= @@ -21,44 +26,53 @@ github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/ github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= github.com/apache/thrift v0.19.0 h1:sOqkWPzMj7w6XaYbJQG7m4sGqVolaW/0D28Ln7yPzMk= github.com/apache/thrift v0.19.0/go.mod h1:SUALL216IiaOw2Oy+5Vs9lboJ/t9g40C+G07Dc0QC1I= -github.com/aws/aws-sdk-go-v2 v1.22.2 h1:lV0U8fnhAnPz8YcdmZVV60+tr6CakHzqA6P8T46ExJI= -github.com/aws/aws-sdk-go-v2 v1.22.2/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 h1:hHgLiIrTRtddC0AKcJr5s7i/hLgcpTt+q/FKxf1Zayk= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0/go.mod h1:w4I/v3NOWgD+qvs1NPEwhd++1h3XPHFaVxasfY6HlYQ= -github.com/aws/aws-sdk-go-v2/config v1.22.3 h1:JewoyAW8yPRpWus3gy/rIGhorHN4zInB8wgJfavaxwM= -github.com/aws/aws-sdk-go-v2/credentials v1.15.2 h1:rKH7khRMxPdD0u3dHecd0Q7NOVw3EUe7AqdkUOkiOGI= -github.com/aws/aws-sdk-go-v2/credentials v1.15.2/go.mod h1:tXM8wmaeAhfC7nZoCxb0FzM/aRaB1m1WQ7x0qlBLq80= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 h1:G5KawTAkyHH6WyKQCdHiW4h3PmAXNJpOgwKg3H7sDRE= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.4 h1:MD4eOs8lbf86CUawDXwkPoRrY0Ds2gDo1QLfDnwrAfk= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.4/go.mod h1:C4NNsNsbOD7YwuQRmNToEizYYoJVBM7CjpjvppTPl+k= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 h1:AaQsr5vvGR7rmeSWBtTCcw16tT9r51mWijuCQhzLnq8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2/go.mod h1:o1IiRn7CWocIFTXJjGKJDOwxv1ibL53NpcvcqGWyRBA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 h1:UZx8SXZ0YtzRiALzYAWcjb9Y9hZUR7MBKaBQ5ouOjPs= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2/go.mod h1:ipuRpcSaklmxR6C39G187TpBAO132gUfleTGccUPs8c= -github.com/aws/aws-sdk-go-v2/internal/ini v1.5.2 h1:5KL4rS1yq5rJ6Q8lrlsFPHCPWwhkMINNiRXHb4YbFyc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 h1:pyVrNAf7Hwz0u39dLKN5t+n0+K/3rMYKuiOoIum3AsU= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2/go.mod h1:mydrfOb9uiOYCxuCPR8YHQNQyGQwUQ7gPMZGBKbH8NY= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 h1:CJxo7ZBbaIzmXfV3hjcx36n9V87gJsIUPJflwqEHl3Q= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0/go.mod h1:yjVfjuY4nD1EW9i387Kau+I6V5cBA5YnC/mWNopjZrI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 h1:f2LhPofnjcdOQKRtumKjMvIHkfSQ8aH/rwKUDEQ/SB4= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2/go.mod h1:q+xX0H4OfuWDuBy7y/LDi4v8IBOWuF+vtp8Z6ex+lw4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 h1:h7j73yuAVVjic8pqswh+L/7r2IHP43QwRyOu6zcCDDE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2/go.mod h1:H07AHdK5LSy8F7EJUQhoxyiCNkePoHj2D8P2yGTWafo= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2 h1:gbIaOzpXixUpoPK+js/bCBK1QBDXM22SigsnzGZio0U= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2/go.mod h1:p+S7RNbdGN8qgHDSg2SCQJ9FeMAmvcETQiVpeGhYnNM= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1 h1:o6MCcX1rJW8Y3g+hvg2xpjF6JR6DftuYhfl3Nc1WV9Q= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1/go.mod h1:UDtxEWbREX6y4KREapT+jjtjoH0TiVSS6f5nfaY1UaM= -github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 h1:km+ZNjtLtpXYf42RdaDZnNHm9s7SYAuDGTafy6nd89A= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 h1:iRFNqZH4a67IqPvK8xxtyQYnyrlsvwmpHOe9r55ggBA= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 h1:txgVXIXWPXyqdiVn92BV6a/rgtpX31HYdsOYj0sVQQQ= -github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= -github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= +github.com/aws/aws-sdk-go-v2/config v1.28.7 h1:GduUnoTXlhkgnxTD93g1nv4tVPILbdNQOzav+Wpg7AE= +github.com/aws/aws-sdk-go-v2/config v1.28.7/go.mod h1:vZGX6GVkIE8uECSUHB6MWAUsd4ZcG2Yq/dMa4refR3M= +github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4afs45mOWEI+MzZtTfQ= +github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 h1:2zxMLXLedpB4K1ilbJFxtMKsVKaexOqDttOhc0QGm3Q= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44/go.mod h1:VuLHdqwjSvgftNC7yqPWyGVhEwPmJpeRi07gOgOfHF8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= +github.com/aws/aws-sdk-go-v2/service/rds v1.93.2 h1:Fv2//DyCH9n6LqEOvpeIFYYRfIhvjhrLk5qhrYMjDGE= +github.com/aws/aws-sdk-go-v2/service/rds v1.93.2/go.mod h1:QEpwiX4BS6nos2d/ele6gRGalNW0Hzc1TZMmhkywQb0= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7/go.mod h1:JfyQ0g2JG8+Krq0EuZNnRwX0mU0HrwY/tG6JNfcqh4k= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 h1:Xgv/hyNgvLda/M9l9qxXc4UFSgppnRczLxlMs5Ae/QY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.3/go.mod h1:5Gn+d+VaaRgsjewpMvGazt0WfcFO+Md4wLOuBfGR9Bc= +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= @@ -72,6 +86,7 @@ github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -80,7 +95,6 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -106,10 +120,12 @@ github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= @@ -126,6 +142,7 @@ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzL github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/sijms/go-ora/v2 v2.7.19 h1:+p0V51zrnpchRIIfx9kcEFGNUXkC0q9uZiyh05tyybI= github.com/sijms/go-ora/v2 v2.7.19/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -134,10 +151,13 @@ github.com/snowflakedb/gosnowflake v1.6.25 h1:o5zUmxTOo0Eo9AdkEj8blCeiMuILrQJ+rj github.com/snowflakedb/gosnowflake v1.6.25/go.mod h1:KfO4F7bk+aXPUIvBqYxvPhxLlu2/w4TtSC8Rw/yr5Mg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= @@ -164,10 +184,14 @@ golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/commonHelpers/commonHelpers.go b/internal/commonHelpers/commonHelpers.go new file mode 100644 index 00000000..3b073bfa --- /dev/null +++ b/internal/commonHelpers/commonHelpers.go @@ -0,0 +1,53 @@ +package commonHelpers + +import ( + "fmt" + "log/slog" + "os" + "path/filepath" +) + +func CreateTransferTmpDirs(transferId, globalTmpDir string, logger *slog.Logger) (tmpDir, pipeFileDir, finalCsvDir string, err error) { + tmpDir = filepath.Join(globalTmpDir, transferId) + + err = os.MkdirAll(tmpDir, 0600) + if err != nil { + return tmpDir, pipeFileDir, finalCsvDir, fmt.Errorf("error creating temp dir :: %v", err) + } + + logger.Info(fmt.Sprintf("temp dir %v created", tmpDir)) + + pipeFileDir = filepath.Join(tmpDir, "pipe-files") + err = os.MkdirAll(pipeFileDir, 0600) + if err != nil { + go func() { + err = os.RemoveAll(tmpDir) + if err != nil { + logger.Error(fmt.Sprintf("error removing temp dir %v :: %v", tmpDir, err)) + return + } + logger.Info(fmt.Sprintf("temp dir %v removed because pipe file dir creation failed", tmpDir)) + }() + return tmpDir, pipeFileDir, finalCsvDir, fmt.Errorf("error creating pipe file dir :: %v", err) + } + + logger.Info(fmt.Sprintf("pipe file dir %v created", pipeFileDir)) + + finalCsvDir = filepath.Join(tmpDir, "final-csv") + err = os.MkdirAll(finalCsvDir, 0600) + if err != nil { + go func() { + err = os.RemoveAll(tmpDir) + if err != nil { + logger.Error(fmt.Sprintf("error removing temp dir %v :: %v", tmpDir, err)) + return + } + logger.Info(fmt.Sprintf("temp dir %v removed because final csv dir creation failed", tmpDir)) + }() + return tmpDir, pipeFileDir, finalCsvDir, fmt.Errorf("error creating final csv dir :: %v", err) + } + + logger.Info(fmt.Sprintf("final csv dir %v created", finalCsvDir)) + + return tmpDir, pipeFileDir, finalCsvDir, nil +} diff --git a/internal/data/instance.go b/internal/data/instance.go new file mode 100644 index 00000000..4a0d2857 --- /dev/null +++ b/internal/data/instance.go @@ -0,0 +1,36 @@ +package data + +var ( + TypePostgreSQL = "postgresql" + TypeMySQL = "mysql" + TypeSQLServer = "mssql" + TypeOracle = "oracle" + TypeAWS = "aws" + TypeGCP = "gcp" + TypeAzure = "azure" +) + +type Instance struct { + ID string + Type string + CloudProvider string + Region string + CloudAccountID string + Host string + Port int + Username string + Password string +} + +var AllowedInstanceTypes = map[string]struct{}{ + TypePostgreSQL: {}, + TypeMySQL: {}, + TypeSQLServer: {}, + TypeOracle: {}, +} + +var AllowedCloudProviders = map[string]struct{}{ + TypeAWS: {}, + TypeGCP: {}, + TypeAzure: {}, +} diff --git a/internal/data/instanceTransfer.go b/internal/data/instanceTransfer.go new file mode 100644 index 00000000..0605ee96 --- /dev/null +++ b/internal/data/instanceTransfer.go @@ -0,0 +1,45 @@ +package data + +import ( + "github.com/sqlpipe/sqlpipe/internal/validator" +) + +type InstanceTransfer struct { + ID string + NamingConvention *NamingConvention + SourceInstance *Instance + RestoredInstanceID string + TargetType string + TargetHost string + TargetUsername string + TargetPassword string + CloudUsername string + CloudPassword string + Delimiter string + Newline string + Null string + PsqlAvailable bool + BcpAvailable bool + SqlLdrAvailable bool + TransferInfos []*TransferInfo + SchemaTree *SafeTreeNode + ScanForPII bool + StagingDbNames []string + DeleteRestoredInstanceAfterTransfer bool + CustomStrategyThreshold float64 + CustomStrategyPercentile float64 + NumRowsToScannForPII int +} + +var ( + StatusPending = "Pending" + StatusRestoring = "Restoring backup" + StatusBackupRestored = "Backup restored" + StatusChangingCredentials = "Changing credentials" + StatusMovingData = "Moving data" + StatusComplete = "Complete" + StatusError = "Error" +) + +func ValidateInstanceTransfer(v *validator.Validator, instanceTransfer *InstanceTransfer) { +} diff --git a/internal/data/namingConvention.go b/internal/data/namingConvention.go new file mode 100644 index 00000000..5e7cf3c4 --- /dev/null +++ b/internal/data/namingConvention.go @@ -0,0 +1,8 @@ +package data + +type NamingConvention struct { + DatabaseNameInSnowflake string + SchemaNameInSnowflake string + SchemaFallbackInSnowflake string + TableNameInSnowflake string +} diff --git a/internal/data/transferInfo.go b/internal/data/transferInfo.go new file mode 100644 index 00000000..16fb63c2 --- /dev/null +++ b/internal/data/transferInfo.go @@ -0,0 +1,188 @@ +package data + +import ( + "context" + + "github.com/sqlpipe/sqlpipe/internal/validator" +) + +type TransferInfo struct { + ID string `json:"id"` + Error string `json:"error,omitempty"` + KeepFiles bool `json:"keep-files"` + TmpDir string `json:"tmp-dir"` + PipeFileDir string `json:"pipe-file-dir"` + FinalCsvDir string `json:"final-csv-dir"` + SourceInstance Instance `json:"source-instance"` + SourceDatabase string `json:"source-database"` + SourceSchema string `json:"source-schema,omitempty"` + SourceTable string `json:"source-table,omitempty"` + TargetType string `json:"target-type"` + TargetConnectionString string `json:"-"` + TargetHost string `json:"target-host"` + TargetPort int `json:"target-port,omitempty"` + TargetDatabase string `json:"target-database"` + TargetUsername string `json:"target-username"` + TargetPassword string `json:"-"` + DropTargetTableIfExists bool `json:"drop-target-table-if-exists"` + CreateTargetSchemaIfNotExists bool `json:"create-target-schema-if-not-exists"` + CreateTargetTableIfNotExists bool `json:"create-target-table-if-not-exists"` + TargetSchema string `json:"target-schema,omitempty"` + TargetTable string `json:"target-name"` + Query string `json:"query,omitempty"` + Delimiter string `json:"delimiter"` + Newline string `json:"newline"` + Null string `json:"null"` + PsqlAvailable bool `json:"-"` + BcpAvailable bool `json:"-"` + SqlLdrAvailable bool `json:"-"` + StagingDbName string `json:"staging-db-name"` + TableNode *SafeTreeNode + ScanForPII bool `json:"scan-for-pii"` + ScannedForPII bool `json:"scanned-for-pii"` + ColumnInfos []*ColumnInfo + Context context.Context + Cancel context.CancelFunc +} + +type ColumnInfo struct { + Name string `json:"name"` + PipeType string `json:"pipe-type"` + ScanType string `json:"scan-type"` + DecimalOk bool `json:"decimal-ok"` + Precision int64 `json:"precision"` + Scale int64 `json:"scale"` + LengthOk bool `json:"length-ok"` + Length int64 `json:"length"` + NullableOk bool `json:"nullable-ok"` + Nullable bool `json:"nullable"` + IsPrimaryKey bool `json:"is-primary-key"` +} + +func ValidateTransferInfo(v *validator.Validator, transferInfo *TransferInfo) { + + validateTransferAutomatedFields(transferInfo) + + v.NotBlank(transferInfo.TargetTable) + + if transferInfo.Query == "" { + if transferInfo.SourceTable == "" { + v.AddFieldError("query", "you must provide a query or source-table to specicy what data to move") + } + } + + if transferInfo.Query != "" { + if transferInfo.SourceTable != "" { + v.AddFieldError("source-table", "you must provide a query or source-table, not both") + } + + if transferInfo.SourceSchema != "" { + v.AddFieldError("source-schema", "you must provide a query or source-schema, not both") + } + } + + // v.NotBlank(transferInfo.SourceConnectionString) + v.NotBlank(transferInfo.TargetConnectionString) + + switch transferInfo.SourceInstance.Type { + case "postgresql": + validatePostgreSQLSource(v, transferInfo) + case "mysql": + validateMySQLSource(v, transferInfo) + case "mssql": + validateMSSQLSource(v, transferInfo) + case "oracle": + validateOracleSource(v, transferInfo) + case "snowflake": + validateSnowflakeSource(v, transferInfo) + default: + v.AddFieldError("source-type", "source type must be one of postgresql, mysql, mssql, oracle, snowflake") + } + + switch transferInfo.TargetType { + case "postgresql": + validatePostgreSQLTarget(v, transferInfo) + case "mysql": + validateMySQLTarget(v, transferInfo) + case "mssql": + validateMSSQLTarget(v, transferInfo) + case "oracle": + validateOracleTarget(v, transferInfo) + case "snowflake": + validateSnowflakeTarget(v, transferInfo) + default: + v.AddFieldError("target-type", "target type must be one of postgresql, mysql, mssql, oracle, snowflake") + } +} + +func validatePostgreSQLSource(v *validator.Validator, transferInfo *TransferInfo) { + if transferInfo.SourceTable != "" { + v.CheckField(transferInfo.SourceSchema != "", "source-schema", "you must provide a source-schema when providing a source-table for PostgreSQL") + } +} + +func validateMySQLSource(v *validator.Validator, transferInfo *TransferInfo) { + // v.CheckField(strings.Contains(transferInfo.SourceConnectionString, "parseTime=true"), "source-connection-string", "must contain parseTime=true to move timestamp with time zone data from mysql") + // v.CheckField(strings.Contains(transferInfo.SourceConnectionString, "loc="), "source-connection-string", `must contain loc= ... example: loc=US%2FPacific`) +} + +func validateMSSQLSource(v *validator.Validator, transferInfo *TransferInfo) { + if transferInfo.SourceTable != "" { + v.CheckField(transferInfo.SourceSchema != "", "source-schema", "you must provide a source-schema when providing a source-table for MSSQL") + } +} + +func validateOracleSource(v *validator.Validator, transferInfo *TransferInfo) { + if transferInfo.SourceTable != "" { + v.CheckField(transferInfo.SourceSchema != "", "source-schema", "you must provide a source-schema when providing a source-table for Oracle") + } +} + +func validateSnowflakeSource(v *validator.Validator, transferInfo *TransferInfo) { + if transferInfo.SourceTable != "" { + v.CheckField(transferInfo.SourceSchema != "", "source-schema", "you must provide a source-schema when providing a source-table for Snowflake") + } +} + +func validatePostgreSQLTarget(v *validator.Validator, transferInfo *TransferInfo) { + v.CheckField(transferInfo.PsqlAvailable, "target-type", "you must install psql to transfer data to postgresql") +} + +func validateMySQLTarget(v *validator.Validator, transferInfo *TransferInfo) { + // nothing special needed +} + +func validateMSSQLTarget(v *validator.Validator, transferInfo *TransferInfo) { + v.CheckField(transferInfo.BcpAvailable, "target-type", "you must install bcp to transfer data to mssql") + v.CheckField(transferInfo.TargetPort != 0, "target-port", "you must provide a target-port for MSSQL") + v.CheckField(transferInfo.TargetHost != "", "target-host", "you must provide a target host for MSSQL") + v.CheckField(transferInfo.TargetUsername != "", "target-username", "you must provide a target-username for MSSQL") + v.CheckField(transferInfo.TargetPassword != "", "target-password", "you must provide a target-password for MSSQL") + v.CheckField(transferInfo.TargetDatabase != "", "target-database", "you must provide a target-database for MSSQL") +} + +func validateOracleTarget(v *validator.Validator, transferInfo *TransferInfo) { + v.CheckField(transferInfo.SqlLdrAvailable, "target-type", "you must install sqlldr to transfer data to oracle") + v.CheckField(transferInfo.TargetHost != "", "target-host", "you must provide a target host for Oracle") + v.CheckField(transferInfo.TargetUsername != "", "target-username", "you must provide a target-username for Oracle") + v.CheckField(transferInfo.TargetPassword != "", "target-password", "you must provide a target-password for Oracle") + v.CheckField(transferInfo.TargetDatabase != "", "target-database", "you must provide a target-database for Oracle") +} + +func validateSnowflakeTarget(v *validator.Validator, transferInfo *TransferInfo) { + // nothing special needed +} + +func validateTransferAutomatedFields(transferInfo *TransferInfo) { + if transferInfo.ID == "" { + panic("id not set") + } + + if transferInfo.Context == nil { + panic("context not set") + } + + if transferInfo.Cancel == nil { + panic("cancel not set") + } +} diff --git a/internal/data/treeNode.go b/internal/data/treeNode.go new file mode 100644 index 00000000..3c7b487b --- /dev/null +++ b/internal/data/treeNode.go @@ -0,0 +1,127 @@ +package data + +import ( + "encoding/json" + "fmt" + "sync" +) + +type SafeTreeNode struct { + ID string + Name string + ContainsPII bool + PIIType string + Children []*SafeTreeNode + Parent *SafeTreeNode + Mu *sync.Mutex +} + +func (n *SafeTreeNode) AddChild(id, name string) *SafeTreeNode { + + n.Mu.Lock() + defer n.Mu.Unlock() + + child := &SafeTreeNode{ + ID: id, + Name: name, + ContainsPII: false, + Children: []*SafeTreeNode{}, + Parent: n, + Mu: &sync.Mutex{}, + } + n.Children = append(n.Children, child) + return child +} + +func (n *SafeTreeNode) ChangeContainsPII(containsPII bool, PIIType string) { + + n.Mu.Lock() + defer n.Mu.Unlock() + + n.ContainsPII = containsPII + n.PIIType = PIIType +} + +func (n *SafeTreeNode) PrettyPrint() { + toPrint := fmt.Sprintf("- %s: Contains PII: %t", n.Name, n.ContainsPII) + + if n.PIIType != "" { + toPrint = fmt.Sprintf("%v, PII Type: %s\n", toPrint, n.PIIType) + } else { + toPrint = fmt.Sprintf("%v\n", toPrint) + } + + fmt.Println(toPrint) + + for _, child := range n.Children { + child.PrettyPrint() + } +} + +func (n *SafeTreeNode) FindChildNodeByName(name string) (*SafeTreeNode, bool) { + + n.Mu.Lock() + defer n.Mu.Unlock() + + for _, child := range n.Children { + if child.Name == name { + return child, true + } + } + return nil, false +} + +func (n *SafeTreeNode) RecursivelySearchForPII() bool { + + if n.ContainsPII { + n.ContainsPII = true + } + + for _, child := range n.Children { + if child.RecursivelySearchForPII() { + n.ContainsPII = true + } + } + + return n.ContainsPII +} + +func (n *SafeTreeNode) CloneWithoutParents() *SafeTreeNode { + + clone := &SafeTreeNode{ + ID: n.ID, + Name: n.Name, + ContainsPII: n.ContainsPII, + PIIType: n.PIIType, + Children: []*SafeTreeNode{}, + Mu: &sync.Mutex{}, + } + + for _, child := range n.Children { + clone.Children = append(clone.Children, child.CloneWithoutParents()) + } + + return clone +} + +func (n *SafeTreeNode) ToJSON() (string, error) { + + newTree := n.CloneWithoutParents() + + data, err := json.Marshal(newTree) + if err != nil { + return "", err + } + return string(data), nil +} + +func (n *SafeTreeNode) FromJSON(data string) (*SafeTreeNode, error) { + + node := &SafeTreeNode{} + err := json.Unmarshal([]byte(data), node) + if err != nil { + return nil, err + } + + return node, nil +} diff --git a/internal/validator/validator.go b/internal/validator/validator.go new file mode 100644 index 00000000..2159f596 --- /dev/null +++ b/internal/validator/validator.go @@ -0,0 +1,72 @@ +package validator + +import ( + "regexp" + "slices" + "strings" + "unicode/utf8" +) + +var ( + EmailRX = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$") +) + +type Validator struct { + FieldErrors map[string]string +} + +func New() *Validator { + return &Validator{ + FieldErrors: make(map[string]string), + } +} + +func (v *Validator) Valid() bool { + return len(v.FieldErrors) == 0 +} + +func (v *Validator) AddFieldError(key, message string) { + if v.FieldErrors == nil { + v.FieldErrors = make(map[string]string) + } + + if _, exists := v.FieldErrors[key]; !exists { + v.FieldErrors[key] = message + } +} + +func (v *Validator) CheckField(ok bool, key, message string) { + if !ok { + v.AddFieldError(key, message) + } +} + +func (v *Validator) Matches(value string, rx *regexp.Regexp) bool { + return rx.MatchString(value) +} + +func Unique[T comparable](values []T) bool { + uniqueValues := make(map[T]bool) + + for _, value := range values { + uniqueValues[value] = true + } + + return len(values) == len(uniqueValues) +} + +func (v *Validator) NotBlank(value string) bool { + return strings.TrimSpace(value) != "" +} + +func (v *Validator) MaxChars(value string, n int) bool { + return utf8.RuneCountInString(value) <= n +} + +func PermittedValue[T comparable](value T, permittedValues ...T) bool { + return slices.Contains(permittedValues, value) +} + +func (v *Validator) MinChars(value string, n int) bool { + return utf8.RuneCountInString(value) >= n +} diff --git a/internal/vcs/vcs.go b/internal/vcs/vcs.go new file mode 100644 index 00000000..736c18d0 --- /dev/null +++ b/internal/vcs/vcs.go @@ -0,0 +1,31 @@ +package vcs + +import ( + "fmt" + "runtime/debug" +) + +func Version() string { + var revision string + var modified bool + + bi, ok := debug.ReadBuildInfo() + if ok { + for _, s := range bi.Settings { + switch s.Key { + case "vcs.revision": + revision = s.Value + case "vcs.modified": + if s.Value == "true" { + modified = true + } + } + } + } + + if modified { + return fmt.Sprintf("%s-dirty", revision) + } + + return revision +} diff --git a/pii_scan.py b/pii_scan.py new file mode 100644 index 00000000..0aad553e --- /dev/null +++ b/pii_scan.py @@ -0,0 +1,46 @@ +import sys +import json +import pandas as pd +from presidio_structured import PandasAnalysisBuilder + +def analyze_csv(csv_path, custom_strategy_threshold, custom_strategy_percentile, num_rows_to_scan_for_pii=100): + # Load CSV + df = pd.read_csv(csv_path) + df = df.astype(str) + + entities_whitelist = [ + 'CREDIT_CARD', + 'CRYPTO', + 'EMAIL_ADDRESS', + 'IBAN_CODE', + 'IP_ADDRESS', + 'NRP', + 'LOCATION', + 'PERSON', + 'PHONE_NUMBER', + 'MEDICAL_LICENSE', + 'URL', + 'US_BANK_NUMBER', + 'US_DRIVER_LICENSE', + 'US_ITIN', + 'US_PASSPORT', + 'US_SSN' + ] + + + result = PandasAnalysisBuilder().generate_analysis(df=df, n=num_rows_to_scan_for_pii, selection_strategy='custom', custom_strategy_threshold=custom_strategy_threshold, custom_strategy_percentile=custom_strategy_percentile) + + keys_to_remove = [entity for entity in result.entity_mapping if result.entity_mapping[entity] not in entities_whitelist] + for entity in keys_to_remove: + del result.entity_mapping[entity] + + return result.entity_mapping + +if __name__ == "__main__": + csv_path = sys.argv[1] + custom_strategy_threshold = float(sys.argv[2]) + custom_strategy_percentile = float(sys.argv[3]) + num_rows_to_scan_for_pii = int(sys.argv[4]) + + result = analyze_csv(csv_path, custom_strategy_threshold, custom_strategy_percentile, num_rows_to_scan_for_pii) + print(json.dumps(result)) diff --git a/setup-sql/oracle.sql b/setup-sql/oracle.sql index ae8a0969..2885ad13 100644 --- a/setup-sql/oracle.sql +++ b/setup-sql/oracle.sql @@ -1,18 +1,66 @@ -CREATE PLUGGABLE DATABASE mydb ADMIN USER mydb_admin IDENTIFIED BY Mypass123 FILE_NAME_CONVERT = ('/opt/oracle/oradata/ORCLCDB/pdbseed/', '/opt/oracle/oradata/ORCLCDB/mydb/'); -ALTER PLUGGABLE DATABASE mydb OPEN; -ALTER PLUGGABLE DATABASE mydb SAVE STATE; +-- CREATE PLUGGABLE DATABASE mydb ADMIN USER free_user IDENTIFIED BY Mypass123 FILE_NAME_CONVERT = ('/opt/oracle/oradata/ORCLCDB/pdbseed/', '/opt/oracle/oradata/ORCLCDB/mydb/'); -ALTER SESSION SET container=mydb; -CREATE TABLESPACE mydb_tablespace DATAFILE '/opt/oracle/oradata/ORCLCDB/mydb/mydb_tablespace.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M; -ALTER USER mydb_admin DEFAULT TABLESPACE mydb_tablespace; -ALTER USER mydb_admin QUOTA UNLIMITED ON mydb_tablespace; -GRANT SYSDBA TO mydb_admin; -grant create table to mydb_admin; +-- ALTER SESSION SET container=free_user; +-- CREATE TABLESPACE mydb_tablespace DATAFILE '/opt/oracle/oradata/ORCLCDB/mydb/mydb_tablespace.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M; +-- ALTER USER free_user DEFAULT TABLESPACE mydb_tablespace; +-- ALTER USER free_user QUOTA UNLIMITED ON mydb_tablespace; +-- GRANT SYSDBA TO free_user; +-- grant create table to free_user; -CREATE TABLE mydb_admin.my_table (my_id NUMBER GENERATED AS IDENTITY primary key, my_nchar NCHAR(10), my_number NUMBER(10,5), my_float FLOAT, my_varchar2 VARCHAR2(128), my_date DATE, my_binaryfloat BINARY_FLOAT, my_binarydouble BINARY_DOUBLE, my_raw RAW(128), my_char CHAR(8), my_timestamp TIMESTAMP, my_timestamptz TIMESTAMP WITH TIME ZONE, my_intervalym INTERVAL YEAR TO MONTH, my_intervalds INTERVAL DAY TO SECOND, my_urowid urowid, my_timestampltz TIMESTAMP WITH LOCAL TIME ZONE, my_clob CLOB, my_blob BLOB, my_nclob NCLOB, my_varchar VARCHAR(128), last_modified TIMESTAMP DEFAULT SYSTIMESTAMP); +ALTER SESSION SET CONTAINER=FREEPDB1; -CREATE OR REPLACE TRIGGER mydb_admin.trg_your_table_name_last_modified -BEFORE UPDATE ON mydb_admin.my_table +CREATE USER free_user IDENTIFIED BY Mypass123; + +GRANT DBA TO free_user; + +GRANT CREATE SESSION, CREATE TABLE, UNLIMITED TABLESPACE TO free_user; + +CREATE TABLE free_user.my_table (my_id NUMBER GENERATED AS IDENTITY primary key, my_nchar NCHAR(10), my_number NUMBER(10,5), my_float FLOAT, my_varchar2 VARCHAR2(128), my_date DATE, my_binaryfloat BINARY_FLOAT, my_binarydouble BINARY_DOUBLE, my_raw RAW(128), my_char CHAR(8), my_timestamp TIMESTAMP, my_timestamptz TIMESTAMP WITH TIME ZONE, my_intervalym INTERVAL YEAR TO MONTH, my_intervalds INTERVAL DAY TO SECOND, my_urowid urowid, my_timestampltz TIMESTAMP WITH LOCAL TIME ZONE, my_clob CLOB, my_blob BLOB, my_nclob NCLOB, my_varchar VARCHAR(128), last_modified TIMESTAMP DEFAULT SYSTIMESTAMP); + +INSERT INTO free_user.my_table ( + my_nchar, + my_number, + my_float, + my_varchar2, + my_date, + my_binaryfloat, + my_binarydouble, + my_raw, + my_char, + my_timestamp, + my_timestamptz, + my_intervalym, + my_intervalds, + my_urowid, + my_timestampltz, + my_clob, + my_blob, + my_nclob, + my_varchar +) VALUES ( + NULL, + NULL, + NULL, + 'one not null', + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +); + +CREATE OR REPLACE TRIGGER free_user.trg_my_table_last_modified +BEFORE UPDATE ON free_user.my_table FOR EACH ROW BEGIN :NEW.last_modified := SYSTIMESTAMP; @@ -20,112 +68,157 @@ END; BEGIN FOR i IN 1..100 LOOP -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); -INSERT INTO mydb_admin.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); +INSERT INTO free_user.my_table (my_nchar, my_number, my_float, my_varchar2, my_date, my_binaryfloat, my_binarydouble, my_raw, my_char, my_timestamp, my_timestamptz, my_intervalym, my_intervalds, my_timestampltz, my_clob, my_blob, my_nclob, my_varchar) VALUES (N'A CHAR', 123.45, 123.45, 'VARCHAR2 column', TO_DATE('2015-09-29', 'YYYY-MM-DD'), 123.45, 123.45, hextoraw('53756D6D6572'), 'C', TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), TO_TIMESTAMP_TZ('2015-08-10 12:34:56.765432 -07:00', 'YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM'), INTERVAL '5-2' YEAR TO MONTH, INTERVAL '4 03:02:01' DAY TO SECOND, TO_TIMESTAMP('2015-08-10 12:34:56.765432', 'YYYY-MM-DD HH24:MI:SS.FF6'), 'This is a CLOB', TO_BLOB(HEXTORAW('4D7953616D706C6544617461')), N'This ''is'' a NCLOB', 'VARCHAR column'); END LOOP; COMMIT; END; begin -INSERT INTO mydb_admin.my_table ( +INSERT INTO free_user.my_table ( + my_nchar, + my_number, + my_float, + my_varchar2, + my_date, + my_binaryfloat, + my_binarydouble, + my_raw, + my_char, + my_timestamp, + my_timestamptz, + my_intervalym, + my_intervalds, + my_urowid, + my_timestampltz, + my_clob, + my_blob, + my_nclob, + my_varchar +) VALUES ( + NULL, + NULL, + NULL, + 'one not null', + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +); +end; + +commit; + +INSERT INTO free_user.my_table ( my_nchar, my_number, my_float, @@ -166,4 +259,5 @@ INSERT INTO mydb_admin.my_table ( NULL, NULL ); -end; \ No newline at end of file + +commit; \ No newline at end of file diff --git a/transferInstance.dockerfile b/transferInstance.dockerfile new file mode 100644 index 00000000..afba11aa --- /dev/null +++ b/transferInstance.dockerfile @@ -0,0 +1,61 @@ +FROM debian:12.9-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update +RUN apt-get install --no-install-recommends -y ca-certificates python3.11 pipx curl tar +RUN apt-get clean +RUN rm -rf /var/lib/apt/lists/* +RUN pipx install poetry + +RUN curl -L -O https://github.com/sqlpipe/presidio/archive/refs/heads/main.tar.gz +RUN tar -xvf main.tar.gz +RUN mv presidio-main presidio +WORKDIR /presidio/presidio-structured +RUN /root/.local/bin/poetry install --all-extras +RUN /root/.local/bin/poetry run python -m spacy download en_core_web_lg +RUN echo "export PATH=$(/root/.local/bin/poetry env info --path)/bin:$PATH" >> /root/.bashrc +RUN echo -n "$(/root/.local/bin/poetry env info --path)/bin/python" >> /python_location.txt + +WORKDIR / +COPY ./LICENSE.MD /SQLPIPE-LICENSE.MD +COPY ./pii_scan.py /pii_scan.py +COPY ./bin/transferInstance /usr/local/bin/transferInstance +ENV DELIMITER="{dlm}" +ENV NEWLINE="{nwln}" +ENV NULL="{nll}" + + +# CMD ["/bin/bash"] + +ENTRYPOINT update-ca-certificates && /usr/local/bin/transferInstance \ + -instance-transfer-id="${INSTANCE_TRANSFER_ID}" \ + -database-naming-convention="${DATABASE_NAMING_CONVENTION}" \ + -schema-naming-convention="${SCHEMA_NAMING_CONVENTION}" \ + -schema-fallback="${SCHEMA_FALLBACK}" \ + -table-naming-convention="${TABLE_NAMING_CONVENTION}" \ + -source-instance-cloud-provider="${SOURCE_INSTANCE_CLOUD_PROVIDER}" \ + -source-instance-cloud-account-id="${SOURCE_INSTANCE_CLOUD_ACCOUNT_ID}" \ + -source-instance-id="${SOURCE_INSTANCE_ID}" \ + -source-instance-type="${SOURCE_INSTANCE_TYPE}" \ + -source-instance-region="${SOURCE_INSTANCE_REGION}" \ + -source-instance-host="${SOURCE_INSTANCE_HOST}" \ + -source-instance-port="${SOURCE_INSTANCE_PORT}" \ + -source-instance-username="${SOURCE_INSTANCE_USERNAME}" \ + -source-instance-password="${SOURCE_INSTANCE_PASSWORD}" \ + -restored-instance-id="${RESTORED_INSTANCE_ID}" \ + -target-type="${TARGET_TYPE}" \ + -target-host="${TARGET_HOST}" \ + -target-username="${TARGET_USERNAME}" \ + -target-password="${TARGET_PASSWORD}" \ + -cloud-username="${CLOUD_USERNAME}" \ + -cloud-password="${CLOUD_PASSWORD}" \ + -delimiter="${DELIMITER}" \ + -newline="${NEWLINE}" \ + -null="${NULL}" \ + -scan-for-pii="${SCAN_FOR_PII}" \ + -delete-restored-instance-after-transfer="${DELETE_RESTORED_INSTANCE_AFTER_TRANSFER}" \ + -custom-strategy-threshold="${CUSTOM_STRATEGY_THRESHOLD}" \ + -custom-strategy-percentile="${CUSTOM_STRATEGY_PERCENTILE}" \ + -num-rows-to-scan-for-pii="${NUM_ROWS_TO_SCAN_FOR_PII}" + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go new file mode 100644 index 00000000..6504a218 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.go @@ -0,0 +1,18 @@ +package aws + +// AccountIDEndpointMode controls how a resolved AWS account ID is handled for endpoint routing. +type AccountIDEndpointMode string + +const ( + // AccountIDEndpointModeUnset indicates the AWS account ID will not be used for endpoint routing + AccountIDEndpointModeUnset AccountIDEndpointMode = "" + + // AccountIDEndpointModePreferred indicates the AWS account ID will be used for endpoint routing if present + AccountIDEndpointModePreferred = "preferred" + + // AccountIDEndpointModeRequired indicates an error will be returned if the AWS account ID is not resolved from identity + AccountIDEndpointModeRequired = "required" + + // AccountIDEndpointModeDisabled indicates the AWS account ID will be ignored during endpoint routing + AccountIDEndpointModeDisabled = "disabled" +) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go index b361c138..16000d79 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go @@ -150,6 +150,21 @@ type Config struct { // BaseEndpoint is an intermediary transfer location to a service specific // BaseEndpoint on a service's Options. BaseEndpoint *string + + // DisableRequestCompression toggles if an operation request could be + // compressed or not. Will be set to false by default. This variable is sourced from + // environment variable AWS_DISABLE_REQUEST_COMPRESSION or the shared config profile attribute + // disable_request_compression + DisableRequestCompression bool + + // RequestMinCompressSizeBytes sets the inclusive min bytes of a request body that could be + // compressed. Will be set to 10240 by default and must be within 0 and 10485760 bytes inclusively. + // This variable is sourced from environment variable AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES or + // the shared config profile attribute request_min_compression_size_bytes + RequestMinCompressSizeBytes int64 + + // Controls how a resolved AWS account ID is handled for endpoint routing. + AccountIDEndpointMode AccountIDEndpointMode } // NewConfig returns a new Config pointer that can be chained with builder @@ -158,8 +173,7 @@ func NewConfig() *Config { return &Config{} } -// Copy will return a shallow copy of the Config object. If any additional -// configurations are provided they will be merged into the new config returned. +// Copy will return a shallow copy of the Config object. func (c Config) Copy() Config { cp := c return cp diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go index 714d4ad8..98ba7705 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go @@ -90,6 +90,9 @@ type Credentials struct { // The time the credentials will expire at. Should be ignored if CanExpire // is false. Expires time.Time + + // The ID of the account for the credentials. + AccountID string } // Expired returns if the credentials have expired. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go index aa10a9b4..99edbf3e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.go @@ -70,6 +70,10 @@ func GetUseFIPSEndpoint(options ...interface{}) (value FIPSEndpointState, found // The SDK will automatically resolve these endpoints per API client using an // internal endpoint resolvers. If you'd like to provide custom endpoint // resolving behavior you can implement the EndpointResolver interface. +// +// Deprecated: This structure was used with the global [EndpointResolver] +// interface, which has been deprecated in favor of service-specific endpoint +// resolution. See the deprecation docs on that interface for more information. type Endpoint struct { // The base URL endpoint the SDK API clients will use to make API calls to. // The SDK will suffix URI path and query elements to this endpoint. @@ -124,6 +128,8 @@ type Endpoint struct { } // EndpointSource is the endpoint source type. +// +// Deprecated: The global [Endpoint] structure is deprecated. type EndpointSource int const ( @@ -161,19 +167,25 @@ func (e *EndpointNotFoundError) Unwrap() error { // API clients will fallback to attempting to resolve the endpoint using its // internal default endpoint resolver. // -// Deprecated: See EndpointResolverWithOptions +// Deprecated: The global endpoint resolution interface is deprecated. The API +// for endpoint resolution is now unique to each service and is set via the +// EndpointResolverV2 field on service client options. Setting a value for +// EndpointResolver on aws.Config or service client options will prevent you +// from using any endpoint-related service features released after the +// introduction of EndpointResolverV2. You may also encounter broken or +// unexpected behavior when using the old global interface with services that +// use many endpoint-related customizations such as S3. type EndpointResolver interface { ResolveEndpoint(service, region string) (Endpoint, error) } // EndpointResolverFunc wraps a function to satisfy the EndpointResolver interface. // -// Deprecated: See EndpointResolverWithOptionsFunc +// Deprecated: The global endpoint resolution interface is deprecated. See +// deprecation docs on [EndpointResolver]. type EndpointResolverFunc func(service, region string) (Endpoint, error) // ResolveEndpoint calls the wrapped function and returns the results. -// -// Deprecated: See EndpointResolverWithOptions.ResolveEndpoint func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, error) { return e(service, region) } @@ -184,11 +196,17 @@ func (e EndpointResolverFunc) ResolveEndpoint(service, region string) (Endpoint, // available. If the EndpointResolverWithOptions returns an EndpointNotFoundError error, // API clients will fallback to attempting to resolve the endpoint using its // internal default endpoint resolver. +// +// Deprecated: The global endpoint resolution interface is deprecated. See +// deprecation docs on [EndpointResolver]. type EndpointResolverWithOptions interface { ResolveEndpoint(service, region string, options ...interface{}) (Endpoint, error) } // EndpointResolverWithOptionsFunc wraps a function to satisfy the EndpointResolverWithOptions interface. +// +// Deprecated: The global endpoint resolution interface is deprecated. See +// deprecation docs on [EndpointResolver]. type EndpointResolverWithOptionsFunc func(service, region string, options ...interface{}) (Endpoint, error) // ResolveEndpoint calls the wrapped function and returns the results. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index a88bb2f7..6fc9dbe1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.22.2" +const goModuleVersion = "1.32.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go index 2de15528..d66f0960 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.go @@ -65,6 +65,9 @@ func GetServiceID(ctx context.Context) (v string) { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. The resolved signing name is available +// in the signer properties object passed to the signer. func GetSigningName(ctx context.Context) (v string) { v, _ = middleware.GetStackValue(ctx, signingNameKey{}).(string) return v @@ -74,6 +77,9 @@ func GetSigningName(ctx context.Context) (v string) { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. The resolved signing region is available +// in the signer properties object passed to the signer. func GetSigningRegion(ctx context.Context) (v string) { v, _ = middleware.GetStackValue(ctx, signingRegionKey{}).(string) return v @@ -125,10 +131,13 @@ func SetRequiresLegacyEndpoints(ctx context.Context, value bool) context.Context return middleware.WithStackValue(ctx, requiresLegacyEndpointsKey{}, value) } -// SetSigningName set or modifies the signing name on the context. +// SetSigningName set or modifies the sigv4 or sigv4a signing name on the context. // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. Use WithSigV4SigningName client option +// funcs instead. func SetSigningName(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, signingNameKey{}, value) } @@ -137,6 +146,9 @@ func SetSigningName(ctx context.Context, value string) context.Context { // // Scoped to stack values. Use github.com/aws/smithy-go/middleware#ClearStackValues // to clear all stack values. +// +// Deprecated: This value is unstable. Use WithSigV4SigningRegion client option +// funcs instead. func SetSigningRegion(ctx context.Context, value string) context.Context { return middleware.WithStackValue(ctx, signingRegionKey{}, value) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go index 9bd0dfb1..6d5f0079 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.go @@ -139,16 +139,16 @@ func AddRecordResponseTiming(stack *middleware.Stack) error { // raw response within the response metadata. type rawResponseKey struct{} -// addRawResponse middleware adds raw response on to the metadata -type addRawResponse struct{} +// AddRawResponse middleware adds raw response on to the metadata +type AddRawResponse struct{} // ID the identifier for the ClientRequestID -func (m *addRawResponse) ID() string { +func (m *AddRawResponse) ID() string { return "AddRawResponseToMetadata" } // HandleDeserialize adds raw response on the middleware metadata -func (m addRawResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m AddRawResponse) 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) @@ -159,7 +159,7 @@ func (m addRawResponse) HandleDeserialize(ctx context.Context, in middleware.Des // AddRawResponseToMetadata adds middleware to the middleware stack that // store raw response on to the metadata. func AddRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&addRawResponse{}, middleware.Before) + return stack.Deserialize.Add(&AddRawResponse{}, middleware.Before) } // GetRawResponse returns raw response set on metadata diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go index 7ce48c61..128b60a7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.go @@ -4,6 +4,7 @@ import ( "context" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -11,18 +12,22 @@ import ( func AddRequestIDRetrieverMiddleware(stack *middleware.Stack) error { // add error wrapper middleware before operation deserializers so that it can wrap the error response // returned by operation deserializers - return stack.Deserialize.Insert(&requestIDRetriever{}, "OperationDeserializer", middleware.Before) + return stack.Deserialize.Insert(&RequestIDRetriever{}, "OperationDeserializer", middleware.Before) } -type requestIDRetriever struct { +// RequestIDRetriever middleware captures the AWS service request ID from the +// raw response. +type RequestIDRetriever struct { } // ID returns the middleware identifier -func (m *requestIDRetriever) ID() string { +func (m *RequestIDRetriever) ID() string { return "RequestIDRetriever" } -func (m *requestIDRetriever) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +// HandleDeserialize pulls the AWS request ID from the response, storing it in +// operation metadata. +func (m *RequestIDRetriever) 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) @@ -41,6 +46,9 @@ func (m *requestIDRetriever) HandleDeserialize(ctx context.Context, in middlewar if v := resp.Header.Get(h); len(v) != 0 { // set reqID on metadata for successful responses. SetRequestIDMetadata(&metadata, v) + + span, _ := tracing.GetSpan(ctx) + span.SetProperty("aws.request_id", v) break } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go index af3447dd..ab4e6190 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "runtime" + "sort" "strings" "github.com/aws/aws-sdk-go-v2/aws" @@ -30,8 +31,12 @@ const ( FrameworkMetadata AdditionalMetadata ApplicationIdentifier + FeatureMetadata2 ) +// Hardcoded value to specify which version of the user agent we're using +const uaMetadata = "ua/2.1" + func (k SDKAgentKeyType) string() string { switch k { case APIMetadata: @@ -50,6 +55,8 @@ func (k SDKAgentKeyType) string() string { return "lib" case ApplicationIdentifier: return "app" + case FeatureMetadata2: + return "m" case AdditionalMetadata: fallthrough default: @@ -64,12 +71,33 @@ var validChars = map[rune]bool{ '-': true, '.': true, '^': true, '_': true, '`': true, '|': true, '~': true, } -// requestUserAgent is a build middleware that set the User-Agent for the request. -type requestUserAgent struct { +// UserAgentFeature enumerates tracked SDK features. +type UserAgentFeature string + +// Enumerates UserAgentFeature. +const ( + UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types) + UserAgentFeatureWaiter = "B" + UserAgentFeaturePaginator = "C" + UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard) + UserAgentFeatureRetryModeStandard = "E" + UserAgentFeatureRetryModeAdaptive = "F" + UserAgentFeatureS3Transfer = "G" + UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external) + UserAgentFeatureS3CryptoV2 = "I" // n/a + UserAgentFeatureS3ExpressBucket = "J" + UserAgentFeatureS3AccessGrants = "K" // not yet implemented + UserAgentFeatureGZIPRequestCompression = "L" + UserAgentFeatureProtocolRPCV2CBOR = "M" +) + +// RequestUserAgent is a build middleware that set the User-Agent for the request. +type RequestUserAgent struct { sdkAgent, userAgent *smithyhttp.UserAgentBuilder + features map[UserAgentFeature]struct{} } -// newRequestUserAgent returns a new requestUserAgent which will set the User-Agent and X-Amz-User-Agent for the +// NewRequestUserAgent returns a new requestUserAgent which will set the User-Agent and X-Amz-User-Agent for the // request. // // User-Agent example: @@ -79,14 +107,16 @@ type requestUserAgent struct { // X-Amz-User-Agent example: // // aws-sdk-go-v2/1.2.3 md/GOOS/linux md/GOARCH/amd64 lang/go/1.15 -func newRequestUserAgent() *requestUserAgent { +func NewRequestUserAgent() *RequestUserAgent { userAgent, sdkAgent := smithyhttp.NewUserAgentBuilder(), smithyhttp.NewUserAgentBuilder() addProductName(userAgent) + addUserAgentMetadata(userAgent) addProductName(sdkAgent) - r := &requestUserAgent{ + r := &RequestUserAgent{ sdkAgent: sdkAgent, userAgent: userAgent, + features: map[UserAgentFeature]struct{}{}, } addSDKMetadata(r) @@ -94,7 +124,7 @@ func newRequestUserAgent() *requestUserAgent { return r } -func addSDKMetadata(r *requestUserAgent) { +func addSDKMetadata(r *RequestUserAgent) { r.AddSDKAgentKey(OperatingSystemMetadata, getNormalizedOSName()) r.AddSDKAgentKeyValue(LanguageMetadata, "go", languageVersion) r.AddSDKAgentKeyValue(AdditionalMetadata, "GOOS", runtime.GOOS) @@ -108,6 +138,10 @@ func addProductName(builder *smithyhttp.UserAgentBuilder) { builder.AddKeyValue(aws.SDKName, aws.SDKVersion) } +func addUserAgentMetadata(builder *smithyhttp.UserAgentBuilder) { + builder.AddKey(uaMetadata) +} + // AddUserAgentKey retrieves a requestUserAgent from the provided stack, or initializes one. func AddUserAgentKey(key string) func(*middleware.Stack) error { return func(stack *middleware.Stack) error { @@ -162,18 +196,18 @@ func AddRequestUserAgentMiddleware(stack *middleware.Stack) error { return err } -func getOrAddRequestUserAgent(stack *middleware.Stack) (*requestUserAgent, error) { - id := (*requestUserAgent)(nil).ID() +func getOrAddRequestUserAgent(stack *middleware.Stack) (*RequestUserAgent, error) { + id := (*RequestUserAgent)(nil).ID() bm, ok := stack.Build.Get(id) if !ok { - bm = newRequestUserAgent() + bm = NewRequestUserAgent() err := stack.Build.Add(bm, middleware.After) if err != nil { return nil, err } } - requestUserAgent, ok := bm.(*requestUserAgent) + requestUserAgent, ok := bm.(*RequestUserAgent) if !ok { return nil, fmt.Errorf("%T for %s middleware did not match expected type", bm, id) } @@ -182,34 +216,40 @@ func getOrAddRequestUserAgent(stack *middleware.Stack) (*requestUserAgent, error } // AddUserAgentKey adds the component identified by name to the User-Agent string. -func (u *requestUserAgent) AddUserAgentKey(key string) { +func (u *RequestUserAgent) AddUserAgentKey(key string) { u.userAgent.AddKey(strings.Map(rules, key)) } // AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string. -func (u *requestUserAgent) AddUserAgentKeyValue(key, value string) { +func (u *RequestUserAgent) AddUserAgentKeyValue(key, value string) { u.userAgent.AddKeyValue(strings.Map(rules, key), strings.Map(rules, value)) } -// AddUserAgentKey adds the component identified by name to the User-Agent string. -func (u *requestUserAgent) AddSDKAgentKey(keyType SDKAgentKeyType, key string) { +// AddUserAgentFeature adds the feature ID to the tracking list to be emitted +// in the final User-Agent string. +func (u *RequestUserAgent) AddUserAgentFeature(feature UserAgentFeature) { + u.features[feature] = struct{}{} +} + +// AddSDKAgentKey adds the component identified by name to the User-Agent string. +func (u *RequestUserAgent) AddSDKAgentKey(keyType SDKAgentKeyType, key string) { // TODO: should target sdkAgent u.userAgent.AddKey(keyType.string() + "/" + strings.Map(rules, key)) } -// AddUserAgentKeyValue adds the key identified by the given name and value to the User-Agent string. -func (u *requestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) { +// AddSDKAgentKeyValue adds the key identified by the given name and value to the User-Agent string. +func (u *RequestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, value string) { // TODO: should target sdkAgent u.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+"#"+strings.Map(rules, value)) } // ID the name of the middleware. -func (u *requestUserAgent) ID() string { +func (u *RequestUserAgent) ID() string { return "UserAgent" } // HandleBuild adds or appends the constructed user agent to the request. -func (u *requestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( +func (u *RequestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( out middleware.BuildOutput, metadata middleware.Metadata, err error, ) { switch req := in.Request.(type) { @@ -224,12 +264,15 @@ func (u *requestUserAgent) HandleBuild(ctx context.Context, in middleware.BuildI return next.HandleBuild(ctx, in) } -func (u *requestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) { +func (u *RequestUserAgent) addHTTPUserAgent(request *smithyhttp.Request) { const userAgent = "User-Agent" + if len(u.features) > 0 { + updateHTTPHeader(request, userAgent, buildFeatureMetrics(u.features)) + } updateHTTPHeader(request, userAgent, u.userAgent.Build()) } -func (u *requestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) { +func (u *RequestUserAgent) addHTTPSDKAgent(request *smithyhttp.Request) { const sdkAgent = "X-Amz-User-Agent" updateHTTPHeader(request, sdkAgent, u.sdkAgent.Build()) } @@ -259,3 +302,13 @@ func rules(r rune) rune { return '-' } } + +func buildFeatureMetrics(features map[UserAgentFeature]struct{}) string { + fs := make([]string, 0, len(features)) + for f := range features { + fs = append(fs, string(f)) + } + + sort.Strings(fs) + return fmt.Sprintf("%s/%s", FeatureMetadata2.string(), strings.Join(fs, ",")) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md index 3a982d69..a4872987 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.md @@ -1,3 +1,51 @@ +# v1.6.7 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. + +# v1.6.6 (2024-10-04) + +* No change notes available for this release. + +# v1.6.5 (2024-09-20) + +* No change notes available for this release. + +# v1.6.4 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. + +# v1.6.3 (2024-06-28) + +* No change notes available for this release. + +# v1.6.2 (2024-03-29) + +* No change notes available for this release. + +# v1.6.1 (2024-02-21) + +* No change notes available for this release. + +# v1.6.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. + +# v1.5.4 (2023-12-07) + +* No change notes available for this release. + +# v1.5.3 (2023-11-30) + +* No change notes available for this release. + +# v1.5.2 (2023-11-29) + +* No change notes available for this release. + +# v1.5.1 (2023-11-15) + +* No change notes available for this release. + # v1.5.0 (2023-10-31) * **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go index 80f252c6..78af41cb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.go @@ -3,4 +3,4 @@ package eventstream // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.0" +const goModuleVersion = "1.6.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go new file mode 100644 index 00000000..47ebc0f5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.go @@ -0,0 +1,72 @@ +package query + +import ( + "fmt" + "net/url" +) + +// Array represents the encoding of Query lists and sets. A Query array is a +// representation of a list of values of a fixed type. A serialized array might +// look like the following: +// +// ListName.member.1=foo +// &ListName.member.2=bar +// &Listname.member.3=baz +type Array struct { + // The query values to add the array to. + values url.Values + // The array's prefix, which includes the names of all parent structures + // and ends with the name of the list. For example, the prefix might be + // "ParentStructure.ListName". This prefix will be used to form the full + // keys for each element in the list. For example, an entry might have the + // key "ParentStructure.ListName.member.MemberName.1". + // + // While this is currently represented as a string that gets added to, it + // could also be represented as a stack that only gets condensed into a + // string when a finalized key is created. This could potentially reduce + // allocations. + prefix string + // Whether the list is flat or not. A list that is not flat will produce the + // following entry to the url.Values for a given entry: + // ListName.MemberName.1=value + // A list that is flat will produce the following: + // ListName.1=value + flat bool + // The location name of the member. In most cases this should be "member". + memberName string + // Elements are stored in values, so we keep track of the list size here. + size int32 + // Empty lists are encoded as "=", if we add a value later we will + // remove this encoding + emptyValue Value +} + +func newArray(values url.Values, prefix string, flat bool, memberName string) *Array { + emptyValue := newValue(values, prefix, flat) + emptyValue.String("") + + return &Array{ + values: values, + prefix: prefix, + flat: flat, + memberName: memberName, + emptyValue: emptyValue, + } +} + +// Value adds a new element to the Query Array. Returns a Value type used to +// encode the array element. +func (a *Array) Value() Value { + if a.size == 0 { + delete(a.values, a.emptyValue.key) + } + + // Query lists start a 1, so adjust the size first + a.size++ + prefix := a.prefix + if !a.flat { + prefix = fmt.Sprintf("%s.%s", prefix, a.memberName) + } + // Lists can't have flat members + return newValue(a.values, fmt.Sprintf("%s.%d", prefix, a.size), false) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go new file mode 100644 index 00000000..2ecf9241 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.go @@ -0,0 +1,80 @@ +package query + +import ( + "io" + "net/url" + "sort" +) + +// Encoder is a Query encoder that supports construction of Query body +// values using methods. +type Encoder struct { + // The query values that will be built up to manage encoding. + values url.Values + // The writer that the encoded body will be written to. + writer io.Writer + Value +} + +// NewEncoder returns a new Query body encoder +func NewEncoder(writer io.Writer) *Encoder { + values := url.Values{} + return &Encoder{ + values: values, + writer: writer, + Value: newBaseValue(values), + } +} + +// Encode returns the []byte slice representing the current +// state of the Query encoder. +func (e Encoder) Encode() error { + ws, ok := e.writer.(interface{ WriteString(string) (int, error) }) + if !ok { + // Fall back to less optimal byte slice casting if WriteString isn't available. + ws = &wrapWriteString{writer: e.writer} + } + + // Get the keys and sort them to have a stable output + keys := make([]string, 0, len(e.values)) + for k := range e.values { + keys = append(keys, k) + } + sort.Strings(keys) + isFirstEntry := true + for _, key := range keys { + queryValues := e.values[key] + escapedKey := url.QueryEscape(key) + for _, value := range queryValues { + if !isFirstEntry { + if _, err := ws.WriteString(`&`); err != nil { + return err + } + } else { + isFirstEntry = false + } + if _, err := ws.WriteString(escapedKey); err != nil { + return err + } + if _, err := ws.WriteString(`=`); err != nil { + return err + } + if _, err := ws.WriteString(url.QueryEscape(value)); err != nil { + return err + } + } + } + return nil +} + +// wrapWriteString wraps an io.Writer to provide a WriteString method +// where one is not available. +type wrapWriteString struct { + writer io.Writer +} + +// WriteString writes a string to the wrapped writer by casting it to +// a byte array first. +func (w wrapWriteString) WriteString(v string) (int, error) { + return w.writer.Write([]byte(v)) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go new file mode 100644 index 00000000..dea242b8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.go @@ -0,0 +1,78 @@ +package query + +import ( + "fmt" + "net/url" +) + +// Map represents the encoding of Query maps. A Query map is a representation +// of a mapping of arbitrary string keys to arbitrary values of a fixed type. +// A Map differs from an Object in that the set of keys is not fixed, in that +// the values must all be of the same type, and that map entries are ordered. +// A serialized map might look like the following: +// +// MapName.entry.1.key=Foo +// &MapName.entry.1.value=spam +// &MapName.entry.2.key=Bar +// &MapName.entry.2.value=eggs +type Map struct { + // The query values to add the map to. + values url.Values + // The map's prefix, which includes the names of all parent structures + // and ends with the name of the object. For example, the prefix might be + // "ParentStructure.MapName". This prefix will be used to form the full + // keys for each key-value pair of the map. For example, a value might have + // the key "ParentStructure.MapName.1.value". + // + // While this is currently represented as a string that gets added to, it + // could also be represented as a stack that only gets condensed into a + // string when a finalized key is created. This could potentially reduce + // allocations. + prefix string + // Whether the map is flat or not. A map that is not flat will produce the + // following entries to the url.Values for a given key-value pair: + // MapName.entry.1.KeyLocationName=mykey + // MapName.entry.1.ValueLocationName=myvalue + // A map that is flat will produce the following: + // MapName.1.KeyLocationName=mykey + // MapName.1.ValueLocationName=myvalue + flat bool + // The location name of the key. In most cases this should be "key". + keyLocationName string + // The location name of the value. In most cases this should be "value". + valueLocationName string + // Elements are stored in values, so we keep track of the list size here. + size int32 +} + +func newMap(values url.Values, prefix string, flat bool, keyLocationName string, valueLocationName string) *Map { + return &Map{ + values: values, + prefix: prefix, + flat: flat, + keyLocationName: keyLocationName, + valueLocationName: valueLocationName, + } +} + +// Key adds the given named key to the Query map. +// Returns a Value encoder that should be used to encode a Query value type. +func (m *Map) Key(name string) Value { + // Query lists start a 1, so adjust the size first + m.size++ + var key string + var value string + if m.flat { + key = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.keyLocationName) + value = fmt.Sprintf("%s.%d.%s", m.prefix, m.size, m.valueLocationName) + } else { + key = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.keyLocationName) + value = fmt.Sprintf("%s.entry.%d.%s", m.prefix, m.size, m.valueLocationName) + } + + // The key can only be a string, so we just go ahead and set it here + newValue(m.values, key, false).String(name) + + // Maps can't have flat members + return newValue(m.values, value, false) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go new file mode 100644 index 00000000..36034479 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.go @@ -0,0 +1,62 @@ +package query + +import ( + "context" + "fmt" + "io/ioutil" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// AddAsGetRequestMiddleware adds a middleware to the Serialize stack after the +// operation serializer that will convert the query request body to a GET +// operation with the query message in the HTTP request querystring. +func AddAsGetRequestMiddleware(stack *middleware.Stack) error { + return stack.Serialize.Insert(&asGetRequest{}, "OperationSerializer", middleware.After) +} + +type asGetRequest struct{} + +func (*asGetRequest) ID() string { return "Query:AsGetRequest" } + +func (m *asGetRequest) HandleSerialize( + ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := input.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("expect smithy HTTP Request, got %T", input.Request) + } + + req.Method = "GET" + + // If the stream is not set, nothing else to do. + stream := req.GetStream() + if stream == nil { + return next.HandleSerialize(ctx, input) + } + + // Clear the stream since there will not be any body. + req.Header.Del("Content-Type") + req, err = req.SetStream(nil) + if err != nil { + return out, metadata, fmt.Errorf("unable update request body %w", err) + } + input.Request = req + + // Update request query with the body's query string value. + delim := "" + if len(req.URL.RawQuery) != 0 { + delim = "&" + } + + b, err := ioutil.ReadAll(stream) + if err != nil { + return out, metadata, fmt.Errorf("unable to get request body %w", err) + } + req.URL.RawQuery += delim + string(b) + + return next.HandleSerialize(ctx, input) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go new file mode 100644 index 00000000..455b9251 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go @@ -0,0 +1,69 @@ +package query + +import ( + "fmt" + "net/url" +) + +// Object represents the encoding of Query structures and unions. A Query +// object is a representation of a mapping of string keys to arbitrary +// values where there is a fixed set of keys whose values each have their +// own known type. A serialized object might look like the following: +// +// ObjectName.Foo=value +// &ObjectName.Bar=5 +type Object struct { + // The query values to add the object to. + values url.Values + // The object's prefix, which includes the names of all parent structures + // and ends with the name of the object. For example, the prefix might be + // "ParentStructure.ObjectName". This prefix will be used to form the full + // keys for each member of the object. For example, a member might have the + // key "ParentStructure.ObjectName.MemberName". + // + // While this is currently represented as a string that gets added to, it + // could also be represented as a stack that only gets condensed into a + // string when a finalized key is created. This could potentially reduce + // allocations. + prefix string +} + +func newObject(values url.Values, prefix string) *Object { + return &Object{ + values: values, + prefix: prefix, + } +} + +// Key adds the given named key to the Query object. +// Returns a Value encoder that should be used to encode a Query value type. +func (o *Object) Key(name string) Value { + return o.key(name, false) +} + +// KeyWithValues adds the given named key to the Query object. +// Returns a Value encoder that should be used to encode a Query list of values. +func (o *Object) KeyWithValues(name string) Value { + return o.keyWithValues(name, false) +} + +// FlatKey adds the given named key to the Query object. +// Returns a Value encoder that should be used to encode a Query value type. The +// value will be flattened if it is a map or array. +func (o *Object) FlatKey(name string) Value { + return o.key(name, true) +} + +func (o *Object) key(name string, flatValue bool) Value { + if o.prefix != "" { + return newValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue) + } + return newValue(o.values, name, flatValue) +} + +func (o *Object) keyWithValues(name string, flatValue bool) Value { + if o.prefix != "" { + return newAppendValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue) + } + return newAppendValue(o.values, name, flatValue) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go new file mode 100644 index 00000000..a9251521 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go @@ -0,0 +1,115 @@ +package query + +import ( + "math/big" + "net/url" + + "github.com/aws/smithy-go/encoding/httpbinding" +) + +// Value represents a Query Value type. +type Value struct { + // The query values to add the value to. + values url.Values + // The value's key, which will form the prefix for complex types. + key string + // Whether the value should be flattened or not if it's a flattenable type. + flat bool + queryValue httpbinding.QueryValue +} + +func newValue(values url.Values, key string, flat bool) Value { + return Value{ + values: values, + key: key, + flat: flat, + queryValue: httpbinding.NewQueryValue(values, key, false), + } +} + +func newAppendValue(values url.Values, key string, flat bool) Value { + return Value{ + values: values, + key: key, + flat: flat, + queryValue: httpbinding.NewQueryValue(values, key, true), + } +} + +func newBaseValue(values url.Values) Value { + return Value{ + values: values, + queryValue: httpbinding.NewQueryValue(nil, "", false), + } +} + +// Array returns a new Array encoder. +func (qv Value) Array(locationName string) *Array { + return newArray(qv.values, qv.key, qv.flat, locationName) +} + +// Object returns a new Object encoder. +func (qv Value) Object() *Object { + return newObject(qv.values, qv.key) +} + +// Map returns a new Map encoder. +func (qv Value) Map(keyLocationName string, valueLocationName string) *Map { + return newMap(qv.values, qv.key, qv.flat, keyLocationName, valueLocationName) +} + +// Base64EncodeBytes encodes v as a base64 query string value. +// This is intended to enable compatibility with the JSON encoder. +func (qv Value) Base64EncodeBytes(v []byte) { + qv.queryValue.Blob(v) +} + +// Boolean encodes v as a query string value +func (qv Value) Boolean(v bool) { + qv.queryValue.Boolean(v) +} + +// String encodes v as a query string value +func (qv Value) String(v string) { + qv.queryValue.String(v) +} + +// Byte encodes v as a query string value +func (qv Value) Byte(v int8) { + qv.queryValue.Byte(v) +} + +// Short encodes v as a query string value +func (qv Value) Short(v int16) { + qv.queryValue.Short(v) +} + +// Integer encodes v as a query string value +func (qv Value) Integer(v int32) { + qv.queryValue.Integer(v) +} + +// Long encodes v as a query string value +func (qv Value) Long(v int64) { + qv.queryValue.Long(v) +} + +// Float encodes v as a query string value +func (qv Value) Float(v float32) { + qv.queryValue.Float(v) +} + +// Double encodes v as a query string value +func (qv Value) Double(v float64) { + qv.queryValue.Double(v) +} + +// BigInteger encodes v as a query string value +func (qv Value) BigInteger(v *big.Int) { + qv.queryValue.BigInteger(v) +} + +// BigDecimal encodes v as a query string value +func (qv Value) BigDecimal(v *big.Float) { + qv.queryValue.BigDecimal(v) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go new file mode 100644 index 00000000..1bce78a4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.go @@ -0,0 +1,85 @@ +package restjson + +import ( + "encoding/json" + "io" + "strings" + + "github.com/aws/smithy-go" +) + +// GetErrorInfo util looks for code, __type, and message members in the +// json body. These members are optionally available, and the function +// returns the value of member if it is available. This function is useful to +// identify the error code, msg in a REST JSON error response. +func GetErrorInfo(decoder *json.Decoder) (errorType string, message string, err error) { + var errInfo struct { + Code string + Type string `json:"__type"` + Message string + } + + err = decoder.Decode(&errInfo) + if err != nil { + if err == io.EOF { + return errorType, message, nil + } + return errorType, message, err + } + + // assign error type + if len(errInfo.Code) != 0 { + errorType = errInfo.Code + } else if len(errInfo.Type) != 0 { + errorType = errInfo.Type + } + + // assign error message + if len(errInfo.Message) != 0 { + message = errInfo.Message + } + + // sanitize error + if len(errorType) != 0 { + errorType = SanitizeErrorCode(errorType) + } + + return errorType, message, nil +} + +// SanitizeErrorCode sanitizes the errorCode string . +// The rule for sanitizing is if a `:` character is present, then take only the +// contents before the first : character in the value. +// If a # character is present, then take only the contents after the +// first # character in the value. +func SanitizeErrorCode(errorCode string) string { + if strings.ContainsAny(errorCode, ":") { + errorCode = strings.SplitN(errorCode, ":", 2)[0] + } + + if strings.ContainsAny(errorCode, "#") { + errorCode = strings.SplitN(errorCode, "#", 2)[1] + } + + return errorCode +} + +// GetSmithyGenericAPIError returns smithy generic api error and an error interface. +// Takes in json decoder, and error Code string as args. The function retrieves error message +// and error code from the decoder body. If errorCode of length greater than 0 is passed in as +// an argument, it is used instead. +func GetSmithyGenericAPIError(decoder *json.Decoder, errorCode string) (*smithy.GenericAPIError, error) { + errorType, message, err := GetErrorInfo(decoder) + if err != nil { + return nil, err + } + + if len(errorCode) == 0 { + errorCode = errorType + } + + return &smithy.GenericAPIError{ + Code: errorCode, + Message: message, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go new file mode 100644 index 00000000..8c783641 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.go @@ -0,0 +1,20 @@ +package ratelimit + +import "context" + +// None implements a no-op rate limiter which effectively disables client-side +// rate limiting (also known as "retry quotas"). +// +// GetToken does nothing and always returns a nil error. The returned +// token-release function does nothing, and always returns a nil error. +// +// AddTokens does nothing and always returns a nil error. +var None = &none{} + +type none struct{} + +func (*none) GetToken(ctx context.Context, cost uint) (func() error, error) { + return func() error { return nil }, nil +} + +func (*none) AddTokens(v uint) error { return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go new file mode 100644 index 00000000..bfa5bf7d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.go @@ -0,0 +1,51 @@ +package retry + +import ( + "context" + + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" +) + +type attemptMetrics struct { + Attempts metrics.Int64Counter + Errors metrics.Int64Counter + + AttemptDuration metrics.Float64Histogram +} + +func newAttemptMetrics(meter metrics.Meter) (*attemptMetrics, error) { + m := &attemptMetrics{} + var err error + + m.Attempts, err = meter.Int64Counter("client.call.attempts", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "{attempt}" + o.Description = "The number of attempts for an individual operation" + }) + if err != nil { + return nil, err + } + m.Errors, err = meter.Int64Counter("client.call.errors", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "{error}" + o.Description = "The number of errors for an operation" + }) + if err != nil { + return nil, err + } + m.AttemptDuration, err = meter.Float64Histogram("client.call.attempt_duration", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "The time it takes to connect to the service, send the request, and get back HTTP status code and headers (including time queued waiting to be sent)" + }) + if err != nil { + return nil, err + } + + return m, nil +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go index 822fc920..52d59b04 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go @@ -2,16 +2,22 @@ package retry import ( "context" + "errors" "fmt" "strconv" "strings" "time" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/smithy-go" + "github.com/aws/aws-sdk-go-v2/aws" awsmiddle "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" smithymiddle "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" "github.com/aws/smithy-go/transport/http" ) @@ -34,10 +40,17 @@ type Attempt struct { // attempts are reached. LogAttempts bool + // A Meter instance for recording retry-related metrics. + OperationMeter metrics.Meter + retryer aws.RetryerV2 requestCloner RequestCloner } +// define the threshold at which we will consider certain kind of errors to be probably +// caused by clock skew +const skewThreshold = 4 * time.Minute + // NewAttemptMiddleware returns a new Attempt retry middleware. func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optFns ...func(*Attempt)) *Attempt { m := &Attempt{ @@ -47,6 +60,10 @@ func NewAttemptMiddleware(retryer aws.Retryer, requestCloner RequestCloner, optF for _, fn := range optFns { fn(m) } + if m.OperationMeter == nil { + m.OperationMeter = metrics.NopMeterProvider{}.Meter("") + } + return m } @@ -72,6 +89,11 @@ func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeIn maxAttempts := r.retryer.MaxAttempts() releaseRetryToken := nopRelease + retryMetrics, err := newAttemptMetrics(r.OperationMeter) + if err != nil { + return out, metadata, err + } + for { attemptNum++ attemptInput := in @@ -85,8 +107,29 @@ func (r *Attempt) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeIn AttemptClockSkew: attemptClockSkew, }) + // Setting clock skew to be used on other context (like signing) + ctx = internalcontext.SetAttemptSkewContext(ctx, attemptClockSkew) + var attemptResult AttemptResult + + attemptCtx, span := tracing.StartSpan(attemptCtx, "Attempt", func(o *tracing.SpanOptions) { + o.Properties.Set("operation.attempt", attemptNum) + }) + retryMetrics.Attempts.Add(ctx, 1, withOperationMetadata(ctx)) + + start := sdk.NowTime() out, attemptResult, releaseRetryToken, err = r.handleAttempt(attemptCtx, attemptInput, releaseRetryToken, next) + elapsed := sdk.NowTime().Sub(start) + + retryMetrics.AttemptDuration.Record(ctx, float64(elapsed)/1e9, withOperationMetadata(ctx)) + if err != nil { + retryMetrics.Errors.Add(ctx, 1, withOperationMetadata(ctx), func(o *metrics.RecordMetricOptions) { + o.Properties.Set("exception.type", errorType(err)) + }) + } + + span.End() + attemptClockSkew, _ = awsmiddle.GetAttemptSkew(attemptResult.ResponseMetadata) // AttemptResult Retried states that the attempt was not successful, and @@ -184,6 +227,8 @@ func (r *Attempt) handleAttempt( return out, attemptResult, nopRelease, err } + err = wrapAsClockSkew(ctx, err) + //------------------------------ // Is Retryable and Should Retry //------------------------------ @@ -239,6 +284,37 @@ func (r *Attempt) handleAttempt( return out, attemptResult, releaseRetryToken, err } +// errors that, if detected when we know there's a clock skew, +// can be retried and have a high chance of success +var possibleSkewCodes = map[string]struct{}{ + "InvalidSignatureException": {}, + "SignatureDoesNotMatch": {}, + "AuthFailure": {}, +} + +var definiteSkewCodes = map[string]struct{}{ + "RequestExpired": {}, + "RequestInTheFuture": {}, + "RequestTimeTooSkewed": {}, +} + +// wrapAsClockSkew checks if this error could be related to a clock skew +// error and if so, wrap the error. +func wrapAsClockSkew(ctx context.Context, err error) error { + var v interface{ ErrorCode() string } + if !errors.As(err, &v) { + return err + } + if _, ok := definiteSkewCodes[v.ErrorCode()]; ok { + return &retryableClockSkewError{Err: err} + } + _, isPossibleSkewCode := possibleSkewCodes[v.ErrorCode()] + if skew := internalcontext.GetAttemptSkewContext(ctx); skew > skewThreshold && isPossibleSkewCode { + return &retryableClockSkewError{Err: err} + } + return err +} + // MetricsHeader attaches SDK request metric header for retries to the transport type MetricsHeader struct{} @@ -320,11 +396,23 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO middleware.LogAttempts = options.LogRetryAttempts }) - if err := stack.Finalize.Add(attempt, smithymiddle.After); err != nil { + // index retry to before signing, if signing exists + if err := stack.Finalize.Insert(attempt, "Signing", smithymiddle.Before); err != nil { return err } - if err := stack.Finalize.Add(&MetricsHeader{}, smithymiddle.After); err != nil { + + if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil { return err } return nil } + +// Determines the value of exception.type for metrics purposes. We prefer an +// API-specific error code, otherwise it's just the Go type for the value. +func errorType(err error) string { + var terr smithy.APIError + if errors.As(err, &terr) { + return terr.ErrorCode() + } + return fmt.Sprintf("%T", err) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go index 987affdd..acd8d1cc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go @@ -2,6 +2,7 @@ package retry import ( "errors" + "fmt" "net" "net/url" "strings" @@ -199,3 +200,23 @@ func (r RetryableErrorCode) IsErrorRetryable(err error) aws.Ternary { return aws.TrueTernary } + +// retryableClockSkewError marks errors that can be caused by clock skew +// (difference between server time and client time). +// This is returned when there's certain confidence that adjusting the client time +// could allow a retry to succeed +type retryableClockSkewError struct{ Err error } + +func (e *retryableClockSkewError) Error() string { + return fmt.Sprintf("Probable clock skew error: %v", e.Err) +} + +// Unwrap returns the wrapped error. +func (e *retryableClockSkewError) Unwrap() error { + return e.Err +} + +// RetryableError allows the retryer to retry this request +func (e *retryableClockSkewError) RetryableError() bool { + return true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go index 25abffc8..d5ea9322 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.go @@ -123,6 +123,17 @@ type StandardOptions struct { // Provides the rate limiting strategy for rate limiting attempt retries // across all attempts the retryer is being used with. + // + // A RateLimiter operates as a token bucket with a set capacity, where + // attempt failures events consume tokens. A retry attempt that attempts to + // consume more tokens than what's available results in operation failure. + // The default implementation is parameterized as follows: + // - a capacity of 500 (DefaultRetryRateTokens) + // - a retry caused by a timeout costs 10 tokens (DefaultRetryCost) + // - a retry caused by other errors costs 5 tokens (DefaultRetryTimeoutCost) + // - an operation that succeeds on the 1st attempt adds 1 token (DefaultNoRetryIncrement) + // + // You can disable rate limiting by setting this field to ratelimit.None. RateLimiter RateLimiter // The cost to deduct from the RateLimiter's token bucket per retry. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go index ca738f23..734e548b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go @@ -38,7 +38,6 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Expected-Bucket-Owner": struct{}{}, "X-Amz-Grant-Full-control": struct{}{}, "X-Amz-Grant-Read": struct{}{}, "X-Amz-Grant-Read-Acp": struct{}{}, @@ -46,7 +45,6 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Grant-Write-Acp": struct{}{}, "X-Amz-Metadata-Directive": struct{}{}, "X-Amz-Mfa": struct{}{}, - "X-Amz-Request-Payer": struct{}{}, "X-Amz-Server-Side-Encryption": struct{}{}, "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, "X-Amz-Server-Side-Encryption-Context": struct{}{}, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go index 0fb9b24e..8a46220a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.go @@ -15,6 +15,7 @@ import ( internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" "github.com/aws/aws-sdk-go-v2/internal/sdk" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -58,7 +59,7 @@ func (e *SigningError) Unwrap() error { // S3 PutObject API allows unsigned payload signing auth usage when TLS is enabled, and uses this middleware to // dynamically switch between unsigned and signed payload based on TLS state for request. func UseDynamicPayloadSigningMiddleware(stack *middleware.Stack) error { - _, err := stack.Build.Swap(computePayloadHashMiddlewareID, &dynamicPayloadSigningMiddleware{}) + _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &dynamicPayloadSigningMiddleware{}) return err } @@ -71,27 +72,25 @@ func (m *dynamicPayloadSigningMiddleware) ID() string { return computePayloadHashMiddlewareID } -// HandleBuild sets a resolver that directs to the payload sha256 compute handler. -func (m *dynamicPayloadSigningMiddleware) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize delegates SHA256 computation according to whether the request +// is TLS-enabled. +func (m *dynamicPayloadSigningMiddleware) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - // if TLS is enabled, use unsigned payload when supported if req.IsHTTPS() { - return (&unsignedPayload{}).HandleBuild(ctx, in, next) + return (&UnsignedPayload{}).HandleFinalize(ctx, in, next) } - - // else fall back to signed payload - return (&computePayloadSHA256{}).HandleBuild(ctx, in, next) + return (&ComputePayloadSHA256{}).HandleFinalize(ctx, in, next) } -// unsignedPayload sets the SigV4 request payload hash to unsigned. +// UnsignedPayload sets the SigV4 request payload hash to unsigned. // // Will not set the Unsigned Payload magic SHA value, if a SHA has already been // stored in the context. (e.g. application pre-computed SHA256 before making @@ -99,39 +98,32 @@ func (m *dynamicPayloadSigningMiddleware) HandleBuild( // // This middleware does not check the X-Amz-Content-Sha256 header, if that // header is serialized a middleware must translate it into the context. -type unsignedPayload struct{} +type UnsignedPayload struct{} // AddUnsignedPayloadMiddleware adds unsignedPayload to the operation // middleware stack func AddUnsignedPayloadMiddleware(stack *middleware.Stack) error { - return stack.Build.Add(&unsignedPayload{}, middleware.After) + return stack.Finalize.Insert(&UnsignedPayload{}, "ResolveEndpointV2", middleware.After) } // ID returns the unsignedPayload identifier -func (m *unsignedPayload) ID() string { +func (m *UnsignedPayload) ID() string { return computePayloadHashMiddlewareID } -// HandleBuild sets the payload hash to be an unsigned payload -func (m *unsignedPayload) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize sets the payload hash magic value to the unsigned sentinel. +func (m *UnsignedPayload) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - // This should not compute the content SHA256 if the value is already - // known. (e.g. application pre-computed SHA256 before making API call). - // Does not have any tight coupling to the X-Amz-Content-Sha256 header, if - // that header is provided a middleware must translate it into the context. - contentSHA := GetPayloadHash(ctx) - if len(contentSHA) == 0 { - contentSHA = v4Internal.UnsignedPayload + if GetPayloadHash(ctx) == "" { + ctx = SetPayloadHash(ctx, v4Internal.UnsignedPayload) } - - ctx = SetPayloadHash(ctx, contentSHA) - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } -// computePayloadSHA256 computes SHA256 payload hash to sign. +// ComputePayloadSHA256 computes SHA256 payload hash to sign. // // Will not set the Unsigned Payload magic SHA value, if a SHA has already been // stored in the context. (e.g. application pre-computed SHA256 before making @@ -139,32 +131,40 @@ func (m *unsignedPayload) HandleBuild( // // This middleware does not check the X-Amz-Content-Sha256 header, if that // header is serialized a middleware must translate it into the context. -type computePayloadSHA256 struct{} +type ComputePayloadSHA256 struct{} // AddComputePayloadSHA256Middleware adds computePayloadSHA256 to the // operation middleware stack func AddComputePayloadSHA256Middleware(stack *middleware.Stack) error { - return stack.Build.Add(&computePayloadSHA256{}, middleware.After) + return stack.Finalize.Insert(&ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) } // RemoveComputePayloadSHA256Middleware removes computePayloadSHA256 from the // operation middleware stack func RemoveComputePayloadSHA256Middleware(stack *middleware.Stack) error { - _, err := stack.Build.Remove(computePayloadHashMiddlewareID) + _, err := stack.Finalize.Remove(computePayloadHashMiddlewareID) return err } // ID is the middleware name -func (m *computePayloadSHA256) ID() string { +func (m *ComputePayloadSHA256) ID() string { return computePayloadHashMiddlewareID } -// HandleBuild compute the payload hash for the request payload -func (m *computePayloadSHA256) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize computes the payload hash for the request, storing it to the +// context. This is a no-op if a caller has previously set that value. +func (m *ComputePayloadSHA256) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { + if GetPayloadHash(ctx) != "" { + return next.HandleFinalize(ctx, in) + } + + _, span := tracing.StartSpan(ctx, "ComputePayloadSHA256") + defer span.End() + req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &HashComputationError{ @@ -172,14 +172,6 @@ func (m *computePayloadSHA256) HandleBuild( } } - // This should not compute the content SHA256 if the value is already - // known. (e.g. application pre-computed SHA256 before making API call) - // Does not have any tight coupling to the X-Amz-Content-Sha256 header, if - // that header is provided a middleware must translate it into the context. - if contentSHA := GetPayloadHash(ctx); len(contentSHA) != 0 { - return next.HandleBuild(ctx, in) - } - hash := sha256.New() if stream := req.GetStream(); stream != nil { _, err = io.Copy(hash, stream) @@ -198,7 +190,8 @@ func (m *computePayloadSHA256) HandleBuild( ctx = SetPayloadHash(ctx, hex.EncodeToString(hash.Sum(nil))) - return next.HandleBuild(ctx, in) + span.End() + return next.HandleFinalize(ctx, in) } // SwapComputePayloadSHA256ForUnsignedPayloadMiddleware replaces the @@ -207,38 +200,38 @@ func (m *computePayloadSHA256) HandleBuild( // Use this to disable computing the Payload SHA256 checksum and instead use // UNSIGNED-PAYLOAD for the SHA256 value. func SwapComputePayloadSHA256ForUnsignedPayloadMiddleware(stack *middleware.Stack) error { - _, err := stack.Build.Swap(computePayloadHashMiddlewareID, &unsignedPayload{}) + _, err := stack.Finalize.Swap(computePayloadHashMiddlewareID, &UnsignedPayload{}) return err } -// contentSHA256Header sets the X-Amz-Content-Sha256 header value to +// ContentSHA256Header sets the X-Amz-Content-Sha256 header value to // the Payload hash stored in the context. -type contentSHA256Header struct{} +type ContentSHA256Header struct{} // AddContentSHA256HeaderMiddleware adds ContentSHA256Header to the // operation middleware stack func AddContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - return stack.Build.Insert(&contentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After) + return stack.Finalize.Insert(&ContentSHA256Header{}, computePayloadHashMiddlewareID, middleware.After) } // RemoveContentSHA256HeaderMiddleware removes contentSHA256Header middleware // from the operation middleware stack func RemoveContentSHA256HeaderMiddleware(stack *middleware.Stack) error { - _, err := stack.Build.Remove((*contentSHA256Header)(nil).ID()) + _, err := stack.Finalize.Remove((*ContentSHA256Header)(nil).ID()) return err } // ID returns the ContentSHA256HeaderMiddleware identifier -func (m *contentSHA256Header) ID() string { +func (m *ContentSHA256Header) ID() string { return "SigV4ContentSHA256Header" } -// HandleBuild sets the X-Amz-Content-Sha256 header value to the Payload hash +// HandleFinalize sets the X-Amz-Content-Sha256 header value to the Payload hash // stored in the context. -func (m *contentSHA256Header) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +func (m *ContentSHA256Header) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { @@ -246,25 +239,35 @@ func (m *contentSHA256Header) HandleBuild( } req.Header.Set(v4Internal.ContentSHAKey, GetPayloadHash(ctx)) - - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } -// SignHTTPRequestMiddlewareOptions is the configuration options for the SignHTTPRequestMiddleware middleware. +// SignHTTPRequestMiddlewareOptions is the configuration options for +// [SignHTTPRequestMiddleware]. +// +// Deprecated: [SignHTTPRequestMiddleware] is deprecated. type SignHTTPRequestMiddlewareOptions struct { CredentialsProvider aws.CredentialsProvider Signer HTTPSigner LogSigning bool } -// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 HTTP Signing +// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 +// HTTP Signing. +// +// Deprecated: AWS service clients no longer use this middleware. Signing as an +// SDK operation is now performed through an internal per-service middleware +// which opaquely selects and uses the signer from the resolved auth scheme. type SignHTTPRequestMiddleware struct { credentialsProvider aws.CredentialsProvider signer HTTPSigner logSigning bool } -// NewSignHTTPRequestMiddleware constructs a SignHTTPRequestMiddleware using the given Signer for signing requests +// NewSignHTTPRequestMiddleware constructs a [SignHTTPRequestMiddleware] using +// the given [Signer] for signing requests. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *SignHTTPRequestMiddleware { return &SignHTTPRequestMiddleware{ credentialsProvider: options.CredentialsProvider, @@ -273,12 +276,17 @@ func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *Sig } } -// ID is the SignHTTPRequestMiddleware identifier +// ID is the SignHTTPRequestMiddleware identifier. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) ID() string { return "Signing" } -// HandleFinalize will take the provided input and sign the request using the SigV4 authentication scheme +// HandleFinalize will take the provided input and sign the request using the +// SigV4 authentication scheme. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { @@ -328,21 +336,24 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl return next.HandleFinalize(ctx, in) } -type streamingEventsPayload struct{} +// StreamingEventsPayload signs input event stream messages. +type StreamingEventsPayload struct{} // AddStreamingEventsPayload adds the streamingEventsPayload middleware to the stack. func AddStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Build.Add(&streamingEventsPayload{}, middleware.After) + return stack.Finalize.Add(&StreamingEventsPayload{}, middleware.Before) } -func (s *streamingEventsPayload) ID() string { +// ID identifies the middleware. +func (s *StreamingEventsPayload) ID() string { return computePayloadHashMiddlewareID } -func (s *streamingEventsPayload) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +// HandleFinalize marks the input stream to be signed with SigV4. +func (s *StreamingEventsPayload) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { contentSHA := GetPayloadHash(ctx) if len(contentSHA) == 0 { @@ -351,7 +362,7 @@ func (s *streamingEventsPayload) HandleBuild( ctx = SetPayloadHash(ctx, contentSHA) - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } // GetSignedRequestSignature attempts to extract the signature of the request. @@ -361,8 +372,9 @@ func GetSignedRequestSignature(r *http.Request) ([]byte, error) { const authHeaderSignatureElem = "Signature=" if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { - ps := strings.Split(auth, ", ") + ps := strings.Split(auth, ",") for _, p := range ps { + p = strings.TrimSpace(p) if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 { sig := p[len(authHeaderSignatureElem):] if len(sig) == 0 { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go index 4d162556..7ed91d5b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.go @@ -1,48 +1,41 @@ -// Package v4 implements signing for AWS V4 signer +// Package v4 implements the AWS signature version 4 algorithm (commonly known +// as SigV4). // -// Provides request signing for request that need to be signed with -// AWS V4 Signatures. +// For more information about SigV4, see [Signing AWS API requests] in the IAM +// user guide. // -// # Standalone Signer +// While this implementation CAN work in an external context, it is developed +// primarily for SDK use and you may encounter fringe behaviors around header +// canonicalization. // -// Generally using the signer outside of the SDK should not require any additional +// # Pre-escaping a request URI // -// The signer does this by taking advantage of the URL.EscapedPath method. If your request URI requires +// AWS v4 signature validation requires that the canonical string's URI path +// component must be the escaped form of the HTTP request's path. +// +// The Go HTTP client will perform escaping automatically on the HTTP request. +// This may cause signature validation errors because the request differs from +// the URI path or query from which the signature was generated. // -// additional escaping you many need to use the URL.Opaque to define what the raw URI should be sent -// to the service as. +// Because of this, we recommend that you explicitly escape the request when +// using this signer outside of the SDK to prevent possible signature mismatch. +// This can be done by setting URL.Opaque on the request. The signer will +// prefer that value, falling back to the return of URL.EscapedPath if unset. // -// The signer will first check the URL.Opaque field, and use its value if set. -// The signer does require the URL.Opaque field to be set in the form of: +// When setting URL.Opaque you must do so in the form of: // // "///" // // // e.g. // "//example.com/some/path" // -// The leading "//" and hostname are required or the URL.Opaque escaping will -// not work correctly. +// The leading "//" and hostname are required or the escaping will not work +// correctly. // -// If URL.Opaque is not set the signer will fallback to the URL.EscapedPath() -// method and using the returned value. -// -// AWS v4 signature validation requires that the canonical string's URI path -// element must be the URI escaped form of the HTTP request's path. -// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html +// The TestStandaloneSign unit test provides a complete example of using the +// signer outside of the SDK and pre-escaping the URI path. // -// The Go HTTP client will perform escaping automatically on the request. Some -// of these escaping may cause signature validation errors because the HTTP -// request differs from the URI path or query that the signature was generated. -// https://golang.org/pkg/net/url/#URL.EscapedPath -// -// Because of this, it is recommended that when using the signer outside of the -// SDK that explicitly escaping the request prior to being signed is preferable, -// and will help prevent signature validation errors. This can be done by setting -// the URL.Opaque or URL.RawPath. The SDK will use URL.Opaque first and then -// call URL.EscapedPath() if Opaque is not set. -// -// Test `TestStandaloneSign` provides a complete example of using the signer -// outside of the SDK and pre-escaping the URI path. +// [Signing AWS API requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html package v4 import ( @@ -68,6 +61,9 @@ import ( const ( signingAlgorithm = "AWS4-HMAC-SHA256" authorizationHeader = "Authorization" + + // Version of signing v4 + Version = "SigV4" ) // HTTPSigner is an interface to a SigV4 signer that can sign HTTP requests @@ -103,6 +99,11 @@ type SignerOptions struct { // This will enable logging of the canonical request, the string to sign, and for presigning the subsequent // presigned URL. LogSigning bool + + // Disables setting the session token on the request as part of signing + // through X-Amz-Security-Token. This is needed for variations of v4 that + // present the token elsewhere. + DisableSessionToken bool } // Signer applies AWS v4 signing to given request. Use this to sign requests @@ -136,6 +137,7 @@ type httpSigner struct { DisableHeaderHoisting bool DisableURIPathEscaping bool + DisableSessionToken bool } func (s *httpSigner) Build() (signedRequest, error) { @@ -284,6 +286,7 @@ func (s Signer) SignHTTP(ctx context.Context, credentials aws.Credentials, r *ht Time: v4Internal.NewSigningTime(signingTime.UTC()), DisableHeaderHoisting: options.DisableHeaderHoisting, DisableURIPathEscaping: options.DisableURIPathEscaping, + DisableSessionToken: options.DisableSessionToken, KeyDerivator: s.keyDerivator, } @@ -360,6 +363,7 @@ func (s *Signer) PresignHTTP( IsPreSign: true, DisableHeaderHoisting: options.DisableHeaderHoisting, DisableURIPathEscaping: options.DisableURIPathEscaping, + DisableSessionToken: options.DisableSessionToken, KeyDerivator: s.keyDerivator, } @@ -390,7 +394,18 @@ func (s *httpSigner) buildCredentialScope() string { func buildQuery(r v4Internal.Rule, header http.Header) (url.Values, http.Header) { query := url.Values{} unsignedHeaders := http.Header{} + + // A list of headers to be converted to lower case to mitigate a limitation from S3 + lowerCaseHeaders := map[string]string{ + "X-Amz-Expected-Bucket-Owner": "x-amz-expected-bucket-owner", // see #2508 + "X-Amz-Request-Payer": "x-amz-request-payer", // see #2764 + } + for k, h := range header { + if newKey, ok := lowerCaseHeaders[k]; ok { + k = newKey + } + if r.IsValid(k) { query[k] = h } else { @@ -502,7 +517,8 @@ func (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Val if s.IsPreSign { query.Set(v4Internal.AmzAlgorithmKey, signingAlgorithm) - if sessionToken := s.Credentials.SessionToken; len(sessionToken) > 0 { + sessionToken := s.Credentials.SessionToken + if !s.DisableSessionToken && len(sessionToken) > 0 { query.Set("X-Amz-Security-Token", sessionToken) } @@ -512,7 +528,7 @@ func (s *httpSigner) setRequiredSigningFields(headers http.Header, query url.Val headers[v4Internal.AmzDateKey] = append(headers[v4Internal.AmzDateKey][:0], amzDate) - if len(s.Credentials.SessionToken) > 0 { + if !s.DisableSessionToken && len(s.Credentials.SessionToken) > 0 { headers[v4Internal.AmzSecurityTokenKey] = append(headers[v4Internal.AmzSecurityTokenKey][:0], s.Credentials.SessionToken) } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go index 26d90719..8d7c35a9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go @@ -1,13 +1,16 @@ package http import ( + "context" "crypto/tls" - "github.com/aws/aws-sdk-go-v2/aws" "net" "net/http" "reflect" "sync" "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/tracing" ) // Defaults for the HTTPTransportBuilder. @@ -179,7 +182,7 @@ func defaultHTTPTransport() *http.Transport { tr := &http.Transport{ Proxy: http.ProxyFromEnvironment, - DialContext: dialer.DialContext, + DialContext: traceDialContext(dialer.DialContext), TLSHandshakeTimeout: DefaultHTTPTransportTLSHandleshakeTimeout, MaxIdleConns: DefaultHTTPTransportMaxIdleConns, MaxIdleConnsPerHost: DefaultHTTPTransportMaxIdleConnsPerHost, @@ -194,6 +197,35 @@ func defaultHTTPTransport() *http.Transport { return tr } +type dialContext func(ctx context.Context, network, addr string) (net.Conn, error) + +func traceDialContext(dc dialContext) dialContext { + return func(ctx context.Context, network, addr string) (net.Conn, error) { + span, _ := tracing.GetSpan(ctx) + span.SetProperty("net.peer.name", addr) + + conn, err := dc(ctx, network, addr) + if err != nil { + return conn, err + } + + raddr := conn.RemoteAddr() + if raddr == nil { + return conn, err + } + + host, port, err := net.SplitHostPort(raddr.String()) + if err != nil { // don't blow up just because we couldn't parse + span.SetProperty("net.peer.addr", raddr.String()) + } else { + span.SetProperty("net.peer.host", host) + span.SetProperty("net.peer.port", port) + } + + return conn, err + } +} + // shallowCopyStruct creates a shallow copy of the passed in source struct, and // returns that copy of the same struct type. func shallowCopyStruct(src interface{}) interface{} { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go index 8fd14cec..a1ad20fe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.go @@ -12,18 +12,20 @@ import ( func AddResponseErrorMiddleware(stack *middleware.Stack) error { // add error wrapper middleware before request id retriever middleware so that it can wrap the error response // returned by operation deserializers - return stack.Deserialize.Insert(&responseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + return stack.Deserialize.Insert(&ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) } -type responseErrorWrapper struct { +// ResponseErrorWrapper wraps operation errors with ResponseError. +type ResponseErrorWrapper struct { } // ID returns the middleware identifier -func (m *responseErrorWrapper) ID() string { +func (m *ResponseErrorWrapper) ID() string { return "ResponseErrorWrapper" } -func (m *responseErrorWrapper) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +// HandleDeserialize wraps the stack error with smithyhttp.ResponseError. +func (m *ResponseErrorWrapper) 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) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md new file mode 100644 index 00000000..52b2856c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -0,0 +1,777 @@ +# v1.28.7 (2024-12-19) + +* **Bug Fix**: Fix improper use of printf-style functions. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.4 (2024-11-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.3 (2024-11-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.2 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.1 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2024-10-16) + +* **Feature**: Adds the LoadOptions hook `WithBaseEndpoint` for setting global endpoint override in-code. + +# v1.27.43 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.42 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.41 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.40 (2024-10-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.39 (2024-09-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.38 (2024-09-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.37 (2024-09-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.36 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.35 (2024-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.34 (2024-09-16) + +* **Bug Fix**: Read `AWS_CONTAINER_CREDENTIALS_FULL_URI` env variable if set when reading a profile with `credential_source`. Also ensure `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is always read before it + +# v1.27.33 (2024-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.32 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.31 (2024-08-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.30 (2024-08-23) + +* **Bug Fix**: Don't fail credentials unit tests if credentials are found on a file + +# v1.27.29 (2024-08-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.28 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.27 (2024-07-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.26 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.25 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.24 (2024-07-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.23 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.22 (2024-06-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.21 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.20 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.19 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.18 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.17 (2024-06-03) + +* **Documentation**: Add deprecation docs to global endpoint resolution interfaces. These APIs were previously deprecated with the introduction of service-specific endpoint resolution (EndpointResolverV2 and BaseEndpoint on service client options). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.16 (2024-05-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.15 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.14 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.13 (2024-05-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.12 (2024-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.11 (2024-04-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.10 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.9 (2024-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.8 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.7 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.6 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.5 (2024-03-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.4 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.3 (2024-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.1 (2024-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.6 (2024-01-22) + +* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.5 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.4 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2023-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-12-07) + +* **Feature**: Support modeled request compression. The only algorithm supported at this time is `gzip`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.12 (2023-12-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.11 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.10 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.9 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.8 (2023-11-28.3) + +* **Bug Fix**: Correct resolution of S3Express auth disable toggle. + +# v1.25.7 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.6 (2023-11-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2023-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.2 (2023-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-14) + +* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2023-11-13) + +* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2023-11-09.2) + +* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.3 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.2 (2023-11-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.1 (2023-11-06) + +* No change notes available for this release. + +# v1.22.0 (2023-11-02) + +* **Feature**: Add env and shared config settings for disabling IMDSv1 fallback. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-10-24) + +* No change notes available for this release. + +# v1.19.0 (2023-10-16) + +* **Feature**: Modify logic of retrieving user agent appID from env config + +# v1.18.45 (2023-10-12) + +* **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.43 (2023-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.42 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.41 (2023-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.40 (2023-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.39 (2023-09-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.38 (2023-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.37 (2023-08-23) + +* No change notes available for this release. + +# v1.18.36 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.35 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.34 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.33 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.32 (2023-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.31 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.30 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.29 (2023-07-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.28 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.27 (2023-06-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.26 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.25 (2023-05-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.24 (2023-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.23 (2023-05-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.22 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.21 (2023-04-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.20 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.19 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.18 (2023-03-16) + +* **Bug Fix**: Allow RoleARN to be set as functional option on STS WebIdentityRoleOptions. Fixes aws/aws-sdk-go-v2#2015. + +# v1.18.17 (2023-03-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.16 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.15 (2023-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.14 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.13 (2023-02-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.12 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.11 (2023-02-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.10 (2023-01-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.9 (2023-01-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.8 (2023-01-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2022-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.6 (2022-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2022-12-15) + +* **Bug Fix**: Unify logic between shared config and in finding home directory +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2022-11-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2022-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2022-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2022-11-11) + +* **Announcement**: When using the SSOTokenProvider, a previous implementation incorrectly compensated for invalid SSOTokenProvider configurations in the shared profile. This has been fixed via PR #1903 and tracked in issue #1846 +* **Feature**: Adds token refresh support (via SSOTokenProvider) when using the SSOCredentialProvider +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.11 (2022-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.10 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.9 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.8 (2022-09-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.7 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2022-08-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2022-08-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2022-08-14) + +* **Feature**: Add alternative mechanism for determning the users `$HOME` or `%USERPROFILE%` location when the environment variables are not present. + +# v1.16.1 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-08-10) + +* **Feature**: Adds support for the following settings in the `~/.aws/credentials` file: `sso_account_id`, `sso_region`, `sso_role_name`, `sso_start_url`, and `ca_bundle`. + +# v1.15.17 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.16 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.15 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2022-07-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2022-06-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.10 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2022-05-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.8 (2022-05-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.6 (2022-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2022-05-09) + +* **Bug Fix**: Fixes a bug in LoadDefaultConfig to correctly assign ConfigSources so all config resolvers have access to the config sources. This fixes the feature/ec2/imds client not having configuration applied via config.LoadOptions such as EC2IMDSClientEnableState. PR [#1682](https://github.com/aws/aws-sdk-go-v2/pull/1682) + +# v1.15.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-02-24) + +* **Feature**: Adds support for loading RetryMaxAttempts and RetryMod from the environment and shared configuration files. These parameters drive how the SDK's API client will initialize its default retryer, if custome retryer has not been specified. See [config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config) module and [aws.Config](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Config) for more information about and how to use these new options. +* **Feature**: Adds support for the `ca_bundle` parameter in shared config and credentials files. The usage of the file is the same as environment variable, `AWS_CA_BUNDLE`, but sourced from shared config. Fixes [#1589](https://github.com/aws/aws-sdk-go-v2/issues/1589) +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-01-28) + +* **Bug Fix**: Fixes LoadDefaultConfig handling of errors returned by passed in functional options. Previously errors returned from the LoadOptions passed into LoadDefaultConfig were incorrectly ignored. [#1562](https://github.com/aws/aws-sdk-go-v2/pull/1562). Thanks to [Pinglei Guo](https://github.com/pingleig) for submitting this PR. +* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. +* **Bug Fix**: Updates `config` module to use os.UserHomeDir instead of hard coded environment variable for OS. [#1563](https://github.com/aws/aws-sdk-go-v2/pull/1563) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-01-07) + +* **Feature**: Add load option for CredentialCache. Adds a new member to the LoadOptions struct, CredentialsCacheOptions. This member allows specifying a function that will be used to configure the CredentialsCache. The CredentialsCacheOptions will only be used if the configuration loader will wrap the underlying credential provider in the CredentialsCache. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2021-12-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-12-02) + +* **Feature**: Add support for specifying `EndpointResolverWithOptions` on `LoadOptions`, and associated `WithEndpointResolverWithOptions`. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2021-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.2 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.1 (2021-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.3 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-09-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-09-02) + +* **Feature**: Add support for S3 Multi-Region Access Point ARNs. + +# v1.7.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-07-15) + +* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-07-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-06-25) + +* **Feature**: Adds configuration setting for enabling endpoint discovery. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-05-20) + +* **Feature**: SSO credentials can now be defined alongside other credential providers within the same configuration profile. +* **Bug Fix**: Profile names were incorrectly normalized to lower-case, which could result in unexpected profile configurations. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go new file mode 100644 index 00000000..d5226cb0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go @@ -0,0 +1,222 @@ +package config + +import ( + "context" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +// defaultAWSConfigResolvers are a slice of functions that will resolve external +// configuration values into AWS configuration values. +// +// This will setup the AWS configuration's Region, +var defaultAWSConfigResolvers = []awsConfigResolver{ + // Resolves the default configuration the SDK's aws.Config will be + // initialized with. + resolveDefaultAWSConfig, + + // Sets the logger to be used. Could be user provided logger, and client + // logging mode. + resolveLogger, + resolveClientLogMode, + + // Sets the HTTP client and configuration to use for making requests using + // the HTTP transport. + resolveHTTPClient, + resolveCustomCABundle, + + // Sets the endpoint resolving behavior the API Clients will use for making + // requests to. Clients default to their own clients this allows overrides + // to be specified. The resolveEndpointResolver option is deprecated, but + // we still need to set it for backwards compatibility on config + // construction. + resolveEndpointResolver, + resolveEndpointResolverWithOptions, + + // Sets the retry behavior API clients will use within their retry attempt + // middleware. Defaults to unset, allowing API clients to define their own + // retry behavior. + resolveRetryer, + + // Sets the region the API Clients should use for making requests to. + resolveRegion, + resolveEC2IMDSRegion, + resolveDefaultRegion, + + // Sets the additional set of middleware stack mutators that will custom + // API client request pipeline middleware. + resolveAPIOptions, + + // Resolves the DefaultsMode that should be used by SDK clients. If this + // mode is set to DefaultsModeAuto. + // + // Comes after HTTPClient and CustomCABundle to ensure the HTTP client is + // configured if provided before invoking IMDS if mode is auto. Comes + // before resolving credentials so that those subsequent clients use the + // configured auto mode. + resolveDefaultsModeOptions, + + // Sets the resolved credentials the API clients will use for + // authentication. Provides the SDK's default credential chain. + // + // Should probably be the last step in the resolve chain to ensure that all + // other configurations are resolved first in case downstream credentials + // implementations depend on or can be configured with earlier resolved + // configuration options. + resolveCredentials, + + // Sets the resolved bearer authentication token API clients will use for + // httpBearerAuth authentication scheme. + resolveBearerAuthToken, + + // Sets the sdk app ID if present in env var or shared config profile + resolveAppID, + + resolveBaseEndpoint, + + // Sets the DisableRequestCompression if present in env var or shared config profile + resolveDisableRequestCompression, + + // Sets the RequestMinCompressSizeBytes if present in env var or shared config profile + resolveRequestMinCompressSizeBytes, + + // Sets the AccountIDEndpointMode if present in env var or shared config profile + resolveAccountIDEndpointMode, +} + +// A Config represents a generic configuration value or set of values. This type +// will be used by the AWSConfigResolvers to extract +// +// General the Config type will use type assertion against the Provider interfaces +// to extract specific data from the Config. +type Config interface{} + +// A loader is used to load external configuration data and returns it as +// a generic Config type. +// +// The loader should return an error if it fails to load the external configuration +// or the configuration data is malformed, or required components missing. +type loader func(context.Context, configs) (Config, error) + +// An awsConfigResolver will extract configuration data from the configs slice +// using the provider interfaces to extract specific functionality. The extracted +// configuration values will be written to the AWS Config value. +// +// The resolver should return an error if it it fails to extract the data, the +// data is malformed, or incomplete. +type awsConfigResolver func(ctx context.Context, cfg *aws.Config, configs configs) error + +// configs is a slice of Config values. These values will be used by the +// AWSConfigResolvers to extract external configuration values to populate the +// AWS Config type. +// +// Use AppendFromLoaders to add additional external Config values that are +// loaded from external sources. +// +// Use ResolveAWSConfig after external Config values have been added or loaded +// to extract the loaded configuration values into the AWS Config. +type configs []Config + +// AppendFromLoaders iterates over the slice of loaders passed in calling each +// loader function in order. The external config value returned by the loader +// will be added to the returned configs slice. +// +// If a loader returns an error this method will stop iterating and return +// that error. +func (cs configs) AppendFromLoaders(ctx context.Context, loaders []loader) (configs, error) { + for _, fn := range loaders { + cfg, err := fn(ctx, cs) + if err != nil { + return nil, err + } + + cs = append(cs, cfg) + } + + return cs, nil +} + +// ResolveAWSConfig returns a AWS configuration populated with values by calling +// the resolvers slice passed in. Each resolver is called in order. Any resolver +// may overwrite the AWS Configuration value of a previous resolver. +// +// If an resolver returns an error this method will return that error, and stop +// iterating over the resolvers. +func (cs configs) ResolveAWSConfig(ctx context.Context, resolvers []awsConfigResolver) (aws.Config, error) { + var cfg aws.Config + + for _, fn := range resolvers { + if err := fn(ctx, &cfg, cs); err != nil { + return aws.Config{}, err + } + } + + return cfg, nil +} + +// ResolveConfig calls the provide function passing slice of configuration sources. +// This implements the aws.ConfigResolver interface. +func (cs configs) ResolveConfig(f func(configs []interface{}) error) error { + var cfgs []interface{} + for i := range cs { + cfgs = append(cfgs, cs[i]) + } + return f(cfgs) +} + +// LoadDefaultConfig reads the SDK's default external configurations, and +// populates an AWS Config with the values from the external configurations. +// +// An optional variadic set of additional Config values can be provided as input +// that will be prepended to the configs slice. Use this to add custom configuration. +// The custom configurations must satisfy the respective providers for their data +// or the custom data will be ignored by the resolvers and config loaders. +// +// cfg, err := config.LoadDefaultConfig( context.TODO(), +// config.WithSharedConfigProfile("test-profile"), +// ) +// if err != nil { +// panic(fmt.Sprintf("failed loading config, %v", err)) +// } +// +// The default configuration sources are: +// * Environment Variables +// * Shared Configuration and Shared Credentials files. +func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (cfg aws.Config, err error) { + var options LoadOptions + for _, optFn := range optFns { + if err := optFn(&options); err != nil { + return aws.Config{}, err + } + } + + // assign Load Options to configs + var cfgCpy = configs{options} + + cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options)) + if err != nil { + return aws.Config{}, err + } + + cfg, err = cfgCpy.ResolveAWSConfig(ctx, defaultAWSConfigResolvers) + if err != nil { + return aws.Config{}, err + } + + return cfg, nil +} + +func resolveConfigLoaders(options *LoadOptions) []loader { + loaders := make([]loader, 2) + loaders[0] = loadEnvConfig + + // specification of a profile should cause a load failure if it doesn't exist + if os.Getenv(awsProfileEnvVar) != "" || options.SharedConfigProfile != "" { + loaders[1] = loadSharedConfig + } else { + loaders[1] = loadSharedConfigIgnoreNotExist + } + + return loaders +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go b/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go new file mode 100644 index 00000000..20b66367 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.go @@ -0,0 +1,47 @@ +package config + +import ( + "context" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" +) + +const execEnvVar = "AWS_EXECUTION_ENV" + +// DefaultsModeOptions is the set of options that are used to configure +type DefaultsModeOptions struct { + // The SDK configuration defaults mode. Defaults to legacy if not specified. + // + // Supported modes are: auto, cross-region, in-region, legacy, mobile, standard + Mode aws.DefaultsMode + + // The EC2 Instance Metadata Client that should be used when performing environment + // discovery when aws.DefaultsModeAuto is set. + // + // If not specified the SDK will construct a client if the instance metadata service has not been disabled by + // the AWS_EC2_METADATA_DISABLED environment variable. + IMDSClient *imds.Client +} + +func resolveDefaultsModeRuntimeEnvironment(ctx context.Context, envConfig *EnvConfig, client *imds.Client) (aws.RuntimeEnvironment, error) { + getRegionOutput, err := client.GetRegion(ctx, &imds.GetRegionInput{}) + // honor context timeouts, but if we couldn't talk to IMDS don't fail runtime environment introspection. + select { + case <-ctx.Done(): + return aws.RuntimeEnvironment{}, err + default: + } + + var imdsRegion string + if err == nil { + imdsRegion = getRegionOutput.Region + } + + return aws.RuntimeEnvironment{ + EnvironmentIdentifier: aws.ExecutionEnvironmentID(os.Getenv(execEnvVar)), + Region: envConfig.Region, + EC2InstanceMetadataRegion: imdsRegion, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go new file mode 100644 index 00000000..aab7164e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/doc.go @@ -0,0 +1,20 @@ +// Package config provides utilities for loading configuration from multiple +// sources that can be used to configure the SDK's API clients, and utilities. +// +// The config package will load configuration from environment variables, AWS +// shared configuration file (~/.aws/config), and AWS shared credentials file +// (~/.aws/credentials). +// +// Use the LoadDefaultConfig to load configuration from all the SDK's supported +// sources, and resolve credentials using the SDK's default credential chain. +// +// LoadDefaultConfig allows for a variadic list of additional Config sources that can +// provide one or more configuration values which can be used to programmatically control the resolution +// of a specific value, or allow for broader range of additional configuration sources not supported by the SDK. +// A Config source implements one or more provider interfaces defined in this package. Config sources passed in will +// take precedence over the default environment and shared config sources used by the SDK. If one or more Config sources +// implement the same provider interface, priority will be handled by the order in which the sources were passed in. +// +// A number of helpers (prefixed by “With“) are provided in this package that implement their respective provider +// interface. These helpers should be used for overriding configuration programmatically at runtime. +package config diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go new file mode 100644 index 00000000..3a06f141 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go @@ -0,0 +1,856 @@ +package config + +import ( + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "os" + "strconv" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" +) + +// CredentialsSourceName provides a name of the provider when config is +// loaded from environment. +const CredentialsSourceName = "EnvConfigCredentials" + +// Environment variables that will be read for configuration values. +const ( + awsAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID" + awsAccessKeyEnvVar = "AWS_ACCESS_KEY" + + awsSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY" + awsSecretKeyEnvVar = "AWS_SECRET_KEY" + + awsSessionTokenEnvVar = "AWS_SESSION_TOKEN" + + awsContainerCredentialsEndpointEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" + awsContainerCredentialsRelativePathEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" + awsContainerPProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN" + + awsRegionEnvVar = "AWS_REGION" + awsDefaultRegionEnvVar = "AWS_DEFAULT_REGION" + + awsProfileEnvVar = "AWS_PROFILE" + awsDefaultProfileEnvVar = "AWS_DEFAULT_PROFILE" + + awsSharedCredentialsFileEnvVar = "AWS_SHARED_CREDENTIALS_FILE" + + awsConfigFileEnvVar = "AWS_CONFIG_FILE" + + awsCustomCABundleEnvVar = "AWS_CA_BUNDLE" + + awsWebIdentityTokenFilePathEnvVar = "AWS_WEB_IDENTITY_TOKEN_FILE" + + awsRoleARNEnvVar = "AWS_ROLE_ARN" + awsRoleSessionNameEnvVar = "AWS_ROLE_SESSION_NAME" + + awsEnableEndpointDiscoveryEnvVar = "AWS_ENABLE_ENDPOINT_DISCOVERY" + + awsS3UseARNRegionEnvVar = "AWS_S3_USE_ARN_REGION" + + awsEc2MetadataServiceEndpointModeEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE" + + awsEc2MetadataServiceEndpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" + + awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataV1DisabledEnvVar = "AWS_EC2_METADATA_V1_DISABLED" + + awsS3DisableMultiRegionAccessPointEnvVar = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS" + + awsUseDualStackEndpoint = "AWS_USE_DUALSTACK_ENDPOINT" + + awsUseFIPSEndpoint = "AWS_USE_FIPS_ENDPOINT" + + awsDefaultMode = "AWS_DEFAULTS_MODE" + + awsRetryMaxAttempts = "AWS_MAX_ATTEMPTS" + awsRetryMode = "AWS_RETRY_MODE" + awsSdkAppID = "AWS_SDK_UA_APP_ID" + + awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" + awsEndpointURL = "AWS_ENDPOINT_URL" + + awsDisableRequestCompression = "AWS_DISABLE_REQUEST_COMPRESSION" + awsRequestMinCompressionSizeBytes = "AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES" + + awsS3DisableExpressSessionAuthEnv = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH" + + awsAccountIDEnv = "AWS_ACCOUNT_ID" + awsAccountIDEndpointModeEnv = "AWS_ACCOUNT_ID_ENDPOINT_MODE" +) + +var ( + credAccessEnvKeys = []string{ + awsAccessKeyIDEnvVar, + awsAccessKeyEnvVar, + } + credSecretEnvKeys = []string{ + awsSecretAccessKeyEnvVar, + awsSecretKeyEnvVar, + } + regionEnvKeys = []string{ + awsRegionEnvVar, + awsDefaultRegionEnvVar, + } + profileEnvKeys = []string{ + awsProfileEnvVar, + awsDefaultProfileEnvVar, + } +) + +// EnvConfig is a collection of environment values the SDK will read +// setup config from. All environment values are optional. But some values +// such as credentials require multiple values to be complete or the values +// will be ignored. +type EnvConfig struct { + // Environment configuration values. If set both Access Key ID and Secret Access + // Key must be provided. Session Token and optionally also be provided, but is + // not required. + // + // # Access Key ID + // AWS_ACCESS_KEY_ID=AKID + // AWS_ACCESS_KEY=AKID # only read if AWS_ACCESS_KEY_ID is not set. + // + // # Secret Access Key + // AWS_SECRET_ACCESS_KEY=SECRET + // AWS_SECRET_KEY=SECRET # only read if AWS_SECRET_ACCESS_KEY is not set. + // + // # Session Token + // AWS_SESSION_TOKEN=TOKEN + Credentials aws.Credentials + + // ContainerCredentialsEndpoint value is the HTTP enabled endpoint to retrieve credentials + // using the endpointcreds.Provider + ContainerCredentialsEndpoint string + + // ContainerCredentialsRelativePath is the relative URI path that will be used when attempting to retrieve + // credentials from the container endpoint. + ContainerCredentialsRelativePath string + + // ContainerAuthorizationToken is the authorization token that will be included in the HTTP Authorization + // header when attempting to retrieve credentials from the container credentials endpoint. + ContainerAuthorizationToken string + + // Region value will instruct the SDK where to make service API requests to. If is + // not provided in the environment the region must be provided before a service + // client request is made. + // + // AWS_REGION=us-west-2 + // AWS_DEFAULT_REGION=us-west-2 + Region string + + // Profile name the SDK should load use when loading shared configuration from the + // shared configuration files. If not provided "default" will be used as the + // profile name. + // + // AWS_PROFILE=my_profile + // AWS_DEFAULT_PROFILE=my_profile + SharedConfigProfile string + + // Shared credentials file path can be set to instruct the SDK to use an alternate + // file for the shared credentials. If not set the file will be loaded from + // $HOME/.aws/credentials on Linux/Unix based systems, and + // %USERPROFILE%\.aws\credentials on Windows. + // + // AWS_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials + SharedCredentialsFile string + + // Shared config file path can be set to instruct the SDK to use an alternate + // file for the shared config. If not set the file will be loaded from + // $HOME/.aws/config on Linux/Unix based systems, and + // %USERPROFILE%\.aws\config on Windows. + // + // AWS_CONFIG_FILE=$HOME/my_shared_config + SharedConfigFile string + + // Sets the path to a custom Credentials Authority (CA) Bundle PEM file + // that the SDK will use instead of the system's root CA bundle. + // Only use this if you want to configure the SDK to use a custom set + // of CAs. + // + // Enabling this option will attempt to merge the Transport + // into the SDK's HTTP client. If the client's Transport is + // not a http.Transport an error will be returned. If the + // Transport's TLS config is set this option will cause the + // SDK to overwrite the Transport's TLS config's RootCAs value. + // + // Setting a custom HTTPClient in the aws.Config options will override this setting. + // To use this option and custom HTTP client, the HTTP client needs to be provided + // when creating the config. Not the service client. + // + // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle + CustomCABundle string + + // Enables endpoint discovery via environment variables. + // + // AWS_ENABLE_ENDPOINT_DISCOVERY=true + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState + + // Specifies the WebIdentity token the SDK should use to assume a role + // with. + // + // AWS_WEB_IDENTITY_TOKEN_FILE=file_path + WebIdentityTokenFilePath string + + // Specifies the IAM role arn to use when assuming an role. + // + // AWS_ROLE_ARN=role_arn + RoleARN string + + // Specifies the IAM role session name to use when assuming a role. + // + // AWS_ROLE_SESSION_NAME=session_name + RoleSessionName string + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // AWS_S3_USE_ARN_REGION=true + S3UseARNRegion *bool + + // Specifies if the EC2 IMDS service client is enabled. + // + // AWS_EC2_METADATA_DISABLED=true + EC2IMDSClientEnableState imds.ClientEnableState + + // Specifies if EC2 IMDSv1 fallback is disabled. + // + // AWS_EC2_METADATA_V1_DISABLED=true + EC2IMDSv1Disabled *bool + + // Specifies the EC2 Instance Metadata Service default endpoint selection mode (IPv4 or IPv6) + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE=IPv6 + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EC2IMDSEndpointMode. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://fd00:ec2::254 + EC2IMDSEndpoint string + + // Specifies if the S3 service should disable multi-region access points + // support. + // + // AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS=true + S3DisableMultiRegionAccessPoints *bool + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + // + // AWS_USE_DUALSTACK_ENDPOINT=true + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + // + // AWS_USE_FIPS_ENDPOINT=true + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies the SDK Defaults Mode used by services. + // + // AWS_DEFAULTS_MODE=standard + DefaultsMode aws.DefaultsMode + + // Specifies the maximum number attempts an API client will call an + // operation that fails with a retryable error. + // + // AWS_MAX_ATTEMPTS=3 + RetryMaxAttempts int + + // Specifies the retry model the API client will be created with. + // + // aws_retry_mode=standard + RetryMode aws.RetryMode + + // aws sdk app ID that can be added to user agent header string + AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string + + // determine if request compression is allowed, default to false + // retrieved from env var AWS_DISABLE_REQUEST_COMPRESSION + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from env var AWS_REQUEST_MIN_COMPRESSION_SIZE_BYTES + RequestMinCompressSizeBytes *int64 + + // Whether S3Express auth is disabled. + // + // This will NOT prevent requests from being made to S3Express buckets, it + // will only bypass the modified endpoint routing and signing behaviors + // associated with the feature. + S3DisableExpressAuth *bool + + // Indicates whether account ID will be required/ignored in endpoint2.0 routing + AccountIDEndpointMode aws.AccountIDEndpointMode +} + +// loadEnvConfig reads configuration values from the OS's environment variables. +// Returning the a Config typed EnvConfig to satisfy the ConfigLoader func type. +func loadEnvConfig(ctx context.Context, cfgs configs) (Config, error) { + return NewEnvConfig() +} + +// NewEnvConfig retrieves the SDK's environment configuration. +// See `EnvConfig` for the values that will be retrieved. +func NewEnvConfig() (EnvConfig, error) { + var cfg EnvConfig + + creds := aws.Credentials{ + Source: CredentialsSourceName, + } + setStringFromEnvVal(&creds.AccessKeyID, credAccessEnvKeys) + setStringFromEnvVal(&creds.SecretAccessKey, credSecretEnvKeys) + if creds.HasKeys() { + creds.AccountID = os.Getenv(awsAccountIDEnv) + creds.SessionToken = os.Getenv(awsSessionTokenEnvVar) + cfg.Credentials = creds + } + + cfg.ContainerCredentialsEndpoint = os.Getenv(awsContainerCredentialsEndpointEnvVar) + cfg.ContainerCredentialsRelativePath = os.Getenv(awsContainerCredentialsRelativePathEnvVar) + cfg.ContainerAuthorizationToken = os.Getenv(awsContainerPProviderAuthorizationEnvVar) + + setStringFromEnvVal(&cfg.Region, regionEnvKeys) + setStringFromEnvVal(&cfg.SharedConfigProfile, profileEnvKeys) + + cfg.SharedCredentialsFile = os.Getenv(awsSharedCredentialsFileEnvVar) + cfg.SharedConfigFile = os.Getenv(awsConfigFileEnvVar) + + cfg.CustomCABundle = os.Getenv(awsCustomCABundleEnvVar) + + cfg.WebIdentityTokenFilePath = os.Getenv(awsWebIdentityTokenFilePathEnvVar) + + cfg.RoleARN = os.Getenv(awsRoleARNEnvVar) + cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvVar) + + cfg.AppID = os.Getenv(awsSdkAppID) + + if err := setBoolPtrFromEnvVal(&cfg.DisableRequestCompression, []string{awsDisableRequestCompression}); err != nil { + return cfg, err + } + if err := setInt64PtrFromEnvVal(&cfg.RequestMinCompressSizeBytes, []string{awsRequestMinCompressionSizeBytes}, smithyrequestcompression.MaxRequestMinCompressSizeBytes); err != nil { + return cfg, err + } + + if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil { + return cfg, err + } + + if err := setBoolPtrFromEnvVal(&cfg.S3UseARNRegion, []string{awsS3UseARNRegionEnvVar}); err != nil { + return cfg, err + } + + setEC2IMDSClientEnableState(&cfg.EC2IMDSClientEnableState, []string{awsEc2MetadataDisabled}) + if err := setEC2IMDSEndpointMode(&cfg.EC2IMDSEndpointMode, []string{awsEc2MetadataServiceEndpointModeEnvVar}); err != nil { + return cfg, err + } + cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnvVar) + if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnvVar}); err != nil { + return cfg, err + } + + if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointEnvVar}); err != nil { + return cfg, err + } + + if err := setUseDualStackEndpointFromEnvVal(&cfg.UseDualStackEndpoint, []string{awsUseDualStackEndpoint}); err != nil { + return cfg, err + } + + if err := setUseFIPSEndpointFromEnvVal(&cfg.UseFIPSEndpoint, []string{awsUseFIPSEndpoint}); err != nil { + return cfg, err + } + + if err := setDefaultsModeFromEnvVal(&cfg.DefaultsMode, []string{awsDefaultMode}); err != nil { + return cfg, err + } + + if err := setIntFromEnvVal(&cfg.RetryMaxAttempts, []string{awsRetryMaxAttempts}); err != nil { + return cfg, err + } + if err := setRetryModeFromEnvVal(&cfg.RetryMode, []string{awsRetryMode}); err != nil { + return cfg, err + } + + setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL}) + + if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil { + return cfg, err + } + + if err := setBoolPtrFromEnvVal(&cfg.S3DisableExpressAuth, []string{awsS3DisableExpressSessionAuthEnv}); err != nil { + return cfg, err + } + + if err := setAIDEndPointModeFromEnvVal(&cfg.AccountIDEndpointMode, []string{awsAccountIDEndpointModeEnv}); err != nil { + return cfg, err + } + + return cfg, nil +} + +func (c EnvConfig) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { + if len(c.DefaultsMode) == 0 { + return "", false, nil + } + return c.DefaultsMode, true, nil +} + +func (c EnvConfig) getAppID(context.Context) (string, bool, error) { + return c.AppID, len(c.AppID) > 0, nil +} + +func (c EnvConfig) getDisableRequestCompression(context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + +func (c EnvConfig) getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + +func (c EnvConfig) getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error) { + return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil +} + +// GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, +// and not 0. +func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if c.RetryMaxAttempts == 0 { + return 0, false, nil + } + return c.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the RetryMode of AWS_RETRY_MODE if was specified, and a +// valid value. +func (c EnvConfig) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if len(c.RetryMode) == 0 { + return "", false, nil + } + return c.RetryMode, true, nil +} + +func setEC2IMDSClientEnableState(state *imds.ClientEnableState, keys []string) { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + switch { + case strings.EqualFold(value, "true"): + *state = imds.ClientDisabled + case strings.EqualFold(value, "false"): + *state = imds.ClientEnabled + default: + continue + } + break + } +} + +func setDefaultsModeFromEnvVal(mode *aws.DefaultsMode, keys []string) error { + for _, k := range keys { + if value := os.Getenv(k); len(value) > 0 { + if ok := mode.SetFromString(value); !ok { + return fmt.Errorf("invalid %s value: %s", k, value) + } + break + } + } + return nil +} + +func setRetryModeFromEnvVal(mode *aws.RetryMode, keys []string) (err error) { + for _, k := range keys { + if value := os.Getenv(k); len(value) > 0 { + *mode, err = aws.ParseRetryMode(value) + if err != nil { + return fmt.Errorf("invalid %s value, %w", k, err) + } + break + } + } + return nil +} + +func setEC2IMDSEndpointMode(mode *imds.EndpointModeState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + if err := mode.SetFromString(value); err != nil { + return fmt.Errorf("invalid value for environment variable, %s=%s, %v", k, value, err) + } + } + return nil +} + +func setAIDEndPointModeFromEnvVal(m *aws.AccountIDEndpointMode, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + + switch value { + case "preferred": + *m = aws.AccountIDEndpointModePreferred + case "required": + *m = aws.AccountIDEndpointModeRequired + case "disabled": + *m = aws.AccountIDEndpointModeDisabled + default: + return fmt.Errorf("invalid value for environment variable, %s=%s, must be preferred/required/disabled", k, value) + } + break + } + return nil +} + +// GetRegion returns the AWS Region if set in the environment. Returns an empty +// string if not set. +func (c EnvConfig) getRegion(ctx context.Context) (string, bool, error) { + if len(c.Region) == 0 { + return "", false, nil + } + return c.Region, true, nil +} + +// GetSharedConfigProfile returns the shared config profile if set in the +// environment. Returns an empty string if not set. +func (c EnvConfig) getSharedConfigProfile(ctx context.Context) (string, bool, error) { + if len(c.SharedConfigProfile) == 0 { + return "", false, nil + } + + return c.SharedConfigProfile, true, nil +} + +// getSharedConfigFiles returns a slice of filenames set in the environment. +// +// Will return the filenames in the order of: +// * Shared Config +func (c EnvConfig) getSharedConfigFiles(context.Context) ([]string, bool, error) { + var files []string + if v := c.SharedConfigFile; len(v) > 0 { + files = append(files, v) + } + + if len(files) == 0 { + return nil, false, nil + } + return files, true, nil +} + +// getSharedCredentialsFiles returns a slice of filenames set in the environment. +// +// Will return the filenames in the order of: +// * Shared Credentials +func (c EnvConfig) getSharedCredentialsFiles(context.Context) ([]string, bool, error) { + var files []string + if v := c.SharedCredentialsFile; len(v) > 0 { + files = append(files, v) + } + if len(files) == 0 { + return nil, false, nil + } + return files, true, nil +} + +// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was +func (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { + if len(c.CustomCABundle) == 0 { + return nil, false, nil + } + + b, err := ioutil.ReadFile(c.CustomCABundle) + if err != nil { + return nil, false, err + } + return bytes.NewReader(b), true, nil +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c EnvConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURL, normalizeEnv(sdkID))); endpt != "" { + return endpt, true, nil + } + return "", false, nil +} + +func normalizeEnv(sdkID string) string { + upper := strings.ToUpper(sdkID) + return strings.ReplaceAll(upper, " ", "_") +} + +// GetS3UseARNRegion returns whether to allow ARNs to direct the region +// the S3 client's requests are sent to. +func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { + if c.S3UseARNRegion == nil { + return false, false, nil + } + + return *c.S3UseARNRegion, true, nil +} + +// GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point +// support for the S3 client. +func (c EnvConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { + if c.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + + return *c.S3DisableMultiRegionAccessPoints, true, nil +} + +// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be +// used for requests. +func (c EnvConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { + if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + + return c.UseDualStackEndpoint, true, nil +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (c EnvConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + + return c.UseFIPSEndpoint, true, nil +} + +func setStringFromEnvVal(dst *string, keys []string) { + for _, k := range keys { + if v := os.Getenv(k); len(v) > 0 { + *dst = v + break + } + } +} + +func setIntFromEnvVal(dst *int, keys []string) error { + for _, k := range keys { + if v := os.Getenv(k); len(v) > 0 { + i, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return fmt.Errorf("invalid value %s=%s, %w", k, v, err) + } + *dst = int(i) + break + } + } + + return nil +} + +func setBoolPtrFromEnvVal(dst **bool, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + + if *dst == nil { + *dst = new(bool) + } + + switch { + case strings.EqualFold(value, "false"): + **dst = false + case strings.EqualFold(value, "true"): + **dst = true + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true or false", + k, value) + } + break + } + + return nil +} + +func setInt64PtrFromEnvVal(dst **int64, keys []string, max int64) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue + } + + v, err := strconv.ParseInt(value, 10, 64) + if err != nil { + return fmt.Errorf("invalid value for env var, %s=%s, need int64", k, value) + } else if v < 0 || v > max { + return fmt.Errorf("invalid range for env var min request compression size bytes %q, must be within 0 and 10485760 inclusively", v) + } + if *dst == nil { + *dst = new(int64) + } + + **dst = v + break + } + + return nil +} + +func setEndpointDiscoveryTypeFromEnvVal(dst *aws.EndpointDiscoveryEnableState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, endpointDiscoveryDisabled): + *dst = aws.EndpointDiscoveryDisabled + case strings.EqualFold(value, endpointDiscoveryEnabled): + *dst = aws.EndpointDiscoveryEnabled + case strings.EqualFold(value, endpointDiscoveryAuto): + *dst = aws.EndpointDiscoveryAuto + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false or auto", + k, value) + } + } + return nil +} + +func setUseDualStackEndpointFromEnvVal(dst *aws.DualStackEndpointState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, "true"): + *dst = aws.DualStackEndpointStateEnabled + case strings.EqualFold(value, "false"): + *dst = aws.DualStackEndpointStateDisabled + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false", + k, value) + } + } + return nil +} + +func setUseFIPSEndpointFromEnvVal(dst *aws.FIPSEndpointState, keys []string) error { + for _, k := range keys { + value := os.Getenv(k) + if len(value) == 0 { + continue // skip if empty + } + + switch { + case strings.EqualFold(value, "true"): + *dst = aws.FIPSEndpointStateEnabled + case strings.EqualFold(value, "false"): + *dst = aws.FIPSEndpointStateDisabled + default: + return fmt.Errorf( + "invalid value for environment variable, %s=%s, need true, false", + k, value) + } + } + return nil +} + +// GetEnableEndpointDiscovery returns resolved value for EnableEndpointDiscovery env variable setting. +func (c EnvConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, found bool, err error) { + if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + + return c.EnableEndpointDiscovery, true, nil +} + +// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. +func (c EnvConfig) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { + if c.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { + return imds.ClientDefaultEnableState, false, nil + } + + return c.EC2IMDSClientEnableState, true, nil +} + +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (c EnvConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return c.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) { + if len(c.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + return c.EC2IMDSEndpoint, true, nil +} + +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c EnvConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} + +// GetS3DisableExpressAuth returns the configured value for +// [EnvConfig.S3DisableExpressAuth]. +func (c EnvConfig) GetS3DisableExpressAuth() (value, ok bool) { + if c.S3DisableExpressAuth == nil { + return false, false + } + + return *c.S3DisableExpressAuth, true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go b/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go new file mode 100644 index 00000000..654a7a77 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/generate.go @@ -0,0 +1,4 @@ +package config + +//go:generate go run -tags codegen ./codegen -output=provider_assert_test.go +//go:generate gofmt -s -w ./ diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go new file mode 100644 index 00000000..56fb062c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package config + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.28.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go new file mode 100644 index 00000000..dc6c7d29 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go @@ -0,0 +1,1174 @@ +package config + +import ( + "context" + "io" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" + "github.com/aws/aws-sdk-go-v2/credentials/processcreds" + "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + smithybearer "github.com/aws/smithy-go/auth/bearer" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" +) + +// LoadOptionsFunc is a type alias for LoadOptions functional option +type LoadOptionsFunc func(*LoadOptions) error + +// LoadOptions are discrete set of options that are valid for loading the +// configuration +type LoadOptions struct { + + // Region is the region to send requests to. + Region string + + // Credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // Token provider for authentication operations with bearer authentication. + BearerAuthTokenProvider smithybearer.TokenProvider + + // HTTPClient the SDK's API clients will use to invoke HTTP requests. + HTTPClient HTTPClient + + // EndpointResolver that can be used to provide or override an endpoint for + // the given service and region. + // + // See the `aws.EndpointResolver` documentation on usage. + // + // Deprecated: See EndpointResolverWithOptions + EndpointResolver aws.EndpointResolver + + // EndpointResolverWithOptions that can be used to provide or override an + // endpoint for the given service and region. + // + // See the `aws.EndpointResolverWithOptions` documentation on usage. + EndpointResolverWithOptions aws.EndpointResolverWithOptions + + // RetryMaxAttempts specifies the maximum number attempts an API client + // will call an operation that fails with a retryable error. + // + // This value will only be used if Retryer option is nil. + RetryMaxAttempts int + + // RetryMode specifies the retry model the API client will be created with. + // + // This value will only be used if Retryer option is nil. + RetryMode aws.RetryMode + + // Retryer is a function that provides a Retryer implementation. A Retryer + // guides how HTTP requests should be retried in case of recoverable + // failures. + // + // If not nil, RetryMaxAttempts, and RetryMode will be ignored. + Retryer func() aws.Retryer + + // APIOptions provides the set of middleware mutations modify how the API + // client requests will be handled. This is useful for adding additional + // tracing data to a request, or changing behavior of the SDK's client. + APIOptions []func(*middleware.Stack) error + + // Logger writer interface to write logging messages to. + Logger logging.Logger + + // ClientLogMode is used to configure the events that will be sent to the + // configured logger. This can be used to configure the logging of signing, + // retries, request, and responses of the SDK clients. + // + // See the ClientLogMode type documentation for the complete set of logging + // modes and available configuration. + ClientLogMode *aws.ClientLogMode + + // SharedConfigProfile is the profile to be used when loading the SharedConfig + SharedConfigProfile string + + // SharedConfigFiles is the slice of custom shared config files to use when + // loading the SharedConfig. A non-default profile used within config file + // must have name defined with prefix 'profile '. eg [profile xyz] + // indicates a profile with name 'xyz'. To read more on the format of the + // config file, please refer the documentation at + // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-config + // + // If duplicate profiles are provided within the same, or across multiple + // shared config files, the next parsed profile will override only the + // properties that conflict with the previously defined profile. Note that + // if duplicate profiles are provided within the SharedCredentialsFiles and + // SharedConfigFiles, the properties defined in shared credentials file + // take precedence. + SharedConfigFiles []string + + // SharedCredentialsFile is the slice of custom shared credentials files to + // use when loading the SharedConfig. The profile name used within + // credentials file must not prefix 'profile '. eg [xyz] indicates a + // profile with name 'xyz'. Profile declared as [profile xyz] will be + // ignored. To read more on the format of the credentials file, please + // refer the documentation at + // https://docs.aws.amazon.com/credref/latest/refdocs/file-format.html#file-format-creds + // + // If duplicate profiles are provided with a same, or across multiple + // shared credentials files, the next parsed profile will override only + // properties that conflict with the previously defined profile. Note that + // if duplicate profiles are provided within the SharedCredentialsFiles and + // SharedConfigFiles, the properties defined in shared credentials file + // take precedence. + SharedCredentialsFiles []string + + // CustomCABundle is CA bundle PEM bytes reader + CustomCABundle io.Reader + + // DefaultRegion is the fall back region, used if a region was not resolved + // from other sources + DefaultRegion string + + // UseEC2IMDSRegion indicates if SDK should retrieve the region + // from the EC2 Metadata service + UseEC2IMDSRegion *UseEC2IMDSRegion + + // CredentialsCacheOptions is a function for setting the + // aws.CredentialsCacheOptions + CredentialsCacheOptions func(*aws.CredentialsCacheOptions) + + // BearerAuthTokenCacheOptions is a function for setting the smithy-go + // auth/bearer#TokenCacheOptions + BearerAuthTokenCacheOptions func(*smithybearer.TokenCacheOptions) + + // SSOTokenProviderOptions is a function for setting the + // credentials/ssocreds.SSOTokenProviderOptions + SSOTokenProviderOptions func(*ssocreds.SSOTokenProviderOptions) + + // ProcessCredentialOptions is a function for setting + // the processcreds.Options + ProcessCredentialOptions func(*processcreds.Options) + + // EC2RoleCredentialOptions is a function for setting + // the ec2rolecreds.Options + EC2RoleCredentialOptions func(*ec2rolecreds.Options) + + // EndpointCredentialOptions is a function for setting + // the endpointcreds.Options + EndpointCredentialOptions func(*endpointcreds.Options) + + // WebIdentityRoleCredentialOptions is a function for setting + // the stscreds.WebIdentityRoleOptions + WebIdentityRoleCredentialOptions func(*stscreds.WebIdentityRoleOptions) + + // AssumeRoleCredentialOptions is a function for setting the + // stscreds.AssumeRoleOptions + AssumeRoleCredentialOptions func(*stscreds.AssumeRoleOptions) + + // SSOProviderOptions is a function for setting + // the ssocreds.Options + SSOProviderOptions func(options *ssocreds.Options) + + // LogConfigurationWarnings when set to true, enables logging + // configuration warnings + LogConfigurationWarnings *bool + + // S3UseARNRegion specifies if the S3 service should allow ARNs to direct + // the region, the client's requests are sent to. + S3UseARNRegion *bool + + // S3DisableMultiRegionAccessPoints specifies if the S3 service should disable + // the S3 Multi-Region access points feature. + S3DisableMultiRegionAccessPoints *bool + + // EnableEndpointDiscovery specifies if endpoint discovery is enable for + // the client. + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState + + // Specifies if the EC2 IMDS service client is enabled. + // + // AWS_EC2_METADATA_DISABLED=true + EC2IMDSClientEnableState imds.ClientEnableState + + // Specifies the EC2 Instance Metadata Service default endpoint selection + // mode (IPv4 or IPv6) + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If + // specified it overrides EC2IMDSEndpointMode. + EC2IMDSEndpoint string + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies the SDK configuration mode for defaults. + DefaultsModeOptions DefaultsModeOptions + + // The sdk app ID retrieved from env var or shared config to be added to request user agent header + AppID string + + // Specifies whether an operation request could be compressed + DisableRequestCompression *bool + + // The inclusive min bytes of a request body that could be compressed + RequestMinCompressSizeBytes *int64 + + // Whether S3 Express auth is disabled. + S3DisableExpressAuth *bool + + AccountIDEndpointMode aws.AccountIDEndpointMode + + // Service endpoint override. This value is not necessarily final and is + // passed to the service's EndpointResolverV2 for further delegation. + BaseEndpoint string +} + +func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) { + if len(o.DefaultsModeOptions.Mode) == 0 { + return "", false, nil + } + return o.DefaultsModeOptions.Mode, true, nil +} + +// GetRetryMaxAttempts returns the RetryMaxAttempts if specified in the +// LoadOptions and not 0. +func (o LoadOptions) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if o.RetryMaxAttempts == 0 { + return 0, false, nil + } + return o.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the RetryMode specified in the LoadOptions. +func (o LoadOptions) GetRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if len(o.RetryMode) == 0 { + return "", false, nil + } + return o.RetryMode, true, nil +} + +func (o LoadOptions) getDefaultsModeIMDSClient(ctx context.Context) (*imds.Client, bool, error) { + if o.DefaultsModeOptions.IMDSClient == nil { + return nil, false, nil + } + return o.DefaultsModeOptions.IMDSClient, true, nil +} + +// getRegion returns Region from config's LoadOptions +func (o LoadOptions) getRegion(ctx context.Context) (string, bool, error) { + if len(o.Region) == 0 { + return "", false, nil + } + + return o.Region, true, nil +} + +// getAppID returns AppID from config's LoadOptions +func (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) { + return o.AppID, len(o.AppID) > 0, nil +} + +// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions +func (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if o.DisableRequestCompression == nil { + return false, false, nil + } + return *o.DisableRequestCompression, true, nil +} + +// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions +func (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if o.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *o.RequestMinCompressSizeBytes, true, nil +} + +func (o LoadOptions) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) { + return o.AccountIDEndpointMode, len(o.AccountIDEndpointMode) > 0, nil +} + +func (o LoadOptions) getBaseEndpoint(context.Context) (string, bool, error) { + return o.BaseEndpoint, o.BaseEndpoint != "", nil +} + +// GetServiceBaseEndpoint satisfies (internal/configsources).ServiceBaseEndpointProvider. +// +// The sdkID value is unused because LoadOptions only supports setting a GLOBAL +// endpoint override. In-code, per-service endpoint overrides are performed via +// functional options in service client space. +func (o LoadOptions) GetServiceBaseEndpoint(context.Context, string) (string, bool, error) { + return o.BaseEndpoint, o.BaseEndpoint != "", nil +} + +// WithRegion is a helper function to construct functional options +// that sets Region on config's LoadOptions. Setting the region to +// an empty string, will result in the region value being ignored. +// If multiple WithRegion calls are made, the last call overrides +// the previous call values. +func WithRegion(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.Region = v + return nil + } +} + +// WithAppID is a helper function to construct functional options +// that sets AppID on config's LoadOptions. +func WithAppID(ID string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.AppID = ID + return nil + } +} + +// WithDisableRequestCompression is a helper function to construct functional options +// that sets DisableRequestCompression on config's LoadOptions. +func WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + if DisableRequestCompression == nil { + return nil + } + o.DisableRequestCompression = DisableRequestCompression + return nil + } +} + +// WithRequestMinCompressSizeBytes is a helper function to construct functional options +// that sets RequestMinCompressSizeBytes on config's LoadOptions. +func WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc { + return func(o *LoadOptions) error { + if RequestMinCompressSizeBytes == nil { + return nil + } + o.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes + return nil + } +} + +// WithAccountIDEndpointMode is a helper function to construct functional options +// that sets AccountIDEndpointMode on config's LoadOptions +func WithAccountIDEndpointMode(m aws.AccountIDEndpointMode) LoadOptionsFunc { + return func(o *LoadOptions) error { + if m != "" { + o.AccountIDEndpointMode = m + } + return nil + } +} + +// getDefaultRegion returns DefaultRegion from config's LoadOptions +func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) { + if len(o.DefaultRegion) == 0 { + return "", false, nil + } + + return o.DefaultRegion, true, nil +} + +// WithDefaultRegion is a helper function to construct functional options +// that sets a DefaultRegion on config's LoadOptions. Setting the default +// region to an empty string, will result in the default region value +// being ignored. If multiple WithDefaultRegion calls are made, the last +// call overrides the previous call values. Note that both WithRegion and +// WithEC2IMDSRegion call takes precedence over WithDefaultRegion call +// when resolving region. +func WithDefaultRegion(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.DefaultRegion = v + return nil + } +} + +// getSharedConfigProfile returns SharedConfigProfile from config's LoadOptions +func (o LoadOptions) getSharedConfigProfile(ctx context.Context) (string, bool, error) { + if len(o.SharedConfigProfile) == 0 { + return "", false, nil + } + + return o.SharedConfigProfile, true, nil +} + +// WithSharedConfigProfile is a helper function to construct functional options +// that sets SharedConfigProfile on config's LoadOptions. Setting the shared +// config profile to an empty string, will result in the shared config profile +// value being ignored. +// If multiple WithSharedConfigProfile calls are made, the last call overrides +// the previous call values. +func WithSharedConfigProfile(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SharedConfigProfile = v + return nil + } +} + +// getSharedConfigFiles returns SharedConfigFiles set on config's LoadOptions +func (o LoadOptions) getSharedConfigFiles(ctx context.Context) ([]string, bool, error) { + if o.SharedConfigFiles == nil { + return nil, false, nil + } + + return o.SharedConfigFiles, true, nil +} + +// WithSharedConfigFiles is a helper function to construct functional options +// that sets slice of SharedConfigFiles on config's LoadOptions. +// Setting the shared config files to an nil string slice, will result in the +// shared config files value being ignored. +// If multiple WithSharedConfigFiles calls are made, the last call overrides +// the previous call values. +func WithSharedConfigFiles(v []string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SharedConfigFiles = v + return nil + } +} + +// getSharedCredentialsFiles returns SharedCredentialsFiles set on config's LoadOptions +func (o LoadOptions) getSharedCredentialsFiles(ctx context.Context) ([]string, bool, error) { + if o.SharedCredentialsFiles == nil { + return nil, false, nil + } + + return o.SharedCredentialsFiles, true, nil +} + +// WithSharedCredentialsFiles is a helper function to construct functional options +// that sets slice of SharedCredentialsFiles on config's LoadOptions. +// Setting the shared credentials files to an nil string slice, will result in the +// shared credentials files value being ignored. +// If multiple WithSharedCredentialsFiles calls are made, the last call overrides +// the previous call values. +func WithSharedCredentialsFiles(v []string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SharedCredentialsFiles = v + return nil + } +} + +// getCustomCABundle returns CustomCABundle from LoadOptions +func (o LoadOptions) getCustomCABundle(ctx context.Context) (io.Reader, bool, error) { + if o.CustomCABundle == nil { + return nil, false, nil + } + + return o.CustomCABundle, true, nil +} + +// WithCustomCABundle is a helper function to construct functional options +// that sets CustomCABundle on config's LoadOptions. Setting the custom CA Bundle +// to nil will result in custom CA Bundle value being ignored. +// If multiple WithCustomCABundle calls are made, the last call overrides the +// previous call values. +func WithCustomCABundle(v io.Reader) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.CustomCABundle = v + return nil + } +} + +// UseEC2IMDSRegion provides a regionProvider that retrieves the region +// from the EC2 Metadata service. +type UseEC2IMDSRegion struct { + // If unset will default to generic EC2 IMDS client. + Client *imds.Client +} + +// getRegion attempts to retrieve the region from EC2 Metadata service. +func (p *UseEC2IMDSRegion) getRegion(ctx context.Context) (string, bool, error) { + if ctx == nil { + ctx = context.Background() + } + + client := p.Client + if client == nil { + client = imds.New(imds.Options{}) + } + + result, err := client.GetRegion(ctx, nil) + if err != nil { + return "", false, err + } + if len(result.Region) != 0 { + return result.Region, true, nil + } + return "", false, nil +} + +// getEC2IMDSRegion returns the value of EC2 IMDS region. +func (o LoadOptions) getEC2IMDSRegion(ctx context.Context) (string, bool, error) { + if o.UseEC2IMDSRegion == nil { + return "", false, nil + } + + return o.UseEC2IMDSRegion.getRegion(ctx) +} + +// WithEC2IMDSRegion is a helper function to construct functional options +// that enables resolving EC2IMDS region. The function takes +// in a UseEC2IMDSRegion functional option, and can be used to set the +// EC2IMDS client which will be used to resolve EC2IMDSRegion. +// If no functional option is provided, an EC2IMDS client is built and used +// by the resolver. If multiple WithEC2IMDSRegion calls are made, the last +// call overrides the previous call values. Note that the WithRegion calls takes +// precedence over WithEC2IMDSRegion when resolving region. +func WithEC2IMDSRegion(fnOpts ...func(o *UseEC2IMDSRegion)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.UseEC2IMDSRegion = &UseEC2IMDSRegion{} + + for _, fn := range fnOpts { + fn(o.UseEC2IMDSRegion) + } + return nil + } +} + +// getCredentialsProvider returns the credentials value +func (o LoadOptions) getCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error) { + if o.Credentials == nil { + return nil, false, nil + } + + return o.Credentials, true, nil +} + +// WithCredentialsProvider is a helper function to construct functional options +// that sets Credential provider value on config's LoadOptions. If credentials +// provider is set to nil, the credentials provider value will be ignored. +// If multiple WithCredentialsProvider calls are made, the last call overrides +// the previous call values. +func WithCredentialsProvider(v aws.CredentialsProvider) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.Credentials = v + return nil + } +} + +// getCredentialsCacheOptionsProvider returns the wrapped function to set aws.CredentialsCacheOptions +func (o LoadOptions) getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) { + if o.CredentialsCacheOptions == nil { + return nil, false, nil + } + + return o.CredentialsCacheOptions, true, nil +} + +// WithCredentialsCacheOptions is a helper function to construct functional +// options that sets a function to modify the aws.CredentialsCacheOptions the +// aws.CredentialsCache will be configured with, if the CredentialsCache is used +// by the configuration loader. +// +// If multiple WithCredentialsCacheOptions calls are made, the last call +// overrides the previous call values. +func WithCredentialsCacheOptions(v func(*aws.CredentialsCacheOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.CredentialsCacheOptions = v + return nil + } +} + +// getBearerAuthTokenProvider returns the credentials value +func (o LoadOptions) getBearerAuthTokenProvider(ctx context.Context) (smithybearer.TokenProvider, bool, error) { + if o.BearerAuthTokenProvider == nil { + return nil, false, nil + } + + return o.BearerAuthTokenProvider, true, nil +} + +// WithBearerAuthTokenProvider is a helper function to construct functional options +// that sets Credential provider value on config's LoadOptions. If credentials +// provider is set to nil, the credentials provider value will be ignored. +// If multiple WithBearerAuthTokenProvider calls are made, the last call overrides +// the previous call values. +func WithBearerAuthTokenProvider(v smithybearer.TokenProvider) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.BearerAuthTokenProvider = v + return nil + } +} + +// getBearerAuthTokenCacheOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions +func (o LoadOptions) getBearerAuthTokenCacheOptions(ctx context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) { + if o.BearerAuthTokenCacheOptions == nil { + return nil, false, nil + } + + return o.BearerAuthTokenCacheOptions, true, nil +} + +// WithBearerAuthTokenCacheOptions is a helper function to construct functional options +// that sets a function to modify the TokenCacheOptions the smithy-go +// auth/bearer#TokenCache will be configured with, if the TokenCache is used by +// the configuration loader. +// +// If multiple WithBearerAuthTokenCacheOptions calls are made, the last call overrides +// the previous call values. +func WithBearerAuthTokenCacheOptions(v func(*smithybearer.TokenCacheOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.BearerAuthTokenCacheOptions = v + return nil + } +} + +// getSSOTokenProviderOptionsProvider returns the wrapped function to set smithybearer.TokenCacheOptions +func (o LoadOptions) getSSOTokenProviderOptions(ctx context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) { + if o.SSOTokenProviderOptions == nil { + return nil, false, nil + } + + return o.SSOTokenProviderOptions, true, nil +} + +// WithSSOTokenProviderOptions is a helper function to construct functional +// options that sets a function to modify the SSOtokenProviderOptions the SDK's +// credentials/ssocreds#SSOProvider will be configured with, if the +// SSOTokenProvider is used by the configuration loader. +// +// If multiple WithSSOTokenProviderOptions calls are made, the last call overrides +// the previous call values. +func WithSSOTokenProviderOptions(v func(*ssocreds.SSOTokenProviderOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SSOTokenProviderOptions = v + return nil + } +} + +// getProcessCredentialOptions returns the wrapped function to set processcreds.Options +func (o LoadOptions) getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) { + if o.ProcessCredentialOptions == nil { + return nil, false, nil + } + + return o.ProcessCredentialOptions, true, nil +} + +// WithProcessCredentialOptions is a helper function to construct functional options +// that sets a function to use processcreds.Options on config's LoadOptions. +// If process credential options is set to nil, the process credential value will +// be ignored. If multiple WithProcessCredentialOptions calls are made, the last call +// overrides the previous call values. +func WithProcessCredentialOptions(v func(*processcreds.Options)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.ProcessCredentialOptions = v + return nil + } +} + +// getEC2RoleCredentialOptions returns the wrapped function to set the ec2rolecreds.Options +func (o LoadOptions) getEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error) { + if o.EC2RoleCredentialOptions == nil { + return nil, false, nil + } + + return o.EC2RoleCredentialOptions, true, nil +} + +// WithEC2RoleCredentialOptions is a helper function to construct functional options +// that sets a function to use ec2rolecreds.Options on config's LoadOptions. If +// EC2 role credential options is set to nil, the EC2 role credential options value +// will be ignored. If multiple WithEC2RoleCredentialOptions calls are made, +// the last call overrides the previous call values. +func WithEC2RoleCredentialOptions(v func(*ec2rolecreds.Options)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2RoleCredentialOptions = v + return nil + } +} + +// getEndpointCredentialOptions returns the wrapped function to set endpointcreds.Options +func (o LoadOptions) getEndpointCredentialOptions(context.Context) (func(*endpointcreds.Options), bool, error) { + if o.EndpointCredentialOptions == nil { + return nil, false, nil + } + + return o.EndpointCredentialOptions, true, nil +} + +// WithEndpointCredentialOptions is a helper function to construct functional options +// that sets a function to use endpointcreds.Options on config's LoadOptions. If +// endpoint credential options is set to nil, the endpoint credential options +// value will be ignored. If multiple WithEndpointCredentialOptions calls are made, +// the last call overrides the previous call values. +func WithEndpointCredentialOptions(v func(*endpointcreds.Options)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EndpointCredentialOptions = v + return nil + } +} + +// getWebIdentityRoleCredentialOptions returns the wrapped function +func (o LoadOptions) getWebIdentityRoleCredentialOptions(context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error) { + if o.WebIdentityRoleCredentialOptions == nil { + return nil, false, nil + } + + return o.WebIdentityRoleCredentialOptions, true, nil +} + +// WithWebIdentityRoleCredentialOptions is a helper function to construct +// functional options that sets a function to use stscreds.WebIdentityRoleOptions +// on config's LoadOptions. If web identity role credentials options is set to nil, +// the web identity role credentials value will be ignored. If multiple +// WithWebIdentityRoleCredentialOptions calls are made, the last call +// overrides the previous call values. +func WithWebIdentityRoleCredentialOptions(v func(*stscreds.WebIdentityRoleOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.WebIdentityRoleCredentialOptions = v + return nil + } +} + +// getAssumeRoleCredentialOptions returns AssumeRoleCredentialOptions from LoadOptions +func (o LoadOptions) getAssumeRoleCredentialOptions(context.Context) (func(options *stscreds.AssumeRoleOptions), bool, error) { + if o.AssumeRoleCredentialOptions == nil { + return nil, false, nil + } + + return o.AssumeRoleCredentialOptions, true, nil +} + +// WithAssumeRoleCredentialOptions is a helper function to construct +// functional options that sets a function to use stscreds.AssumeRoleOptions +// on config's LoadOptions. If assume role credentials options is set to nil, +// the assume role credentials value will be ignored. If multiple +// WithAssumeRoleCredentialOptions calls are made, the last call overrides +// the previous call values. +func WithAssumeRoleCredentialOptions(v func(*stscreds.AssumeRoleOptions)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.AssumeRoleCredentialOptions = v + return nil + } +} + +func (o LoadOptions) getHTTPClient(ctx context.Context) (HTTPClient, bool, error) { + if o.HTTPClient == nil { + return nil, false, nil + } + + return o.HTTPClient, true, nil +} + +// WithHTTPClient is a helper function to construct functional options +// that sets HTTPClient on LoadOptions. If HTTPClient is set to nil, +// the HTTPClient value will be ignored. +// If multiple WithHTTPClient calls are made, the last call overrides +// the previous call values. +func WithHTTPClient(v HTTPClient) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.HTTPClient = v + return nil + } +} + +func (o LoadOptions) getAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error) { + if o.APIOptions == nil { + return nil, false, nil + } + + return o.APIOptions, true, nil +} + +// WithAPIOptions is a helper function to construct functional options +// that sets APIOptions on LoadOptions. If APIOptions is set to nil, the +// APIOptions value is ignored. If multiple WithAPIOptions calls are +// made, the last call overrides the previous call values. +func WithAPIOptions(v []func(*middleware.Stack) error) LoadOptionsFunc { + return func(o *LoadOptions) error { + if v == nil { + return nil + } + + o.APIOptions = append(o.APIOptions, v...) + return nil + } +} + +func (o LoadOptions) getRetryMaxAttempts(ctx context.Context) (int, bool, error) { + if o.RetryMaxAttempts == 0 { + return 0, false, nil + } + + return o.RetryMaxAttempts, true, nil +} + +// WithRetryMaxAttempts is a helper function to construct functional options that sets +// RetryMaxAttempts on LoadOptions. If RetryMaxAttempts is unset, the RetryMaxAttempts value is +// ignored. If multiple WithRetryMaxAttempts calls are made, the last call overrides +// the previous call values. +// +// Will be ignored of LoadOptions.Retryer or WithRetryer are used. +func WithRetryMaxAttempts(v int) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.RetryMaxAttempts = v + return nil + } +} + +func (o LoadOptions) getRetryMode(ctx context.Context) (aws.RetryMode, bool, error) { + if o.RetryMode == "" { + return "", false, nil + } + + return o.RetryMode, true, nil +} + +// WithRetryMode is a helper function to construct functional options that sets +// RetryMode on LoadOptions. If RetryMode is unset, the RetryMode value is +// ignored. If multiple WithRetryMode calls are made, the last call overrides +// the previous call values. +// +// Will be ignored of LoadOptions.Retryer or WithRetryer are used. +func WithRetryMode(v aws.RetryMode) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.RetryMode = v + return nil + } +} + +func (o LoadOptions) getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) { + if o.Retryer == nil { + return nil, false, nil + } + + return o.Retryer, true, nil +} + +// WithRetryer is a helper function to construct functional options +// that sets Retryer on LoadOptions. If Retryer is set to nil, the +// Retryer value is ignored. If multiple WithRetryer calls are +// made, the last call overrides the previous call values. +func WithRetryer(v func() aws.Retryer) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.Retryer = v + return nil + } +} + +func (o LoadOptions) getEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error) { + if o.EndpointResolver == nil { + return nil, false, nil + } + + return o.EndpointResolver, true, nil +} + +// WithEndpointResolver is a helper function to construct functional options +// that sets the EndpointResolver on LoadOptions. If the EndpointResolver is set to nil, +// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls +// are made, the last call overrides the previous call values. +// +// Deprecated: The global endpoint resolution interface is deprecated. The API +// for endpoint resolution is now unique to each service and is set via the +// EndpointResolverV2 field on service client options. Use of +// WithEndpointResolver or WithEndpointResolverWithOptions will prevent you +// from using any endpoint-related service features released after the +// introduction of EndpointResolverV2. You may also encounter broken or +// unexpected behavior when using the old global interface with services that +// use many endpoint-related customizations such as S3. +func WithEndpointResolver(v aws.EndpointResolver) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EndpointResolver = v + return nil + } +} + +func (o LoadOptions) getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) { + if o.EndpointResolverWithOptions == nil { + return nil, false, nil + } + + return o.EndpointResolverWithOptions, true, nil +} + +// WithEndpointResolverWithOptions is a helper function to construct functional options +// that sets the EndpointResolverWithOptions on LoadOptions. If the EndpointResolverWithOptions is set to nil, +// the EndpointResolver value is ignored. If multiple WithEndpointResolver calls +// are made, the last call overrides the previous call values. +// +// Deprecated: The global endpoint resolution interface is deprecated. See +// deprecation docs on [WithEndpointResolver]. +func WithEndpointResolverWithOptions(v aws.EndpointResolverWithOptions) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EndpointResolverWithOptions = v + return nil + } +} + +func (o LoadOptions) getLogger(ctx context.Context) (logging.Logger, bool, error) { + if o.Logger == nil { + return nil, false, nil + } + + return o.Logger, true, nil +} + +// WithLogger is a helper function to construct functional options +// that sets Logger on LoadOptions. If Logger is set to nil, the +// Logger value will be ignored. If multiple WithLogger calls are made, +// the last call overrides the previous call values. +func WithLogger(v logging.Logger) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.Logger = v + return nil + } +} + +func (o LoadOptions) getClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error) { + if o.ClientLogMode == nil { + return 0, false, nil + } + + return *o.ClientLogMode, true, nil +} + +// WithClientLogMode is a helper function to construct functional options +// that sets client log mode on LoadOptions. If client log mode is set to nil, +// the client log mode value will be ignored. If multiple WithClientLogMode calls are made, +// the last call overrides the previous call values. +func WithClientLogMode(v aws.ClientLogMode) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.ClientLogMode = &v + return nil + } +} + +func (o LoadOptions) getLogConfigurationWarnings(ctx context.Context) (v bool, found bool, err error) { + if o.LogConfigurationWarnings == nil { + return false, false, nil + } + return *o.LogConfigurationWarnings, true, nil +} + +// WithLogConfigurationWarnings is a helper function to construct +// functional options that can be used to set LogConfigurationWarnings +// on LoadOptions. +// +// If multiple WithLogConfigurationWarnings calls are made, the last call +// overrides the previous call values. +func WithLogConfigurationWarnings(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.LogConfigurationWarnings = &v + return nil + } +} + +// GetS3UseARNRegion returns whether to allow ARNs to direct the region +// the S3 client's requests are sent to. +func (o LoadOptions) GetS3UseARNRegion(ctx context.Context) (v bool, found bool, err error) { + if o.S3UseARNRegion == nil { + return false, false, nil + } + return *o.S3UseARNRegion, true, nil +} + +// WithS3UseARNRegion is a helper function to construct functional options +// that can be used to set S3UseARNRegion on LoadOptions. +// If multiple WithS3UseARNRegion calls are made, the last call overrides +// the previous call values. +func WithS3UseARNRegion(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3UseARNRegion = &v + return nil + } +} + +// GetS3DisableMultiRegionAccessPoints returns whether to disable +// the S3 multi-region access points feature. +func (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) { + if o.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + return *o.S3DisableMultiRegionAccessPoints, true, nil +} + +// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options +// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions. +// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides +// the previous call values. +func WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3DisableMultiRegionAccessPoints = &v + return nil + } +} + +// GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set. +func (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { + if o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + return o.EnableEndpointDiscovery, true, nil +} + +// WithEndpointDiscovery is a helper function to construct functional options +// that can be used to enable endpoint discovery on LoadOptions for supported clients. +// If multiple WithEndpointDiscovery calls are made, the last call overrides +// the previous call values. +func WithEndpointDiscovery(v aws.EndpointDiscoveryEnableState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EnableEndpointDiscovery = v + return nil + } +} + +// getSSOProviderOptions returns AssumeRoleCredentialOptions from LoadOptions +func (o LoadOptions) getSSOProviderOptions(context.Context) (func(options *ssocreds.Options), bool, error) { + if o.SSOProviderOptions == nil { + return nil, false, nil + } + + return o.SSOProviderOptions, true, nil +} + +// WithSSOProviderOptions is a helper function to construct +// functional options that sets a function to use ssocreds.Options +// on config's LoadOptions. If the SSO credential provider options is set to nil, +// the sso provider options value will be ignored. If multiple +// WithSSOProviderOptions calls are made, the last call overrides +// the previous call values. +func WithSSOProviderOptions(v func(*ssocreds.Options)) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.SSOProviderOptions = v + return nil + } +} + +// GetEC2IMDSClientEnableState implements a EC2IMDSClientEnableState options resolver interface. +func (o LoadOptions) GetEC2IMDSClientEnableState() (imds.ClientEnableState, bool, error) { + if o.EC2IMDSClientEnableState == imds.ClientDefaultEnableState { + return imds.ClientDefaultEnableState, false, nil + } + + return o.EC2IMDSClientEnableState, true, nil +} + +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (o LoadOptions) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if o.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return o.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (o LoadOptions) GetEC2IMDSEndpoint() (string, bool, error) { + if len(o.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + return o.EC2IMDSEndpoint, true, nil +} + +// WithEC2IMDSClientEnableState is a helper function to construct functional options that sets the EC2IMDSClientEnableState. +func WithEC2IMDSClientEnableState(v imds.ClientEnableState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSClientEnableState = v + return nil + } +} + +// WithEC2IMDSEndpointMode is a helper function to construct functional options that sets the EC2IMDSEndpointMode. +func WithEC2IMDSEndpointMode(v imds.EndpointModeState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSEndpointMode = v + return nil + } +} + +// WithEC2IMDSEndpoint is a helper function to construct functional options that sets the EC2IMDSEndpoint. +func WithEC2IMDSEndpoint(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.EC2IMDSEndpoint = v + return nil + } +} + +// WithUseDualStackEndpoint is a helper function to construct +// functional options that can be used to set UseDualStackEndpoint on LoadOptions. +func WithUseDualStackEndpoint(v aws.DualStackEndpointState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.UseDualStackEndpoint = v + return nil + } +} + +// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be +// used for requests. +func (o LoadOptions) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { + if o.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + return o.UseDualStackEndpoint, true, nil +} + +// WithUseFIPSEndpoint is a helper function to construct +// functional options that can be used to set UseFIPSEndpoint on LoadOptions. +func WithUseFIPSEndpoint(v aws.FIPSEndpointState) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.UseFIPSEndpoint = v + return nil + } +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (o LoadOptions) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if o.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + return o.UseFIPSEndpoint, true, nil +} + +// WithDefaultsMode sets the SDK defaults configuration mode to the value provided. +// +// Zero or more functional options can be provided to provide configuration options for performing +// environment discovery when using aws.DefaultsModeAuto. +func WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsModeOptions)) LoadOptionsFunc { + do := DefaultsModeOptions{ + Mode: mode, + } + for _, fn := range optFns { + fn(&do) + } + return func(options *LoadOptions) error { + options.DefaultsModeOptions = do + return nil + } +} + +// GetS3DisableExpressAuth returns the configured value for +// [EnvConfig.S3DisableExpressAuth]. +func (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) { + if o.S3DisableExpressAuth == nil { + return false, false + } + + return *o.S3DisableExpressAuth, true +} + +// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth] +// to the value provided. +func WithS3DisableExpressAuth(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3DisableExpressAuth = &v + return nil + } +} + +// WithBaseEndpoint is a helper function to construct functional options that +// sets BaseEndpoint on config's LoadOptions. Empty values have no effect, and +// subsequent calls to this API override previous ones. +// +// This is an in-code setting, therefore, any value set using this hook takes +// precedence over and will override ALL environment and shared config +// directives that set endpoint URLs. Functional options on service clients +// have higher specificity, and functional options that modify the value of +// BaseEndpoint on a client will take precedence over this setting. +func WithBaseEndpoint(v string) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.BaseEndpoint = v + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/local.go b/vendor/github.com/aws/aws-sdk-go-v2/config/local.go new file mode 100644 index 00000000..b629137c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/local.go @@ -0,0 +1,51 @@ +package config + +import ( + "fmt" + "net" + "net/url" +) + +var lookupHostFn = net.LookupHost + +func isLoopbackHost(host string) (bool, error) { + ip := net.ParseIP(host) + if ip != nil { + return ip.IsLoopback(), nil + } + + // Host is not an ip, perform lookup + addrs, err := lookupHostFn(host) + if err != nil { + return false, err + } + if len(addrs) == 0 { + return false, fmt.Errorf("no addrs found for host, %s", host) + } + + for _, addr := range addrs { + if !net.ParseIP(addr).IsLoopback() { + return false, nil + } + } + + return true, nil +} + +func validateLocalURL(v string) error { + u, err := url.Parse(v) + if err != nil { + return err + } + + host := u.Hostname() + if len(host) == 0 { + return fmt.Errorf("unable to parse host from local HTTP cred provider URL") + } else if isLoopback, err := isLoopbackHost(host); err != nil { + return fmt.Errorf("failed to resolve host %q, %v", host, err) + } else if !isLoopback { + return fmt.Errorf("invalid endpoint host, %q, only host resolving to loopback addresses are allowed", host) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go new file mode 100644 index 00000000..043781f1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go @@ -0,0 +1,721 @@ +package config + +import ( + "context" + "io" + "net/http" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" + "github.com/aws/aws-sdk-go-v2/credentials/processcreds" + "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + smithybearer "github.com/aws/smithy-go/auth/bearer" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" +) + +// sharedConfigProfileProvider provides access to the shared config profile +// name external configuration value. +type sharedConfigProfileProvider interface { + getSharedConfigProfile(ctx context.Context) (string, bool, error) +} + +// getSharedConfigProfile searches the configs for a sharedConfigProfileProvider +// and returns the value if found. Returns an error if a provider fails before a +// value is found. +func getSharedConfigProfile(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(sharedConfigProfileProvider); ok { + value, found, err = p.getSharedConfigProfile(ctx) + if err != nil || found { + break + } + } + } + return +} + +// sharedConfigFilesProvider provides access to the shared config filesnames +// external configuration value. +type sharedConfigFilesProvider interface { + getSharedConfigFiles(ctx context.Context) ([]string, bool, error) +} + +// getSharedConfigFiles searches the configs for a sharedConfigFilesProvider +// and returns the value if found. Returns an error if a provider fails before a +// value is found. +func getSharedConfigFiles(ctx context.Context, configs configs) (value []string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(sharedConfigFilesProvider); ok { + value, found, err = p.getSharedConfigFiles(ctx) + if err != nil || found { + break + } + } + } + + return +} + +// sharedCredentialsFilesProvider provides access to the shared credentials filesnames +// external configuration value. +type sharedCredentialsFilesProvider interface { + getSharedCredentialsFiles(ctx context.Context) ([]string, bool, error) +} + +// getSharedCredentialsFiles searches the configs for a sharedCredentialsFilesProvider +// and returns the value if found. Returns an error if a provider fails before a +// value is found. +func getSharedCredentialsFiles(ctx context.Context, configs configs) (value []string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(sharedCredentialsFilesProvider); ok { + value, found, err = p.getSharedCredentialsFiles(ctx) + if err != nil || found { + break + } + } + } + + return +} + +// customCABundleProvider provides access to the custom CA bundle PEM bytes. +type customCABundleProvider interface { + getCustomCABundle(ctx context.Context) (io.Reader, bool, error) +} + +// getCustomCABundle searches the configs for a customCABundleProvider +// and returns the value if found. Returns an error if a provider fails before a +// value is found. +func getCustomCABundle(ctx context.Context, configs configs) (value io.Reader, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(customCABundleProvider); ok { + value, found, err = p.getCustomCABundle(ctx) + if err != nil || found { + break + } + } + } + + return +} + +// regionProvider provides access to the region external configuration value. +type regionProvider interface { + getRegion(ctx context.Context) (string, bool, error) +} + +// getRegion searches the configs for a regionProvider and returns the value +// if found. Returns an error if a provider fails before a value is found. +func getRegion(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(regionProvider); ok { + value, found, err = p.getRegion(ctx) + if err != nil || found { + break + } + } + } + return +} + +// IgnoreConfiguredEndpointsProvider is needed to search for all providers +// that provide a flag to disable configured endpoints. +type IgnoreConfiguredEndpointsProvider interface { + GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { + value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) + if err != nil || found { + break + } + } + } + return +} + +type baseEndpointProvider interface { + getBaseEndpoint(ctx context.Context) (string, bool, error) +} + +func getBaseEndpoint(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(baseEndpointProvider); ok { + value, found, err = p.getBaseEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +type servicesObjectProvider interface { + getServicesObject(ctx context.Context) (map[string]map[string]string, bool, error) +} + +func getServicesObject(ctx context.Context, configs configs) (value map[string]map[string]string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(servicesObjectProvider); ok { + value, found, err = p.getServicesObject(ctx) + if err != nil || found { + break + } + } + } + return +} + +// appIDProvider provides access to the sdk app ID value +type appIDProvider interface { + getAppID(ctx context.Context) (string, bool, error) +} + +func getAppID(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(appIDProvider); ok { + value, found, err = p.getAppID(ctx) + if err != nil || found { + break + } + } + } + return +} + +// disableRequestCompressionProvider provides access to the DisableRequestCompression +type disableRequestCompressionProvider interface { + getDisableRequestCompression(context.Context) (bool, bool, error) +} + +func getDisableRequestCompression(ctx context.Context, configs configs) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(disableRequestCompressionProvider); ok { + value, found, err = p.getDisableRequestCompression(ctx) + if err != nil || found { + break + } + } + } + return +} + +// requestMinCompressSizeBytesProvider provides access to the MinCompressSizeBytes +type requestMinCompressSizeBytesProvider interface { + getRequestMinCompressSizeBytes(context.Context) (int64, bool, error) +} + +func getRequestMinCompressSizeBytes(ctx context.Context, configs configs) (value int64, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(requestMinCompressSizeBytesProvider); ok { + value, found, err = p.getRequestMinCompressSizeBytes(ctx) + if err != nil || found { + break + } + } + } + return +} + +// accountIDEndpointModeProvider provides access to the AccountIDEndpointMode +type accountIDEndpointModeProvider interface { + getAccountIDEndpointMode(context.Context) (aws.AccountIDEndpointMode, bool, error) +} + +func getAccountIDEndpointMode(ctx context.Context, configs configs) (value aws.AccountIDEndpointMode, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(accountIDEndpointModeProvider); ok { + value, found, err = p.getAccountIDEndpointMode(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ec2IMDSRegionProvider provides access to the ec2 imds region +// configuration value +type ec2IMDSRegionProvider interface { + getEC2IMDSRegion(ctx context.Context) (string, bool, error) +} + +// getEC2IMDSRegion searches the configs for a ec2IMDSRegionProvider and +// returns the value if found. Returns an error if a provider fails before +// a value is found. +func getEC2IMDSRegion(ctx context.Context, configs configs) (region string, found bool, err error) { + for _, cfg := range configs { + if provider, ok := cfg.(ec2IMDSRegionProvider); ok { + region, found, err = provider.getEC2IMDSRegion(ctx) + if err != nil || found { + break + } + } + } + return +} + +// credentialsProviderProvider provides access to the credentials external +// configuration value. +type credentialsProviderProvider interface { + getCredentialsProvider(ctx context.Context) (aws.CredentialsProvider, bool, error) +} + +// getCredentialsProvider searches the configs for a credentialsProviderProvider +// and returns the value if found. Returns an error if a provider fails before a +// value is found. +func getCredentialsProvider(ctx context.Context, configs configs) (p aws.CredentialsProvider, found bool, err error) { + for _, cfg := range configs { + if provider, ok := cfg.(credentialsProviderProvider); ok { + p, found, err = provider.getCredentialsProvider(ctx) + if err != nil || found { + break + } + } + } + return +} + +// credentialsCacheOptionsProvider is an interface for retrieving a function for setting +// the aws.CredentialsCacheOptions. +type credentialsCacheOptionsProvider interface { + getCredentialsCacheOptions(ctx context.Context) (func(*aws.CredentialsCacheOptions), bool, error) +} + +// getCredentialsCacheOptionsProvider is an interface for retrieving a function for setting +// the aws.CredentialsCacheOptions. +func getCredentialsCacheOptionsProvider(ctx context.Context, configs configs) ( + f func(*aws.CredentialsCacheOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(credentialsCacheOptionsProvider); ok { + f, found, err = p.getCredentialsCacheOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// bearerAuthTokenProviderProvider provides access to the bearer authentication +// token external configuration value. +type bearerAuthTokenProviderProvider interface { + getBearerAuthTokenProvider(context.Context) (smithybearer.TokenProvider, bool, error) +} + +// getBearerAuthTokenProvider searches the config sources for a +// bearerAuthTokenProviderProvider and returns the value if found. Returns an +// error if a provider fails before a value is found. +func getBearerAuthTokenProvider(ctx context.Context, configs configs) (p smithybearer.TokenProvider, found bool, err error) { + for _, cfg := range configs { + if provider, ok := cfg.(bearerAuthTokenProviderProvider); ok { + p, found, err = provider.getBearerAuthTokenProvider(ctx) + if err != nil || found { + break + } + } + } + return +} + +// bearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for +// setting the smithy-go auth/bearer#TokenCacheOptions. +type bearerAuthTokenCacheOptionsProvider interface { + getBearerAuthTokenCacheOptions(context.Context) (func(*smithybearer.TokenCacheOptions), bool, error) +} + +// getBearerAuthTokenCacheOptionsProvider is an interface for retrieving a function for +// setting the smithy-go auth/bearer#TokenCacheOptions. +func getBearerAuthTokenCacheOptions(ctx context.Context, configs configs) ( + f func(*smithybearer.TokenCacheOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(bearerAuthTokenCacheOptionsProvider); ok { + f, found, err = p.getBearerAuthTokenCacheOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ssoTokenProviderOptionsProvider is an interface for retrieving a function for +// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. +type ssoTokenProviderOptionsProvider interface { + getSSOTokenProviderOptions(context.Context) (func(*ssocreds.SSOTokenProviderOptions), bool, error) +} + +// getSSOTokenProviderOptions is an interface for retrieving a function for +// setting the SDK's credentials/ssocreds#SSOTokenProviderOptions. +func getSSOTokenProviderOptions(ctx context.Context, configs configs) ( + f func(*ssocreds.SSOTokenProviderOptions), found bool, err error, +) { + for _, config := range configs { + if p, ok := config.(ssoTokenProviderOptionsProvider); ok { + f, found, err = p.getSSOTokenProviderOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ssoTokenProviderOptionsProvider + +// processCredentialOptions is an interface for retrieving a function for setting +// the processcreds.Options. +type processCredentialOptions interface { + getProcessCredentialOptions(ctx context.Context) (func(*processcreds.Options), bool, error) +} + +// getProcessCredentialOptions searches the slice of configs and returns the first function found +func getProcessCredentialOptions(ctx context.Context, configs configs) (f func(*processcreds.Options), found bool, err error) { + for _, config := range configs { + if p, ok := config.(processCredentialOptions); ok { + f, found, err = p.getProcessCredentialOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ec2RoleCredentialOptionsProvider is an interface for retrieving a function +// for setting the ec2rolecreds.Provider options. +type ec2RoleCredentialOptionsProvider interface { + getEC2RoleCredentialOptions(ctx context.Context) (func(*ec2rolecreds.Options), bool, error) +} + +// getEC2RoleCredentialProviderOptions searches the slice of configs and returns the first function found +func getEC2RoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*ec2rolecreds.Options), found bool, err error) { + for _, config := range configs { + if p, ok := config.(ec2RoleCredentialOptionsProvider); ok { + f, found, err = p.getEC2RoleCredentialOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// defaultRegionProvider is an interface for retrieving a default region if a region was not resolved from other sources +type defaultRegionProvider interface { + getDefaultRegion(ctx context.Context) (string, bool, error) +} + +// getDefaultRegion searches the slice of configs and returns the first fallback region found +func getDefaultRegion(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, config := range configs { + if p, ok := config.(defaultRegionProvider); ok { + value, found, err = p.getDefaultRegion(ctx) + if err != nil || found { + break + } + } + } + return +} + +// endpointCredentialOptionsProvider is an interface for retrieving a function for setting +// the endpointcreds.ProviderOptions. +type endpointCredentialOptionsProvider interface { + getEndpointCredentialOptions(ctx context.Context) (func(*endpointcreds.Options), bool, error) +} + +// getEndpointCredentialProviderOptions searches the slice of configs and returns the first function found +func getEndpointCredentialProviderOptions(ctx context.Context, configs configs) (f func(*endpointcreds.Options), found bool, err error) { + for _, config := range configs { + if p, ok := config.(endpointCredentialOptionsProvider); ok { + f, found, err = p.getEndpointCredentialOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// webIdentityRoleCredentialOptionsProvider is an interface for retrieving a function for setting +// the stscreds.WebIdentityRoleProvider. +type webIdentityRoleCredentialOptionsProvider interface { + getWebIdentityRoleCredentialOptions(ctx context.Context) (func(*stscreds.WebIdentityRoleOptions), bool, error) +} + +// getWebIdentityCredentialProviderOptions searches the slice of configs and returns the first function found +func getWebIdentityCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.WebIdentityRoleOptions), found bool, err error) { + for _, config := range configs { + if p, ok := config.(webIdentityRoleCredentialOptionsProvider); ok { + f, found, err = p.getWebIdentityRoleCredentialOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// assumeRoleCredentialOptionsProvider is an interface for retrieving a function for setting +// the stscreds.AssumeRoleOptions. +type assumeRoleCredentialOptionsProvider interface { + getAssumeRoleCredentialOptions(ctx context.Context) (func(*stscreds.AssumeRoleOptions), bool, error) +} + +// getAssumeRoleCredentialProviderOptions searches the slice of configs and returns the first function found +func getAssumeRoleCredentialProviderOptions(ctx context.Context, configs configs) (f func(*stscreds.AssumeRoleOptions), found bool, err error) { + for _, config := range configs { + if p, ok := config.(assumeRoleCredentialOptionsProvider); ok { + f, found, err = p.getAssumeRoleCredentialOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// HTTPClient is an HTTP client implementation +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// httpClientProvider is an interface for retrieving HTTPClient +type httpClientProvider interface { + getHTTPClient(ctx context.Context) (HTTPClient, bool, error) +} + +// getHTTPClient searches the slice of configs and returns the HTTPClient set on configs +func getHTTPClient(ctx context.Context, configs configs) (client HTTPClient, found bool, err error) { + for _, config := range configs { + if p, ok := config.(httpClientProvider); ok { + client, found, err = p.getHTTPClient(ctx) + if err != nil || found { + break + } + } + } + return +} + +// apiOptionsProvider is an interface for retrieving APIOptions +type apiOptionsProvider interface { + getAPIOptions(ctx context.Context) ([]func(*middleware.Stack) error, bool, error) +} + +// getAPIOptions searches the slice of configs and returns the APIOptions set on configs +func getAPIOptions(ctx context.Context, configs configs) (apiOptions []func(*middleware.Stack) error, found bool, err error) { + for _, config := range configs { + if p, ok := config.(apiOptionsProvider); ok { + // retrieve APIOptions from configs and set it on cfg + apiOptions, found, err = p.getAPIOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// endpointResolverProvider is an interface for retrieving an aws.EndpointResolver from a configuration source +type endpointResolverProvider interface { + getEndpointResolver(ctx context.Context) (aws.EndpointResolver, bool, error) +} + +// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used +// to configure the aws.Config.EndpointResolver value. +func getEndpointResolver(ctx context.Context, configs configs) (f aws.EndpointResolver, found bool, err error) { + for _, c := range configs { + if p, ok := c.(endpointResolverProvider); ok { + f, found, err = p.getEndpointResolver(ctx) + if err != nil || found { + break + } + } + } + return +} + +// endpointResolverWithOptionsProvider is an interface for retrieving an aws.EndpointResolverWithOptions from a configuration source +type endpointResolverWithOptionsProvider interface { + getEndpointResolverWithOptions(ctx context.Context) (aws.EndpointResolverWithOptions, bool, error) +} + +// getEndpointResolver searches the provided config sources for a EndpointResolverFunc that can be used +// to configure the aws.Config.EndpointResolver value. +func getEndpointResolverWithOptions(ctx context.Context, configs configs) (f aws.EndpointResolverWithOptions, found bool, err error) { + for _, c := range configs { + if p, ok := c.(endpointResolverWithOptionsProvider); ok { + f, found, err = p.getEndpointResolverWithOptions(ctx) + if err != nil || found { + break + } + } + } + return +} + +// loggerProvider is an interface for retrieving a logging.Logger from a configuration source. +type loggerProvider interface { + getLogger(ctx context.Context) (logging.Logger, bool, error) +} + +// getLogger searches the provided config sources for a logging.Logger that can be used +// to configure the aws.Config.Logger value. +func getLogger(ctx context.Context, configs configs) (l logging.Logger, found bool, err error) { + for _, c := range configs { + if p, ok := c.(loggerProvider); ok { + l, found, err = p.getLogger(ctx) + if err != nil || found { + break + } + } + } + return +} + +// clientLogModeProvider is an interface for retrieving the aws.ClientLogMode from a configuration source. +type clientLogModeProvider interface { + getClientLogMode(ctx context.Context) (aws.ClientLogMode, bool, error) +} + +func getClientLogMode(ctx context.Context, configs configs) (m aws.ClientLogMode, found bool, err error) { + for _, c := range configs { + if p, ok := c.(clientLogModeProvider); ok { + m, found, err = p.getClientLogMode(ctx) + if err != nil || found { + break + } + } + } + return +} + +// retryProvider is an configuration provider for custom Retryer. +type retryProvider interface { + getRetryer(ctx context.Context) (func() aws.Retryer, bool, error) +} + +func getRetryer(ctx context.Context, configs configs) (v func() aws.Retryer, found bool, err error) { + for _, c := range configs { + if p, ok := c.(retryProvider); ok { + v, found, err = p.getRetryer(ctx) + if err != nil || found { + break + } + } + } + return +} + +// logConfigurationWarningsProvider is an configuration provider for +// retrieving a boolean indicating whether configuration issues should +// be logged when loading from config sources +type logConfigurationWarningsProvider interface { + getLogConfigurationWarnings(ctx context.Context) (bool, bool, error) +} + +func getLogConfigurationWarnings(ctx context.Context, configs configs) (v bool, found bool, err error) { + for _, c := range configs { + if p, ok := c.(logConfigurationWarningsProvider); ok { + v, found, err = p.getLogConfigurationWarnings(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ssoCredentialOptionsProvider is an interface for retrieving a function for setting +// the ssocreds.Options. +type ssoCredentialOptionsProvider interface { + getSSOProviderOptions(context.Context) (func(*ssocreds.Options), bool, error) +} + +func getSSOProviderOptions(ctx context.Context, configs configs) (v func(options *ssocreds.Options), found bool, err error) { + for _, c := range configs { + if p, ok := c.(ssoCredentialOptionsProvider); ok { + v, found, err = p.getSSOProviderOptions(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type defaultsModeIMDSClientProvider interface { + getDefaultsModeIMDSClient(context.Context) (*imds.Client, bool, error) +} + +func getDefaultsModeIMDSClient(ctx context.Context, configs configs) (v *imds.Client, found bool, err error) { + for _, c := range configs { + if p, ok := c.(defaultsModeIMDSClientProvider); ok { + v, found, err = p.getDefaultsModeIMDSClient(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type defaultsModeProvider interface { + getDefaultsMode(context.Context) (aws.DefaultsMode, bool, error) +} + +func getDefaultsMode(ctx context.Context, configs configs) (v aws.DefaultsMode, found bool, err error) { + for _, c := range configs { + if p, ok := c.(defaultsModeProvider); ok { + v, found, err = p.getDefaultsMode(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type retryMaxAttemptsProvider interface { + GetRetryMaxAttempts(context.Context) (int, bool, error) +} + +func getRetryMaxAttempts(ctx context.Context, configs configs) (v int, found bool, err error) { + for _, c := range configs { + if p, ok := c.(retryMaxAttemptsProvider); ok { + v, found, err = p.GetRetryMaxAttempts(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} + +type retryModeProvider interface { + GetRetryMode(context.Context) (aws.RetryMode, bool, error) +} + +func getRetryMode(ctx context.Context, configs configs) (v aws.RetryMode, found bool, err error) { + for _, c := range configs { + if p, ok := c.(retryModeProvider); ok { + v, found, err = p.GetRetryMode(ctx) + if err != nil || found { + break + } + } + } + return v, found, err +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go new file mode 100644 index 00000000..41009c7d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go @@ -0,0 +1,383 @@ +package config + +import ( + "context" + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" + "net/http" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/smithy-go/logging" +) + +// resolveDefaultAWSConfig will write default configuration values into the cfg +// value. It will write the default values, overwriting any previous value. +// +// This should be used as the first resolver in the slice of resolvers when +// resolving external configuration. +func resolveDefaultAWSConfig(ctx context.Context, cfg *aws.Config, cfgs configs) error { + var sources []interface{} + for _, s := range cfgs { + sources = append(sources, s) + } + + *cfg = aws.Config{ + Logger: logging.NewStandardLogger(os.Stderr), + ConfigSources: sources, + } + return nil +} + +// resolveCustomCABundle extracts the first instance of a custom CA bundle filename +// from the external configurations. It will update the HTTP Client's builder +// to be configured with the custom CA bundle. +// +// Config provider used: +// * customCABundleProvider +func resolveCustomCABundle(ctx context.Context, cfg *aws.Config, cfgs configs) error { + pemCerts, found, err := getCustomCABundle(ctx, cfgs) + if err != nil { + // TODO error handling, What is the best way to handle this? + // capture previous errors continue. error out if all errors + return err + } + if !found { + return nil + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = awshttp.NewBuildableClient() + } + + trOpts, ok := cfg.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return fmt.Errorf("unable to add custom RootCAs HTTPClient, "+ + "has no WithTransportOptions, %T", cfg.HTTPClient) + } + + var appendErr error + client := trOpts.WithTransportOptions(func(tr *http.Transport) { + if tr.TLSClientConfig == nil { + tr.TLSClientConfig = &tls.Config{} + } + if tr.TLSClientConfig.RootCAs == nil { + tr.TLSClientConfig.RootCAs = x509.NewCertPool() + } + + b, err := ioutil.ReadAll(pemCerts) + if err != nil { + appendErr = fmt.Errorf("failed to read custom CA bundle PEM file") + } + + if !tr.TLSClientConfig.RootCAs.AppendCertsFromPEM(b) { + appendErr = fmt.Errorf("failed to load custom CA bundle PEM file") + } + }) + if appendErr != nil { + return appendErr + } + + cfg.HTTPClient = client + return err +} + +// resolveRegion extracts the first instance of a Region from the configs slice. +// +// Config providers used: +// * regionProvider +func resolveRegion(ctx context.Context, cfg *aws.Config, configs configs) error { + v, found, err := getRegion(ctx, configs) + if err != nil { + // TODO error handling, What is the best way to handle this? + // capture previous errors continue. error out if all errors + return err + } + if !found { + return nil + } + + cfg.Region = v + return nil +} + +func resolveBaseEndpoint(ctx context.Context, cfg *aws.Config, configs configs) error { + var downcastCfgSources []interface{} + for _, cs := range configs { + downcastCfgSources = append(downcastCfgSources, interface{}(cs)) + } + + if val, found, err := GetIgnoreConfiguredEndpoints(ctx, downcastCfgSources); found && val && err == nil { + cfg.BaseEndpoint = nil + return nil + } + + v, found, err := getBaseEndpoint(ctx, configs) + if err != nil { + return err + } + + if !found { + return nil + } + cfg.BaseEndpoint = aws.String(v) + return nil +} + +// resolveAppID extracts the sdk app ID from the configs slice's SharedConfig or env var +func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { + ID, _, err := getAppID(ctx, configs) + if err != nil { + return err + } + + cfg.AppID = ID + return nil +} + +// resolveDisableRequestCompression extracts the DisableRequestCompression from the configs slice's +// SharedConfig or EnvConfig +func resolveDisableRequestCompression(ctx context.Context, cfg *aws.Config, configs configs) error { + disable, _, err := getDisableRequestCompression(ctx, configs) + if err != nil { + return err + } + + cfg.DisableRequestCompression = disable + return nil +} + +// resolveRequestMinCompressSizeBytes extracts the RequestMinCompressSizeBytes from the configs slice's +// SharedConfig or EnvConfig +func resolveRequestMinCompressSizeBytes(ctx context.Context, cfg *aws.Config, configs configs) error { + minBytes, found, err := getRequestMinCompressSizeBytes(ctx, configs) + if err != nil { + return err + } + // must set a default min size 10240 if not configured + if !found { + minBytes = 10240 + } + cfg.RequestMinCompressSizeBytes = minBytes + return nil +} + +// resolveAccountIDEndpointMode extracts the AccountIDEndpointMode from the configs slice's +// SharedConfig or EnvConfig +func resolveAccountIDEndpointMode(ctx context.Context, cfg *aws.Config, configs configs) error { + m, found, err := getAccountIDEndpointMode(ctx, configs) + if err != nil { + return err + } + + if !found { + m = aws.AccountIDEndpointModePreferred + } + + cfg.AccountIDEndpointMode = m + return nil +} + +// resolveDefaultRegion extracts the first instance of a default region and sets `aws.Config.Region` to the default +// region if region had not been resolved from other sources. +func resolveDefaultRegion(ctx context.Context, cfg *aws.Config, configs configs) error { + if len(cfg.Region) > 0 { + return nil + } + + v, found, err := getDefaultRegion(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.Region = v + + return nil +} + +// resolveHTTPClient extracts the first instance of a HTTPClient and sets `aws.Config.HTTPClient` to the HTTPClient instance +// if one has not been resolved from other sources. +func resolveHTTPClient(ctx context.Context, cfg *aws.Config, configs configs) error { + c, found, err := getHTTPClient(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.HTTPClient = c + return nil +} + +// resolveAPIOptions extracts the first instance of APIOptions and sets `aws.Config.APIOptions` to the resolved API options +// if one has not been resolved from other sources. +func resolveAPIOptions(ctx context.Context, cfg *aws.Config, configs configs) error { + o, found, err := getAPIOptions(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.APIOptions = o + + return nil +} + +// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice +// and sets the functions result on the aws.Config.EndpointResolver +func resolveEndpointResolver(ctx context.Context, cfg *aws.Config, configs configs) error { + endpointResolver, found, err := getEndpointResolver(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.EndpointResolver = endpointResolver + + return nil +} + +// resolveEndpointResolver extracts the first instance of a EndpointResolverFunc from the config slice +// and sets the functions result on the aws.Config.EndpointResolver +func resolveEndpointResolverWithOptions(ctx context.Context, cfg *aws.Config, configs configs) error { + endpointResolver, found, err := getEndpointResolverWithOptions(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.EndpointResolverWithOptions = endpointResolver + + return nil +} + +func resolveLogger(ctx context.Context, cfg *aws.Config, configs configs) error { + logger, found, err := getLogger(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.Logger = logger + + return nil +} + +func resolveClientLogMode(ctx context.Context, cfg *aws.Config, configs configs) error { + mode, found, err := getClientLogMode(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.ClientLogMode = mode + + return nil +} + +func resolveRetryer(ctx context.Context, cfg *aws.Config, configs configs) error { + retryer, found, err := getRetryer(ctx, configs) + if err != nil { + return err + } + + if found { + cfg.Retryer = retryer + return nil + } + + // Only load the retry options if a custom retryer has not be specified. + if err = resolveRetryMaxAttempts(ctx, cfg, configs); err != nil { + return err + } + return resolveRetryMode(ctx, cfg, configs) +} + +func resolveEC2IMDSRegion(ctx context.Context, cfg *aws.Config, configs configs) error { + if len(cfg.Region) > 0 { + return nil + } + + region, found, err := getEC2IMDSRegion(ctx, configs) + if err != nil { + return err + } + if !found { + return nil + } + + cfg.Region = region + + return nil +} + +func resolveDefaultsModeOptions(ctx context.Context, cfg *aws.Config, configs configs) error { + defaultsMode, found, err := getDefaultsMode(ctx, configs) + if err != nil { + return err + } + if !found { + defaultsMode = aws.DefaultsModeLegacy + } + + var environment aws.RuntimeEnvironment + if defaultsMode == aws.DefaultsModeAuto { + envConfig, _, _ := getAWSConfigSources(configs) + + client, found, err := getDefaultsModeIMDSClient(ctx, configs) + if err != nil { + return err + } + if !found { + client = imds.NewFromConfig(*cfg) + } + + environment, err = resolveDefaultsModeRuntimeEnvironment(ctx, envConfig, client) + if err != nil { + return err + } + } + + cfg.DefaultsMode = defaultsMode + cfg.RuntimeEnvironment = environment + + return nil +} + +func resolveRetryMaxAttempts(ctx context.Context, cfg *aws.Config, configs configs) error { + maxAttempts, found, err := getRetryMaxAttempts(ctx, configs) + if err != nil || !found { + return err + } + cfg.RetryMaxAttempts = maxAttempts + + return nil +} + +func resolveRetryMode(ctx context.Context, cfg *aws.Config, configs configs) error { + retryMode, found, err := getRetryMode(ctx, configs) + if err != nil || !found { + return err + } + cfg.RetryMode = retryMode + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go new file mode 100644 index 00000000..a8ebb3c0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.go @@ -0,0 +1,122 @@ +package config + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" + smithybearer "github.com/aws/smithy-go/auth/bearer" +) + +// resolveBearerAuthToken extracts a token provider from the config sources. +// +// If an explicit bearer authentication token provider is not found the +// resolver will fallback to resolving token provider via other config sources +// such as SharedConfig. +func resolveBearerAuthToken(ctx context.Context, cfg *aws.Config, configs configs) error { + found, err := resolveBearerAuthTokenProvider(ctx, cfg, configs) + if found || err != nil { + return err + } + + return resolveBearerAuthTokenProviderChain(ctx, cfg, configs) +} + +// resolveBearerAuthTokenProvider extracts the first instance of +// BearerAuthTokenProvider from the config sources. +// +// The resolved BearerAuthTokenProvider will be wrapped in a cache to ensure +// the Token is only refreshed when needed. This also protects the +// TokenProvider so it can be used concurrently. +// +// Config providers used: +// * bearerAuthTokenProviderProvider +func resolveBearerAuthTokenProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { + tokenProvider, found, err := getBearerAuthTokenProvider(ctx, configs) + if !found || err != nil { + return false, err + } + + cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( + ctx, configs, tokenProvider) + if err != nil { + return false, err + } + + return true, nil +} + +func resolveBearerAuthTokenProviderChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) { + _, sharedConfig, _ := getAWSConfigSources(configs) + + var provider smithybearer.TokenProvider + + if sharedConfig.SSOSession != nil { + provider, err = resolveBearerAuthSSOTokenProvider( + ctx, cfg, sharedConfig.SSOSession, configs) + } + + if err == nil && provider != nil { + cfg.BearerAuthTokenProvider, err = wrapWithBearerAuthTokenCache( + ctx, configs, provider) + } + + return err +} + +func resolveBearerAuthSSOTokenProvider(ctx context.Context, cfg *aws.Config, session *SSOSession, configs configs) (*ssocreds.SSOTokenProvider, error) { + ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) + if err != nil { + return nil, fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) + } + + var optFns []func(*ssocreds.SSOTokenProviderOptions) + if found { + optFns = append(optFns, ssoTokenProviderOptionsFn) + } + + cachePath, err := ssocreds.StandardCachedTokenFilepath(session.Name) + if err != nil { + return nil, fmt.Errorf("failed to get SSOTokenProvider's cache path, %w", err) + } + + client := ssooidc.NewFromConfig(*cfg) + provider := ssocreds.NewSSOTokenProvider(client, cachePath, optFns...) + + return provider, nil +} + +// wrapWithBearerAuthTokenCache will wrap provider with an smithy-go +// bearer/auth#TokenCache with the provided options if the provider is not +// already a TokenCache. +func wrapWithBearerAuthTokenCache( + ctx context.Context, + cfgs configs, + provider smithybearer.TokenProvider, + optFns ...func(*smithybearer.TokenCacheOptions), +) (smithybearer.TokenProvider, error) { + _, ok := provider.(*smithybearer.TokenCache) + if ok { + return provider, nil + } + + tokenCacheConfigOptions, optionsFound, err := getBearerAuthTokenCacheOptions(ctx, cfgs) + if err != nil { + return nil, err + } + + opts := make([]func(*smithybearer.TokenCacheOptions), 0, 2+len(optFns)) + opts = append(opts, func(o *smithybearer.TokenCacheOptions) { + o.RefreshBeforeExpires = 5 * time.Minute + o.RetrieveBearerTokenTimeout = 30 * time.Second + }) + opts = append(opts, optFns...) + if optionsFound { + opts = append(opts, tokenCacheConfigOptions) + } + + return smithybearer.NewTokenCache(provider, opts...), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go new file mode 100644 index 00000000..7ae252e2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go @@ -0,0 +1,569 @@ +package config + +import ( + "context" + "fmt" + "io/ioutil" + "net" + "net/url" + "os" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials" + "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" + "github.com/aws/aws-sdk-go-v2/credentials/processcreds" + "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" + "github.com/aws/aws-sdk-go-v2/credentials/stscreds" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/service/sso" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" + "github.com/aws/aws-sdk-go-v2/service/sts" +) + +const ( + // valid credential source values + credSourceEc2Metadata = "Ec2InstanceMetadata" + credSourceEnvironment = "Environment" + credSourceECSContainer = "EcsContainer" + httpProviderAuthFileEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE" +) + +// direct representation of the IPv4 address for the ECS container +// "169.254.170.2" +var ecsContainerIPv4 net.IP = []byte{ + 169, 254, 170, 2, +} + +// direct representation of the IPv4 address for the EKS container +// "169.254.170.23" +var eksContainerIPv4 net.IP = []byte{ + 169, 254, 170, 23, +} + +// direct representation of the IPv6 address for the EKS container +// "fd00:ec2::23" +var eksContainerIPv6 net.IP = []byte{ + 0xFD, 0, 0xE, 0xC2, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0x23, +} + +var ( + ecsContainerEndpoint = "http://169.254.170.2" // not constant to allow for swapping during unit-testing +) + +// resolveCredentials extracts a credential provider from slice of config +// sources. +// +// If an explicit credential provider is not found the resolver will fallback +// to resolving credentials by extracting a credential provider from EnvConfig +// and SharedConfig. +func resolveCredentials(ctx context.Context, cfg *aws.Config, configs configs) error { + found, err := resolveCredentialProvider(ctx, cfg, configs) + if found || err != nil { + return err + } + + return resolveCredentialChain(ctx, cfg, configs) +} + +// resolveCredentialProvider extracts the first instance of Credentials from the +// config slices. +// +// The resolved CredentialProvider will be wrapped in a cache to ensure the +// credentials are only refreshed when needed. This also protects the +// credential provider to be used concurrently. +// +// Config providers used: +// * credentialsProviderProvider +func resolveCredentialProvider(ctx context.Context, cfg *aws.Config, configs configs) (bool, error) { + credProvider, found, err := getCredentialsProvider(ctx, configs) + if !found || err != nil { + return false, err + } + + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, credProvider) + if err != nil { + return false, err + } + + return true, nil +} + +// resolveCredentialChain resolves a credential provider chain using EnvConfig +// and SharedConfig if present in the slice of provided configs. +// +// The resolved CredentialProvider will be wrapped in a cache to ensure the +// credentials are only refreshed when needed. This also protects the +// credential provider to be used concurrently. +func resolveCredentialChain(ctx context.Context, cfg *aws.Config, configs configs) (err error) { + envConfig, sharedConfig, other := getAWSConfigSources(configs) + + // When checking if a profile was specified programmatically we should only consider the "other" + // configuration sources that have been provided. This ensures we correctly honor the expected credential + // hierarchy. + _, sharedProfileSet, err := getSharedConfigProfile(ctx, other) + if err != nil { + return err + } + + switch { + case sharedProfileSet: + err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other) + case envConfig.Credentials.HasKeys(): + cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials} + case len(envConfig.WebIdentityTokenFilePath) > 0: + err = assumeWebIdentity(ctx, cfg, envConfig.WebIdentityTokenFilePath, envConfig.RoleARN, envConfig.RoleSessionName, configs) + default: + err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig, other) + } + if err != nil { + return err + } + + // Wrap the resolved provider in a cache so the SDK will cache credentials. + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, cfg.Credentials) + if err != nil { + return err + } + + return nil +} + +func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedConfig *SharedConfig, configs configs) (err error) { + + switch { + case sharedConfig.Source != nil: + // Assume IAM role with credentials source from a different profile. + err = resolveCredsFromProfile(ctx, cfg, envConfig, sharedConfig.Source, configs) + + case sharedConfig.Credentials.HasKeys(): + // Static Credentials from Shared Config/Credentials file. + cfg.Credentials = credentials.StaticCredentialsProvider{ + Value: sharedConfig.Credentials, + } + + case len(sharedConfig.CredentialSource) != 0: + err = resolveCredsFromSource(ctx, cfg, envConfig, sharedConfig, configs) + + case len(sharedConfig.WebIdentityTokenFile) != 0: + // Credentials from Assume Web Identity token require an IAM Role, and + // that roll will be assumed. May be wrapped with another assume role + // via SourceProfile. + return assumeWebIdentity(ctx, cfg, sharedConfig.WebIdentityTokenFile, sharedConfig.RoleARN, sharedConfig.RoleSessionName, configs) + + case sharedConfig.hasSSOConfiguration(): + err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs) + + case len(sharedConfig.CredentialProcess) != 0: + // Get credentials from CredentialProcess + err = processCredentials(ctx, cfg, sharedConfig, configs) + + case len(envConfig.ContainerCredentialsRelativePath) != 0: + err = resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) + + case len(envConfig.ContainerCredentialsEndpoint) != 0: + err = resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) + + default: + err = resolveEC2RoleCredentials(ctx, cfg, configs) + } + if err != nil { + return err + } + + if len(sharedConfig.RoleARN) > 0 { + return credsFromAssumeRole(ctx, cfg, sharedConfig, configs) + } + + return nil +} + +func resolveSSOCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error { + if err := sharedConfig.validateSSOConfiguration(); err != nil { + return err + } + + var options []func(*ssocreds.Options) + v, found, err := getSSOProviderOptions(ctx, configs) + if err != nil { + return err + } + if found { + options = append(options, v) + } + + cfgCopy := cfg.Copy() + + if sharedConfig.SSOSession != nil { + ssoTokenProviderOptionsFn, found, err := getSSOTokenProviderOptions(ctx, configs) + if err != nil { + return fmt.Errorf("failed to get SSOTokenProviderOptions from config sources, %w", err) + } + var optFns []func(*ssocreds.SSOTokenProviderOptions) + if found { + optFns = append(optFns, ssoTokenProviderOptionsFn) + } + cfgCopy.Region = sharedConfig.SSOSession.SSORegion + cachedPath, err := ssocreds.StandardCachedTokenFilepath(sharedConfig.SSOSession.Name) + if err != nil { + return err + } + oidcClient := ssooidc.NewFromConfig(cfgCopy) + tokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath, optFns...) + options = append(options, func(o *ssocreds.Options) { + o.SSOTokenProvider = tokenProvider + o.CachedTokenFilepath = cachedPath + }) + } else { + cfgCopy.Region = sharedConfig.SSORegion + } + + cfg.Credentials = ssocreds.New(sso.NewFromConfig(cfgCopy), sharedConfig.SSOAccountID, sharedConfig.SSORoleName, sharedConfig.SSOStartURL, options...) + + return nil +} + +func ecsContainerURI(path string) string { + return fmt.Sprintf("%s%s", ecsContainerEndpoint, path) +} + +func processCredentials(ctx context.Context, cfg *aws.Config, sharedConfig *SharedConfig, configs configs) error { + var opts []func(*processcreds.Options) + + options, found, err := getProcessCredentialOptions(ctx, configs) + if err != nil { + return err + } + if found { + opts = append(opts, options) + } + + cfg.Credentials = processcreds.NewProvider(sharedConfig.CredentialProcess, opts...) + + return nil +} + +// isAllowedHost allows host to be loopback or known ECS/EKS container IPs +// +// host can either be an IP address OR an unresolved hostname - resolution will +// be automatically performed in the latter case +func isAllowedHost(host string) (bool, error) { + if ip := net.ParseIP(host); ip != nil { + return isIPAllowed(ip), nil + } + + addrs, err := lookupHostFn(host) + if err != nil { + return false, err + } + + for _, addr := range addrs { + if ip := net.ParseIP(addr); ip == nil || !isIPAllowed(ip) { + return false, nil + } + } + + return true, nil +} + +func isIPAllowed(ip net.IP) bool { + return ip.IsLoopback() || + ip.Equal(ecsContainerIPv4) || + ip.Equal(eksContainerIPv4) || + ip.Equal(eksContainerIPv6) +} + +func resolveLocalHTTPCredProvider(ctx context.Context, cfg *aws.Config, endpointURL, authToken string, configs configs) error { + var resolveErr error + + parsed, err := url.Parse(endpointURL) + if err != nil { + resolveErr = fmt.Errorf("invalid URL, %w", err) + } else { + host := parsed.Hostname() + if len(host) == 0 { + resolveErr = fmt.Errorf("unable to parse host from local HTTP cred provider URL") + } else if parsed.Scheme == "http" { + if isAllowedHost, allowHostErr := isAllowedHost(host); allowHostErr != nil { + resolveErr = fmt.Errorf("failed to resolve host %q, %v", host, allowHostErr) + } else if !isAllowedHost { + resolveErr = fmt.Errorf("invalid endpoint host, %q, only loopback/ecs/eks hosts are allowed", host) + } + } + } + + if resolveErr != nil { + return resolveErr + } + + return resolveHTTPCredProvider(ctx, cfg, endpointURL, authToken, configs) +} + +func resolveHTTPCredProvider(ctx context.Context, cfg *aws.Config, url, authToken string, configs configs) error { + optFns := []func(*endpointcreds.Options){ + func(options *endpointcreds.Options) { + if len(authToken) != 0 { + options.AuthorizationToken = authToken + } + if authFilePath := os.Getenv(httpProviderAuthFileEnvVar); authFilePath != "" { + options.AuthorizationTokenProvider = endpointcreds.TokenProviderFunc(func() (string, error) { + var contents []byte + var err error + if contents, err = ioutil.ReadFile(authFilePath); err != nil { + return "", fmt.Errorf("failed to read authorization token from %v: %v", authFilePath, err) + } + return string(contents), nil + }) + } + options.APIOptions = cfg.APIOptions + if cfg.Retryer != nil { + options.Retryer = cfg.Retryer() + } + }, + } + + optFn, found, err := getEndpointCredentialProviderOptions(ctx, configs) + if err != nil { + return err + } + if found { + optFns = append(optFns, optFn) + } + + provider := endpointcreds.New(url, optFns...) + + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider, func(options *aws.CredentialsCacheOptions) { + options.ExpiryWindow = 5 * time.Minute + }) + if err != nil { + return err + } + + return nil +} + +func resolveCredsFromSource(ctx context.Context, cfg *aws.Config, envConfig *EnvConfig, sharedCfg *SharedConfig, configs configs) (err error) { + switch sharedCfg.CredentialSource { + case credSourceEc2Metadata: + return resolveEC2RoleCredentials(ctx, cfg, configs) + + case credSourceEnvironment: + cfg.Credentials = credentials.StaticCredentialsProvider{Value: envConfig.Credentials} + + case credSourceECSContainer: + if len(envConfig.ContainerCredentialsRelativePath) != 0 { + return resolveHTTPCredProvider(ctx, cfg, ecsContainerURI(envConfig.ContainerCredentialsRelativePath), envConfig.ContainerAuthorizationToken, configs) + } + if len(envConfig.ContainerCredentialsEndpoint) != 0 { + return resolveLocalHTTPCredProvider(ctx, cfg, envConfig.ContainerCredentialsEndpoint, envConfig.ContainerAuthorizationToken, configs) + } + return fmt.Errorf("EcsContainer was specified as the credential_source, but neither 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' or AWS_CONTAINER_CREDENTIALS_FULL_URI' was set") + + default: + return fmt.Errorf("credential_source values must be EcsContainer, Ec2InstanceMetadata, or Environment") + } + + return nil +} + +func resolveEC2RoleCredentials(ctx context.Context, cfg *aws.Config, configs configs) error { + optFns := make([]func(*ec2rolecreds.Options), 0, 2) + + optFn, found, err := getEC2RoleCredentialProviderOptions(ctx, configs) + if err != nil { + return err + } + if found { + optFns = append(optFns, optFn) + } + + optFns = append(optFns, func(o *ec2rolecreds.Options) { + // Only define a client from config if not already defined. + if o.Client == nil { + o.Client = imds.NewFromConfig(*cfg) + } + }) + + provider := ec2rolecreds.New(optFns...) + + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider) + if err != nil { + return err + } + + return nil +} + +func getAWSConfigSources(cfgs configs) (*EnvConfig, *SharedConfig, configs) { + var ( + envConfig *EnvConfig + sharedConfig *SharedConfig + other configs + ) + + for i := range cfgs { + switch c := cfgs[i].(type) { + case EnvConfig: + if envConfig == nil { + envConfig = &c + } + case *EnvConfig: + if envConfig == nil { + envConfig = c + } + case SharedConfig: + if sharedConfig == nil { + sharedConfig = &c + } + case *SharedConfig: + if envConfig == nil { + sharedConfig = c + } + default: + other = append(other, c) + } + } + + if envConfig == nil { + envConfig = &EnvConfig{} + } + + if sharedConfig == nil { + sharedConfig = &SharedConfig{} + } + + return envConfig, sharedConfig, other +} + +// AssumeRoleTokenProviderNotSetError is an error returned when creating a +// session when the MFAToken option is not set when shared config is configured +// load assume a role with an MFA token. +type AssumeRoleTokenProviderNotSetError struct{} + +// Error is the error message +func (e AssumeRoleTokenProviderNotSetError) Error() string { + return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") +} + +func assumeWebIdentity(ctx context.Context, cfg *aws.Config, filepath string, roleARN, sessionName string, configs configs) error { + if len(filepath) == 0 { + return fmt.Errorf("token file path is not set") + } + + optFns := []func(*stscreds.WebIdentityRoleOptions){ + func(options *stscreds.WebIdentityRoleOptions) { + options.RoleSessionName = sessionName + }, + } + + optFn, found, err := getWebIdentityCredentialProviderOptions(ctx, configs) + if err != nil { + return err + } + + if found { + optFns = append(optFns, optFn) + } + + opts := stscreds.WebIdentityRoleOptions{ + RoleARN: roleARN, + } + + for _, fn := range optFns { + fn(&opts) + } + + if len(opts.RoleARN) == 0 { + return fmt.Errorf("role ARN is not set") + } + + client := opts.Client + if client == nil { + client = sts.NewFromConfig(*cfg) + } + + provider := stscreds.NewWebIdentityRoleProvider(client, roleARN, stscreds.IdentityTokenFile(filepath), optFns...) + + cfg.Credentials = provider + + return nil +} + +func credsFromAssumeRole(ctx context.Context, cfg *aws.Config, sharedCfg *SharedConfig, configs configs) (err error) { + optFns := []func(*stscreds.AssumeRoleOptions){ + func(options *stscreds.AssumeRoleOptions) { + options.RoleSessionName = sharedCfg.RoleSessionName + if sharedCfg.RoleDurationSeconds != nil { + if *sharedCfg.RoleDurationSeconds/time.Minute > 15 { + options.Duration = *sharedCfg.RoleDurationSeconds + } + } + // Assume role with external ID + if len(sharedCfg.ExternalID) > 0 { + options.ExternalID = aws.String(sharedCfg.ExternalID) + } + + // Assume role with MFA + if len(sharedCfg.MFASerial) != 0 { + options.SerialNumber = aws.String(sharedCfg.MFASerial) + } + }, + } + + optFn, found, err := getAssumeRoleCredentialProviderOptions(ctx, configs) + if err != nil { + return err + } + if found { + optFns = append(optFns, optFn) + } + + { + // Synthesize options early to validate configuration errors sooner to ensure a token provider + // is present if the SerialNumber was set. + var o stscreds.AssumeRoleOptions + for _, fn := range optFns { + fn(&o) + } + if o.TokenProvider == nil && o.SerialNumber != nil { + return AssumeRoleTokenProviderNotSetError{} + } + } + + cfg.Credentials = stscreds.NewAssumeRoleProvider(sts.NewFromConfig(*cfg), sharedCfg.RoleARN, optFns...) + + return nil +} + +// wrapWithCredentialsCache will wrap provider with an aws.CredentialsCache +// with the provided options if the provider is not already a +// aws.CredentialsCache. +func wrapWithCredentialsCache( + ctx context.Context, + cfgs configs, + provider aws.CredentialsProvider, + optFns ...func(options *aws.CredentialsCacheOptions), +) (aws.CredentialsProvider, error) { + _, ok := provider.(*aws.CredentialsCache) + if ok { + return provider, nil + } + + credCacheOptions, optionsFound, err := getCredentialsCacheOptionsProvider(ctx, cfgs) + if err != nil { + return nil, err + } + + // force allocation of a new slice if the additional options are + // needed, to prevent overwriting the passed in slice of options. + optFns = optFns[:len(optFns):len(optFns)] + if optionsFound { + optFns = append(optFns, credCacheOptions) + } + + return aws.NewCredentialsCache(provider, optFns...), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go new file mode 100644 index 00000000..d7a2b530 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -0,0 +1,1618 @@ +package config + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/internal/ini" + "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" + "github.com/aws/smithy-go/logging" + smithyrequestcompression "github.com/aws/smithy-go/private/requestcompression" +) + +const ( + // Prefix to use for filtering profiles. The profile prefix should only + // exist in the shared config file, not the credentials file. + profilePrefix = `profile ` + + // Prefix to be used for SSO sections. These are supposed to only exist in + // the shared config file, not the credentials file. + ssoSectionPrefix = `sso-session ` + + // Prefix for services section. It is referenced in profile via the services + // parameter to configure clients for service-specific parameters. + servicesPrefix = `services ` + + // string equivalent for boolean + endpointDiscoveryDisabled = `false` + endpointDiscoveryEnabled = `true` + endpointDiscoveryAuto = `auto` + + // Static Credentials group + accessKeyIDKey = `aws_access_key_id` // group required + secretAccessKey = `aws_secret_access_key` // group required + sessionTokenKey = `aws_session_token` // optional + + // Assume Role Credentials group + roleArnKey = `role_arn` // group required + sourceProfileKey = `source_profile` // group required + credentialSourceKey = `credential_source` // group required (or source_profile) + externalIDKey = `external_id` // optional + mfaSerialKey = `mfa_serial` // optional + roleSessionNameKey = `role_session_name` // optional + roleDurationSecondsKey = "duration_seconds" // optional + + // AWS Single Sign-On (AWS SSO) group + ssoSessionNameKey = "sso_session" + + ssoRegionKey = "sso_region" + ssoStartURLKey = "sso_start_url" + + ssoAccountIDKey = "sso_account_id" + ssoRoleNameKey = "sso_role_name" + + // Additional Config fields + regionKey = `region` + + // endpoint discovery group + enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional + + // External Credential process + credentialProcessKey = `credential_process` // optional + + // Web Identity Token File + webIdentityTokenFileKey = `web_identity_token_file` // optional + + // S3 ARN Region Usage + s3UseARNRegionKey = "s3_use_arn_region" + + ec2MetadataServiceEndpointModeKey = "ec2_metadata_service_endpoint_mode" + + ec2MetadataServiceEndpointKey = "ec2_metadata_service_endpoint" + + ec2MetadataV1DisabledKey = "ec2_metadata_v1_disabled" + + // Use DualStack Endpoint Resolution + useDualStackEndpoint = "use_dualstack_endpoint" + + // DefaultSharedConfigProfile is the default profile to be used when + // loading configuration from the config files if another profile name + // is not provided. + DefaultSharedConfigProfile = `default` + + // S3 Disable Multi-Region AccessPoints + s3DisableMultiRegionAccessPointsKey = `s3_disable_multiregion_access_points` + + useFIPSEndpointKey = "use_fips_endpoint" + + defaultsModeKey = "defaults_mode" + + // Retry options + retryMaxAttemptsKey = "max_attempts" + retryModeKey = "retry_mode" + + caBundleKey = "ca_bundle" + + sdkAppID = "sdk_ua_app_id" + + ignoreConfiguredEndpoints = "ignore_configured_endpoint_urls" + + endpointURL = "endpoint_url" + + servicesSectionKey = "services" + + disableRequestCompression = "disable_request_compression" + requestMinCompressionSizeBytes = "request_min_compression_size_bytes" + + s3DisableExpressSessionAuthKey = "s3_disable_express_session_auth" + + accountIDKey = "aws_account_id" + accountIDEndpointMode = "account_id_endpoint_mode" +) + +// defaultSharedConfigProfile allows for swapping the default profile for testing +var defaultSharedConfigProfile = DefaultSharedConfigProfile + +// DefaultSharedCredentialsFilename returns the SDK's default file path +// for the shared credentials file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/credentials +// - Windows: %USERPROFILE%\.aws\credentials +func DefaultSharedCredentialsFilename() string { + return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "credentials") +} + +// DefaultSharedConfigFilename returns the SDK's default file path for +// the shared config file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/config +// - Windows: %USERPROFILE%\.aws\config +func DefaultSharedConfigFilename() string { + return filepath.Join(shareddefaults.UserHomeDir(), ".aws", "config") +} + +// DefaultSharedConfigFiles is a slice of the default shared config files that +// the will be used in order to load the SharedConfig. +var DefaultSharedConfigFiles = []string{ + DefaultSharedConfigFilename(), +} + +// DefaultSharedCredentialsFiles is a slice of the default shared credentials +// files that the will be used in order to load the SharedConfig. +var DefaultSharedCredentialsFiles = []string{ + DefaultSharedCredentialsFilename(), +} + +// SSOSession provides the shared configuration parameters of the sso-session +// section. +type SSOSession struct { + Name string + SSORegion string + SSOStartURL string +} + +func (s *SSOSession) setFromIniSection(section ini.Section) { + updateString(&s.Name, section, ssoSessionNameKey) + updateString(&s.SSORegion, section, ssoRegionKey) + updateString(&s.SSOStartURL, section, ssoStartURLKey) +} + +// Services contains values configured in the services section +// of the AWS configuration file. +type Services struct { + // Services section values + // {"serviceId": {"key": "value"}} + // e.g. {"s3": {"endpoint_url": "example.com"}} + ServiceValues map[string]map[string]string +} + +func (s *Services) setFromIniSection(section ini.Section) { + if s.ServiceValues == nil { + s.ServiceValues = make(map[string]map[string]string) + } + for _, service := range section.List() { + s.ServiceValues[service] = section.Map(service) + } +} + +// SharedConfig represents the configuration fields of the SDK config files. +type SharedConfig struct { + Profile string + + // Credentials values from the config file. Both aws_access_key_id + // and aws_secret_access_key must be provided together in the same file + // to be considered valid. The values will be ignored if not a complete group. + // aws_session_token is an optional field that can be provided if both of the + // other two fields are also provided. + // + // aws_access_key_id + // aws_secret_access_key + // aws_session_token + Credentials aws.Credentials + + CredentialSource string + CredentialProcess string + WebIdentityTokenFile string + + // SSO session options + SSOSessionName string + SSOSession *SSOSession + + // Legacy SSO session options + SSORegion string + SSOStartURL string + + // SSO fields not used + SSOAccountID string + SSORoleName string + + RoleARN string + ExternalID string + MFASerial string + RoleSessionName string + RoleDurationSeconds *time.Duration + + SourceProfileName string + Source *SharedConfig + + // Region is the region the SDK should use for looking up AWS service endpoints + // and signing requests. + // + // region = us-west-2 + Region string + + // EnableEndpointDiscovery can be enabled or disabled in the shared config + // by setting endpoint_discovery_enabled to true, or false respectively. + // + // endpoint_discovery_enabled = true + EnableEndpointDiscovery aws.EndpointDiscoveryEnableState + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // s3_use_arn_region=true + S3UseARNRegion *bool + + // Specifies the EC2 Instance Metadata Service default endpoint selection + // mode (IPv4 or IPv6) + // + // ec2_metadata_service_endpoint_mode=IPv6 + EC2IMDSEndpointMode imds.EndpointModeState + + // Specifies the EC2 Instance Metadata Service endpoint to use. If + // specified it overrides EC2IMDSEndpointMode. + // + // ec2_metadata_service_endpoint=http://fd00:ec2::254 + EC2IMDSEndpoint string + + // Specifies that IMDS clients should not fallback to IMDSv1 if token + // requests fail. + // + // ec2_metadata_v1_disabled=true + EC2IMDSv1Disabled *bool + + // Specifies if the S3 service should disable support for Multi-Region + // access-points + // + // s3_disable_multiregion_access_points=true + S3DisableMultiRegionAccessPoints *bool + + // Specifies that SDK clients must resolve a dual-stack endpoint for + // services. + // + // use_dualstack_endpoint=true + UseDualStackEndpoint aws.DualStackEndpointState + + // Specifies that SDK clients must resolve a FIPS endpoint for + // services. + // + // use_fips_endpoint=true + UseFIPSEndpoint aws.FIPSEndpointState + + // Specifies which defaults mode should be used by services. + // + // defaults_mode=standard + DefaultsMode aws.DefaultsMode + + // Specifies the maximum number attempts an API client will call an + // operation that fails with a retryable error. + // + // max_attempts=3 + RetryMaxAttempts int + + // Specifies the retry model the API client will be created with. + // + // retry_mode=standard + RetryMode aws.RetryMode + + // Sets the path to a custom Credentials Authority (CA) Bundle PEM file + // that the SDK will use instead of the system's root CA bundle. Only use + // this if you want to configure the SDK to use a custom set of CAs. + // + // Enabling this option will attempt to merge the Transport into the SDK's + // HTTP client. If the client's Transport is not a http.Transport an error + // will be returned. If the Transport's TLS config is set this option will + // cause the SDK to overwrite the Transport's TLS config's RootCAs value. + // + // Setting a custom HTTPClient in the aws.Config options will override this + // setting. To use this option and custom HTTP client, the HTTP client + // needs to be provided when creating the config. Not the service client. + // + // ca_bundle=$HOME/my_custom_ca_bundle + CustomCABundle string + + // aws sdk app ID that can be added to user agent header string + AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string + + // Services section config. + ServicesSectionName string + Services Services + + // determine if request compression is allowed, default to false + // retrieved from config file's profile field disable_request_compression + DisableRequestCompression *bool + + // inclusive threshold request body size to trigger compression, + // default to 10240 and must be within 0 and 10485760 bytes inclusive + // retrieved from config file's profile field request_min_compression_size_bytes + RequestMinCompressSizeBytes *int64 + + // Whether S3Express auth is disabled. + // + // This will NOT prevent requests from being made to S3Express buckets, it + // will only bypass the modified endpoint routing and signing behaviors + // associated with the feature. + S3DisableExpressAuth *bool + + AccountIDEndpointMode aws.AccountIDEndpointMode +} + +func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { + if len(c.DefaultsMode) == 0 { + return "", false, nil + } + + return c.DefaultsMode, true, nil +} + +// GetRetryMaxAttempts returns the maximum number of attempts an API client +// created Retryer should attempt an operation call before failing. +func (c SharedConfig) GetRetryMaxAttempts(ctx context.Context) (value int, ok bool, err error) { + if c.RetryMaxAttempts == 0 { + return 0, false, nil + } + + return c.RetryMaxAttempts, true, nil +} + +// GetRetryMode returns the model the API client should create its Retryer in. +func (c SharedConfig) GetRetryMode(ctx context.Context) (value aws.RetryMode, ok bool, err error) { + if len(c.RetryMode) == 0 { + return "", false, nil + } + + return c.RetryMode, true, nil +} + +// GetS3UseARNRegion returns if the S3 service should allow ARNs to direct the region +// the client's requests are sent to. +func (c SharedConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { + if c.S3UseARNRegion == nil { + return false, false, nil + } + + return *c.S3UseARNRegion, true, nil +} + +// GetEnableEndpointDiscovery returns if the enable_endpoint_discovery is set. +func (c SharedConfig) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { + if c.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { + return aws.EndpointDiscoveryUnset, false, nil + } + + return c.EnableEndpointDiscovery, true, nil +} + +// GetS3DisableMultiRegionAccessPoints returns if the S3 service should disable support for Multi-Region +// access-points. +func (c SharedConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { + if c.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + + return *c.S3DisableMultiRegionAccessPoints, true, nil +} + +// GetRegion returns the region for the profile if a region is set. +func (c SharedConfig) getRegion(ctx context.Context) (string, bool, error) { + if len(c.Region) == 0 { + return "", false, nil + } + return c.Region, true, nil +} + +// GetCredentialsProvider returns the credentials for a profile if they were set. +func (c SharedConfig) getCredentialsProvider() (aws.Credentials, bool, error) { + return c.Credentials, true, nil +} + +// GetEC2IMDSEndpointMode implements a EC2IMDSEndpointMode option resolver interface. +func (c SharedConfig) GetEC2IMDSEndpointMode() (imds.EndpointModeState, bool, error) { + if c.EC2IMDSEndpointMode == imds.EndpointModeStateUnset { + return imds.EndpointModeStateUnset, false, nil + } + + return c.EC2IMDSEndpointMode, true, nil +} + +// GetEC2IMDSEndpoint implements a EC2IMDSEndpoint option resolver interface. +func (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) { + if len(c.EC2IMDSEndpoint) == 0 { + return "", false, nil + } + + return c.EC2IMDSEndpoint, true, nil +} + +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c SharedConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} + +// GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be +// used for requests. +func (c SharedConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { + if c.UseDualStackEndpoint == aws.DualStackEndpointStateUnset { + return aws.DualStackEndpointStateUnset, false, nil + } + + return c.UseDualStackEndpoint, true, nil +} + +// GetUseFIPSEndpoint returns whether the service's FIPS endpoint should be +// used for requests. +func (c SharedConfig) GetUseFIPSEndpoint(ctx context.Context) (value aws.FIPSEndpointState, found bool, err error) { + if c.UseFIPSEndpoint == aws.FIPSEndpointStateUnset { + return aws.FIPSEndpointStateUnset, false, nil + } + + return c.UseFIPSEndpoint, true, nil +} + +// GetS3DisableExpressAuth returns the configured value for +// [SharedConfig.S3DisableExpressAuth]. +func (c SharedConfig) GetS3DisableExpressAuth() (value, ok bool) { + if c.S3DisableExpressAuth == nil { + return false, false + } + + return *c.S3DisableExpressAuth, true +} + +// GetCustomCABundle returns the custom CA bundle's PEM bytes if the file was +func (c SharedConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { + if len(c.CustomCABundle) == 0 { + return nil, false, nil + } + + b, err := ioutil.ReadFile(c.CustomCABundle) + if err != nil { + return nil, false, err + } + return bytes.NewReader(b), true, nil +} + +// getAppID returns the sdk app ID if set in shared config profile +func (c SharedConfig) getAppID(context.Context) (string, bool, error) { + return c.AppID, len(c.AppID) > 0, nil +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c SharedConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c SharedConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c SharedConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if service, ok := c.Services.ServiceValues[normalizeShared(sdkID)]; ok { + if endpt, ok := service[endpointURL]; ok { + return endpt, true, nil + } + } + return "", false, nil +} + +func normalizeShared(sdkID string) string { + lower := strings.ToLower(sdkID) + return strings.ReplaceAll(lower, " ", "_") +} + +func (c SharedConfig) getServicesObject(context.Context) (map[string]map[string]string, bool, error) { + return c.Services.ServiceValues, c.Services.ServiceValues != nil, nil +} + +// loadSharedConfigIgnoreNotExist is an alias for loadSharedConfig with the +// addition of ignoring when none of the files exist or when the profile +// is not found in any of the files. +func loadSharedConfigIgnoreNotExist(ctx context.Context, configs configs) (Config, error) { + cfg, err := loadSharedConfig(ctx, configs) + if err != nil { + if _, ok := err.(SharedConfigProfileNotExistError); ok { + return SharedConfig{}, nil + } + return nil, err + } + + return cfg, nil +} + +// loadSharedConfig uses the configs passed in to load the SharedConfig from file +// The file names and profile name are sourced from the configs. +// +// If profile name is not provided DefaultSharedConfigProfile (default) will +// be used. +// +// If shared config filenames are not provided DefaultSharedConfigFiles will +// be used. +// +// Config providers used: +// * sharedConfigProfileProvider +// * sharedConfigFilesProvider +func loadSharedConfig(ctx context.Context, configs configs) (Config, error) { + var profile string + var configFiles []string + var credentialsFiles []string + var ok bool + var err error + + profile, ok, err = getSharedConfigProfile(ctx, configs) + if err != nil { + return nil, err + } + if !ok { + profile = defaultSharedConfigProfile + } + + configFiles, ok, err = getSharedConfigFiles(ctx, configs) + if err != nil { + return nil, err + } + + credentialsFiles, ok, err = getSharedCredentialsFiles(ctx, configs) + if err != nil { + return nil, err + } + + // setup logger if log configuration warning is seti + var logger logging.Logger + logWarnings, found, err := getLogConfigurationWarnings(ctx, configs) + if err != nil { + return SharedConfig{}, err + } + if found && logWarnings { + logger, found, err = getLogger(ctx, configs) + if err != nil { + return SharedConfig{}, err + } + if !found { + logger = logging.NewStandardLogger(os.Stderr) + } + } + + return LoadSharedConfigProfile(ctx, profile, + func(o *LoadSharedConfigOptions) { + o.Logger = logger + o.ConfigFiles = configFiles + o.CredentialsFiles = credentialsFiles + }, + ) +} + +// LoadSharedConfigOptions struct contains optional values that can be used to load the config. +type LoadSharedConfigOptions struct { + + // CredentialsFiles are the shared credentials files + CredentialsFiles []string + + // ConfigFiles are the shared config files + ConfigFiles []string + + // Logger is the logger used to log shared config behavior + Logger logging.Logger +} + +// LoadSharedConfigProfile retrieves the configuration from the list of files +// using the profile provided. The order the files are listed will determine +// precedence. Values in subsequent files will overwrite values defined in +// earlier files. +// +// For example, given two files A and B. Both define credentials. If the order +// of the files are A then B, B's credential values will be used instead of A's. +// +// If config files are not set, SDK will default to using a file at location `.aws/config` if present. +// If credentials files are not set, SDK will default to using a file at location `.aws/credentials` if present. +// No default files are set, if files set to an empty slice. +// +// You can read more about shared config and credentials file location at +// https://docs.aws.amazon.com/credref/latest/refdocs/file-location.html#file-location +func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func(*LoadSharedConfigOptions)) (SharedConfig, error) { + var option LoadSharedConfigOptions + for _, fn := range optFns { + fn(&option) + } + + if option.ConfigFiles == nil { + option.ConfigFiles = DefaultSharedConfigFiles + } + + if option.CredentialsFiles == nil { + option.CredentialsFiles = DefaultSharedCredentialsFiles + } + + // load shared configuration sections from shared configuration INI options + configSections, err := loadIniFiles(option.ConfigFiles) + if err != nil { + return SharedConfig{}, err + } + + // check for profile prefix and drop duplicates or invalid profiles + err = processConfigSections(ctx, &configSections, option.Logger) + if err != nil { + return SharedConfig{}, err + } + + // load shared credentials sections from shared credentials INI options + credentialsSections, err := loadIniFiles(option.CredentialsFiles) + if err != nil { + return SharedConfig{}, err + } + + // check for profile prefix and drop duplicates or invalid profiles + err = processCredentialsSections(ctx, &credentialsSections, option.Logger) + if err != nil { + return SharedConfig{}, err + } + + err = mergeSections(&configSections, credentialsSections) + if err != nil { + return SharedConfig{}, err + } + + cfg := SharedConfig{} + profiles := map[string]struct{}{} + + if err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil { + return SharedConfig{}, err + } + + return cfg, nil +} + +func processConfigSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { + skipSections := map[string]struct{}{} + + for _, section := range sections.List() { + if _, ok := skipSections[section]; ok { + continue + } + + // drop sections from config file that do not have expected prefixes. + switch { + case strings.HasPrefix(section, profilePrefix): + // Rename sections to remove "profile " prefixing to match with + // credentials file. If default is already present, it will be + // dropped. + newName, err := renameProfileSection(section, sections, logger) + if err != nil { + return fmt.Errorf("failed to rename profile section, %w", err) + } + skipSections[newName] = struct{}{} + + case strings.HasPrefix(section, ssoSectionPrefix): + case strings.HasPrefix(section, servicesPrefix): + case strings.EqualFold(section, "default"): + default: + // drop this section, as invalid profile name + sections.DeleteSection(section) + + if logger != nil { + logger.Logf(logging.Debug, "A profile defined with name `%v` is ignored. "+ + "For use within a shared configuration file, "+ + "a non-default profile must have `profile ` "+ + "prefixed to the profile name.", + section, + ) + } + } + } + return nil +} + +func renameProfileSection(section string, sections *ini.Sections, logger logging.Logger) (string, error) { + v, ok := sections.GetSection(section) + if !ok { + return "", fmt.Errorf("error processing profiles within the shared configuration files") + } + + // delete section with profile as prefix + sections.DeleteSection(section) + + // set the value to non-prefixed name in sections. + section = strings.TrimPrefix(section, profilePrefix) + if sections.HasSection(section) { + oldSection, _ := sections.GetSection(section) + v.Logs = append(v.Logs, + fmt.Sprintf("A non-default profile not prefixed with `profile ` found in %s, "+ + "overriding non-default profile from %s", + v.SourceFile, oldSection.SourceFile)) + sections.DeleteSection(section) + } + + // assign non-prefixed name to section + v.Name = section + sections.SetSection(section, v) + + return section, nil +} + +func processCredentialsSections(ctx context.Context, sections *ini.Sections, logger logging.Logger) error { + for _, section := range sections.List() { + // drop profiles with prefix for credential files + if strings.HasPrefix(section, profilePrefix) { + // drop this section, as invalid profile name + sections.DeleteSection(section) + + if logger != nil { + logger.Logf(logging.Debug, + "The profile defined with name `%v` is ignored. A profile with the `profile ` prefix is invalid "+ + "for the shared credentials file.\n", + section, + ) + } + } + } + return nil +} + +func loadIniFiles(filenames []string) (ini.Sections, error) { + mergedSections := ini.NewSections() + + for _, filename := range filenames { + sections, err := ini.OpenFile(filename) + var v *ini.UnableToReadFile + if ok := errors.As(err, &v); ok { + // Skip files which can't be opened and read for whatever reason. + // We treat such files as empty, and do not fall back to other locations. + continue + } else if err != nil { + return ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err} + } + + // mergeSections into mergedSections + err = mergeSections(&mergedSections, sections) + if err != nil { + return ini.Sections{}, SharedConfigLoadError{Filename: filename, Err: err} + } + } + + return mergedSections, nil +} + +// mergeSections merges source section properties into destination section properties +func mergeSections(dst *ini.Sections, src ini.Sections) error { + for _, sectionName := range src.List() { + srcSection, _ := src.GetSection(sectionName) + + if (!srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey)) || + (srcSection.Has(accessKeyIDKey) && !srcSection.Has(secretAccessKey)) { + srcSection.Errors = append(srcSection.Errors, + fmt.Errorf("partial credentials found for profile %v", sectionName)) + } + + if !dst.HasSection(sectionName) { + dst.SetSection(sectionName, srcSection) + continue + } + + // merge with destination srcSection + dstSection, _ := dst.GetSection(sectionName) + + // errors should be overriden if any + dstSection.Errors = srcSection.Errors + + // Access key id update + if srcSection.Has(accessKeyIDKey) && srcSection.Has(secretAccessKey) { + accessKey := srcSection.String(accessKeyIDKey) + secretKey := srcSection.String(secretAccessKey) + + if dstSection.Has(accessKeyIDKey) { + dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, accessKeyIDKey, + dstSection.SourceFile[accessKeyIDKey], srcSection.SourceFile[accessKeyIDKey])) + } + + // update access key + v, err := ini.NewStringValue(accessKey) + if err != nil { + return fmt.Errorf("error merging access key, %w", err) + } + dstSection.UpdateValue(accessKeyIDKey, v) + + // update secret key + v, err = ini.NewStringValue(secretKey) + if err != nil { + return fmt.Errorf("error merging secret key, %w", err) + } + dstSection.UpdateValue(secretAccessKey, v) + + // update session token + if err = mergeStringKey(&srcSection, &dstSection, sectionName, sessionTokenKey); err != nil { + return err + } + + // update source file to reflect where the static creds came from + dstSection.UpdateSourceFile(accessKeyIDKey, srcSection.SourceFile[accessKeyIDKey]) + dstSection.UpdateSourceFile(secretAccessKey, srcSection.SourceFile[secretAccessKey]) + } + + stringKeys := []string{ + roleArnKey, + sourceProfileKey, + credentialSourceKey, + externalIDKey, + mfaSerialKey, + roleSessionNameKey, + regionKey, + enableEndpointDiscoveryKey, + credentialProcessKey, + webIdentityTokenFileKey, + s3UseARNRegionKey, + s3DisableMultiRegionAccessPointsKey, + ec2MetadataServiceEndpointModeKey, + ec2MetadataServiceEndpointKey, + ec2MetadataV1DisabledKey, + useDualStackEndpoint, + useFIPSEndpointKey, + defaultsModeKey, + retryModeKey, + caBundleKey, + roleDurationSecondsKey, + retryMaxAttemptsKey, + + ssoSessionNameKey, + ssoAccountIDKey, + ssoRegionKey, + ssoRoleNameKey, + ssoStartURLKey, + } + for i := range stringKeys { + if err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil { + return err + } + } + + // set srcSection on dst srcSection + *dst = dst.SetSection(sectionName, dstSection) + } + + return nil +} + +func mergeStringKey(srcSection *ini.Section, dstSection *ini.Section, sectionName, key string) error { + if srcSection.Has(key) { + srcValue := srcSection.String(key) + val, err := ini.NewStringValue(srcValue) + if err != nil { + return fmt.Errorf("error merging %s, %w", key, err) + } + + if dstSection.Has(key) { + dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, key, + dstSection.SourceFile[key], srcSection.SourceFile[key])) + } + + dstSection.UpdateValue(key, val) + dstSection.UpdateSourceFile(key, srcSection.SourceFile[key]) + } + return nil +} + +func newMergeKeyLogMessage(sectionName, key, dstSourceFile, srcSourceFile string) string { + return fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ + "with a %v value found in a duplicate profile defined at file %v. \n", + sectionName, key, dstSourceFile, key, srcSourceFile) +} + +// Returns an error if all of the files fail to load. If at least one file is +// successfully loaded and contains the profile, no error will be returned. +func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile string, + sections ini.Sections, logger logging.Logger) error { + c.Profile = profile + + section, ok := sections.GetSection(profile) + if !ok { + return SharedConfigProfileNotExistError{ + Profile: profile, + } + } + + // if logs are appended to the section, log them + if section.Logs != nil && logger != nil { + for _, log := range section.Logs { + logger.Logf(logging.Debug, log) + } + } + + // set config from the provided INI section + err := c.setFromIniSection(profile, section) + if err != nil { + return fmt.Errorf("error fetching config from profile, %v, %w", profile, err) + } + + if _, ok := profiles[profile]; ok { + // if this is the second instance of the profile the Assume Role + // options must be cleared because they are only valid for the + // first reference of a profile. The self linked instance of the + // profile only have credential provider options. + c.clearAssumeRoleOptions() + } else { + // First time a profile has been seen. Assert if the credential type + // requires a role ARN, the ARN is also set + if err := c.validateCredentialsConfig(profile); err != nil { + return err + } + } + + // if not top level profile and has credentials, return with credentials. + if len(profiles) != 0 && c.Credentials.HasKeys() { + return nil + } + + profiles[profile] = struct{}{} + + // validate no colliding credentials type are present + if err := c.validateCredentialType(); err != nil { + return err + } + + // Link source profiles for assume roles + if len(c.SourceProfileName) != 0 { + // Linked profile via source_profile ignore credential provider + // options, the source profile must provide the credentials. + c.clearCredentialOptions() + + srcCfg := &SharedConfig{} + err := srcCfg.setFromIniSections(profiles, c.SourceProfileName, sections, logger) + if err != nil { + // SourceProfileName that doesn't exist is an error in configuration. + if _, ok := err.(SharedConfigProfileNotExistError); ok { + err = SharedConfigAssumeRoleError{ + RoleARN: c.RoleARN, + Profile: c.SourceProfileName, + Err: err, + } + } + return err + } + + if !srcCfg.hasCredentials() { + return SharedConfigAssumeRoleError{ + RoleARN: c.RoleARN, + Profile: c.SourceProfileName, + } + } + + c.Source = srcCfg + } + + // If the profile contains an SSO session parameter, the session MUST exist + // as a section in the config file. Load the SSO session using the name + // provided. If the session section is not found or incomplete an error + // will be returned. + if c.hasSSOTokenProviderConfiguration() { + section, ok := sections.GetSection(ssoSectionPrefix + strings.TrimSpace(c.SSOSessionName)) + if !ok { + return fmt.Errorf("failed to find SSO session section, %v", c.SSOSessionName) + } + var ssoSession SSOSession + ssoSession.setFromIniSection(section) + ssoSession.Name = c.SSOSessionName + c.SSOSession = &ssoSession + } + + if len(c.ServicesSectionName) > 0 { + if section, ok := sections.GetSection(servicesPrefix + c.ServicesSectionName); ok { + var svcs Services + svcs.setFromIniSection(section) + c.Services = svcs + } + } + + return nil +} + +// setFromIniSection loads the configuration from the profile section defined in +// the provided INI file. A SharedConfig pointer type value is used so that +// multiple config file loadings can be chained. +// +// Only loads complete logically grouped values, and will not set fields in cfg +// for incomplete grouped values in the config. Such as credentials. For example +// if a config file only includes aws_access_key_id but no aws_secret_access_key +// the aws_access_key_id will be ignored. +func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) error { + if len(section.Name) == 0 { + sources := make([]string, 0) + for _, v := range section.SourceFile { + sources = append(sources, v) + } + + return fmt.Errorf("parsing error : could not find profile section name after processing files: %v", sources) + } + + if len(section.Errors) != 0 { + var errStatement string + for i, e := range section.Errors { + errStatement = fmt.Sprintf("%d, %v\n", i+1, e.Error()) + } + return fmt.Errorf("Error using profile: \n %v", errStatement) + } + + // Assume Role + updateString(&c.RoleARN, section, roleArnKey) + updateString(&c.ExternalID, section, externalIDKey) + updateString(&c.MFASerial, section, mfaSerialKey) + updateString(&c.RoleSessionName, section, roleSessionNameKey) + updateString(&c.SourceProfileName, section, sourceProfileKey) + updateString(&c.CredentialSource, section, credentialSourceKey) + updateString(&c.Region, section, regionKey) + + // AWS Single Sign-On (AWS SSO) + // SSO session options + updateString(&c.SSOSessionName, section, ssoSessionNameKey) + + // Legacy SSO session options + updateString(&c.SSORegion, section, ssoRegionKey) + updateString(&c.SSOStartURL, section, ssoStartURLKey) + + // SSO fields not used + updateString(&c.SSOAccountID, section, ssoAccountIDKey) + updateString(&c.SSORoleName, section, ssoRoleNameKey) + + // we're retaining a behavioral quirk with this field that existed before + // the removal of literal parsing for #2276: + // - if the key is missing, the config field will not be set + // - if the key is set to a non-numeric, the config field will be set to 0 + if section.Has(roleDurationSecondsKey) { + if v, ok := section.Int(roleDurationSecondsKey); ok { + c.RoleDurationSeconds = aws.Duration(time.Duration(v) * time.Second) + } else { + c.RoleDurationSeconds = aws.Duration(time.Duration(0)) + } + } + + updateString(&c.CredentialProcess, section, credentialProcessKey) + updateString(&c.WebIdentityTokenFile, section, webIdentityTokenFileKey) + + updateEndpointDiscoveryType(&c.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) + updateBoolPtr(&c.S3UseARNRegion, section, s3UseARNRegionKey) + updateBoolPtr(&c.S3DisableMultiRegionAccessPoints, section, s3DisableMultiRegionAccessPointsKey) + updateBoolPtr(&c.S3DisableExpressAuth, section, s3DisableExpressSessionAuthKey) + + if err := updateEC2MetadataServiceEndpointMode(&c.EC2IMDSEndpointMode, section, ec2MetadataServiceEndpointModeKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %v", ec2MetadataServiceEndpointModeKey, err) + } + updateString(&c.EC2IMDSEndpoint, section, ec2MetadataServiceEndpointKey) + updateBoolPtr(&c.EC2IMDSv1Disabled, section, ec2MetadataV1DisabledKey) + + updateUseDualStackEndpoint(&c.UseDualStackEndpoint, section, useDualStackEndpoint) + updateUseFIPSEndpoint(&c.UseFIPSEndpoint, section, useFIPSEndpointKey) + + if err := updateDefaultsMode(&c.DefaultsMode, section, defaultsModeKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", defaultsModeKey, err) + } + + if err := updateInt(&c.RetryMaxAttempts, section, retryMaxAttemptsKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", retryMaxAttemptsKey, err) + } + if err := updateRetryMode(&c.RetryMode, section, retryModeKey); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", retryModeKey, err) + } + + updateString(&c.CustomCABundle, section, caBundleKey) + + // user agent app ID added to request User-Agent header + updateString(&c.AppID, section, sdkAppID) + + updateBoolPtr(&c.IgnoreConfiguredEndpoints, section, ignoreConfiguredEndpoints) + + updateString(&c.BaseEndpoint, section, endpointURL) + + if err := updateDisableRequestCompression(&c.DisableRequestCompression, section, disableRequestCompression); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", disableRequestCompression, err) + } + if err := updateRequestMinCompressSizeBytes(&c.RequestMinCompressSizeBytes, section, requestMinCompressionSizeBytes); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", requestMinCompressionSizeBytes, err) + } + + if err := updateAIDEndpointMode(&c.AccountIDEndpointMode, section, accountIDEndpointMode); err != nil { + return fmt.Errorf("failed to load %s from shared config, %w", accountIDEndpointMode, err) + } + + // Shared Credentials + creds := aws.Credentials{ + AccessKeyID: section.String(accessKeyIDKey), + SecretAccessKey: section.String(secretAccessKey), + SessionToken: section.String(sessionTokenKey), + Source: fmt.Sprintf("SharedConfigCredentials: %s", section.SourceFile[accessKeyIDKey]), + AccountID: section.String(accountIDKey), + } + + if creds.HasKeys() { + c.Credentials = creds + } + + updateString(&c.ServicesSectionName, section, servicesSectionKey) + + return nil +} + +func updateRequestMinCompressSizeBytes(bytes **int64, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v, ok := sec.Int(key) + if !ok { + return fmt.Errorf("invalid value for min request compression size bytes %s, need int64", sec.String(key)) + } + if v < 0 || v > smithyrequestcompression.MaxRequestMinCompressSizeBytes { + return fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", v) + } + *bytes = new(int64) + **bytes = v + return nil +} + +func updateDisableRequestCompression(disable **bool, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v := sec.String(key) + switch { + case v == "true": + *disable = new(bool) + **disable = true + case v == "false": + *disable = new(bool) + **disable = false + default: + return fmt.Errorf("invalid value for shared config profile field, %s=%s, need true or false", key, v) + } + return nil +} + +func updateAIDEndpointMode(m *aws.AccountIDEndpointMode, sec ini.Section, key string) error { + if !sec.Has(key) { + return nil + } + + v := sec.String(key) + switch v { + case "preferred": + *m = aws.AccountIDEndpointModePreferred + case "required": + *m = aws.AccountIDEndpointModeRequired + case "disabled": + *m = aws.AccountIDEndpointModeDisabled + default: + return fmt.Errorf("invalid value for shared config profile field, %s=%s, must be preferred/required/disabled", key, v) + } + + return nil +} + +func (c SharedConfig) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) { + if c.RequestMinCompressSizeBytes == nil { + return 0, false, nil + } + return *c.RequestMinCompressSizeBytes, true, nil +} + +func (c SharedConfig) getDisableRequestCompression(ctx context.Context) (bool, bool, error) { + if c.DisableRequestCompression == nil { + return false, false, nil + } + return *c.DisableRequestCompression, true, nil +} + +func (c SharedConfig) getAccountIDEndpointMode(ctx context.Context) (aws.AccountIDEndpointMode, bool, error) { + return c.AccountIDEndpointMode, len(c.AccountIDEndpointMode) > 0, nil +} + +func updateDefaultsMode(mode *aws.DefaultsMode, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + value := section.String(key) + if ok := mode.SetFromString(value); !ok { + return fmt.Errorf("invalid value: %s", value) + } + return nil +} + +func updateRetryMode(mode *aws.RetryMode, section ini.Section, key string) (err error) { + if !section.Has(key) { + return nil + } + value := section.String(key) + if *mode, err = aws.ParseRetryMode(value); err != nil { + return err + } + return nil +} + +func updateEC2MetadataServiceEndpointMode(endpointMode *imds.EndpointModeState, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + value := section.String(key) + return endpointMode.SetFromString(value) +} + +func (c *SharedConfig) validateCredentialsConfig(profile string) error { + if err := c.validateCredentialsRequireARN(profile); err != nil { + return err + } + + return nil +} + +func (c *SharedConfig) validateCredentialsRequireARN(profile string) error { + var credSource string + + switch { + case len(c.SourceProfileName) != 0: + credSource = sourceProfileKey + case len(c.CredentialSource) != 0: + credSource = credentialSourceKey + case len(c.WebIdentityTokenFile) != 0: + credSource = webIdentityTokenFileKey + } + + if len(credSource) != 0 && len(c.RoleARN) == 0 { + return CredentialRequiresARNError{ + Type: credSource, + Profile: profile, + } + } + + return nil +} + +func (c *SharedConfig) validateCredentialType() error { + // Only one or no credential type can be defined. + if !oneOrNone( + len(c.SourceProfileName) != 0, + len(c.CredentialSource) != 0, + len(c.CredentialProcess) != 0, + len(c.WebIdentityTokenFile) != 0, + ) { + return fmt.Errorf("only one credential type may be specified per profile: source profile, credential source, credential process, web identity token") + } + + return nil +} + +func (c *SharedConfig) validateSSOConfiguration() error { + if c.hasSSOTokenProviderConfiguration() { + err := c.validateSSOTokenProviderConfiguration() + if err != nil { + return err + } + return nil + } + + if c.hasLegacySSOConfiguration() { + err := c.validateLegacySSOConfiguration() + if err != nil { + return err + } + } + return nil +} + +func (c *SharedConfig) validateSSOTokenProviderConfiguration() error { + var missing []string + + if len(c.SSOSessionName) == 0 { + missing = append(missing, ssoSessionNameKey) + } + + if c.SSOSession == nil { + missing = append(missing, ssoSectionPrefix) + } else { + if len(c.SSOSession.SSORegion) == 0 { + missing = append(missing, ssoRegionKey) + } + + if len(c.SSOSession.SSOStartURL) == 0 { + missing = append(missing, ssoStartURLKey) + } + } + + if len(missing) > 0 { + return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", + c.Profile, strings.Join(missing, ", ")) + } + + if len(c.SSORegion) > 0 && c.SSORegion != c.SSOSession.SSORegion { + return fmt.Errorf("%s in profile %q must match %s in %s", ssoRegionKey, c.Profile, ssoRegionKey, ssoSectionPrefix) + } + + if len(c.SSOStartURL) > 0 && c.SSOStartURL != c.SSOSession.SSOStartURL { + return fmt.Errorf("%s in profile %q must match %s in %s", ssoStartURLKey, c.Profile, ssoStartURLKey, ssoSectionPrefix) + } + + return nil +} + +func (c *SharedConfig) validateLegacySSOConfiguration() error { + var missing []string + + if len(c.SSORegion) == 0 { + missing = append(missing, ssoRegionKey) + } + + if len(c.SSOStartURL) == 0 { + missing = append(missing, ssoStartURLKey) + } + + if len(c.SSOAccountID) == 0 { + missing = append(missing, ssoAccountIDKey) + } + + if len(c.SSORoleName) == 0 { + missing = append(missing, ssoRoleNameKey) + } + + if len(missing) > 0 { + return fmt.Errorf("profile %q is configured to use SSO but is missing required configuration: %s", + c.Profile, strings.Join(missing, ", ")) + } + return nil +} + +func (c *SharedConfig) hasCredentials() bool { + switch { + case len(c.SourceProfileName) != 0: + case len(c.CredentialSource) != 0: + case len(c.CredentialProcess) != 0: + case len(c.WebIdentityTokenFile) != 0: + case c.hasSSOConfiguration(): + case c.Credentials.HasKeys(): + default: + return false + } + + return true +} + +func (c *SharedConfig) hasSSOConfiguration() bool { + return c.hasSSOTokenProviderConfiguration() || c.hasLegacySSOConfiguration() +} + +func (c *SharedConfig) hasSSOTokenProviderConfiguration() bool { + return len(c.SSOSessionName) > 0 +} + +func (c *SharedConfig) hasLegacySSOConfiguration() bool { + return len(c.SSORegion) > 0 || len(c.SSOAccountID) > 0 || len(c.SSOStartURL) > 0 || len(c.SSORoleName) > 0 +} + +func (c *SharedConfig) clearAssumeRoleOptions() { + c.RoleARN = "" + c.ExternalID = "" + c.MFASerial = "" + c.RoleSessionName = "" + c.SourceProfileName = "" +} + +func (c *SharedConfig) clearCredentialOptions() { + c.CredentialSource = "" + c.CredentialProcess = "" + c.WebIdentityTokenFile = "" + c.Credentials = aws.Credentials{} + c.SSOAccountID = "" + c.SSORegion = "" + c.SSORoleName = "" + c.SSOStartURL = "" +} + +// SharedConfigLoadError is an error for the shared config file failed to load. +type SharedConfigLoadError struct { + Filename string + Err error +} + +// Unwrap returns the underlying error that caused the failure. +func (e SharedConfigLoadError) Unwrap() error { + return e.Err +} + +func (e SharedConfigLoadError) Error() string { + return fmt.Sprintf("failed to load shared config file, %s, %v", e.Filename, e.Err) +} + +// SharedConfigProfileNotExistError is an error for the shared config when +// the profile was not find in the config file. +type SharedConfigProfileNotExistError struct { + Filename []string + Profile string + Err error +} + +// Unwrap returns the underlying error that caused the failure. +func (e SharedConfigProfileNotExistError) Unwrap() error { + return e.Err +} + +func (e SharedConfigProfileNotExistError) Error() string { + return fmt.Sprintf("failed to get shared config profile, %s", e.Profile) +} + +// SharedConfigAssumeRoleError is an error for the shared config when the +// profile contains assume role information, but that information is invalid +// or not complete. +type SharedConfigAssumeRoleError struct { + Profile string + RoleARN string + Err error +} + +// Unwrap returns the underlying error that caused the failure. +func (e SharedConfigAssumeRoleError) Unwrap() error { + return e.Err +} + +func (e SharedConfigAssumeRoleError) Error() string { + return fmt.Sprintf("failed to load assume role %s, of profile %s, %v", + e.RoleARN, e.Profile, e.Err) +} + +// CredentialRequiresARNError provides the error for shared config credentials +// that are incorrectly configured in the shared config or credentials file. +type CredentialRequiresARNError struct { + // type of credentials that were configured. + Type string + + // Profile name the credentials were in. + Profile string +} + +// Error satisfies the error interface. +func (e CredentialRequiresARNError) Error() string { + return fmt.Sprintf( + "credential type %s requires role_arn, profile %s", + e.Type, e.Profile, + ) +} + +func oneOrNone(bs ...bool) bool { + var count int + + for _, b := range bs { + if b { + count++ + if count > 1 { + return false + } + } + } + + return true +} + +// updateString will only update the dst with the value in the section key, key +// is present in the section. +func updateString(dst *string, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.String(key) +} + +// updateInt will only update the dst with the value in the section key, key +// is present in the section. +// +// Down casts the INI integer value from a int64 to an int, which could be +// different bit size depending on platform. +func updateInt(dst *int, section ini.Section, key string) error { + if !section.Has(key) { + return nil + } + + v, ok := section.Int(key) + if !ok { + return fmt.Errorf("invalid value %s=%s, expect integer", key, section.String(key)) + } + + *dst = int(v) + return nil +} + +// updateBool will only update the dst with the value in the section key, key +// is present in the section. +func updateBool(dst *bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) + *dst = v +} + +// updateBoolPtr will only update the dst with the value in the section key, +// key is present in the section. +func updateBoolPtr(dst **bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) + *dst = new(bool) + **dst = v +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateEndpointDiscoveryType(dst *aws.EndpointDiscoveryEnableState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + value := section.String(key) + if len(value) == 0 { + return + } + + switch { + case strings.EqualFold(value, endpointDiscoveryDisabled): + *dst = aws.EndpointDiscoveryDisabled + case strings.EqualFold(value, endpointDiscoveryEnabled): + *dst = aws.EndpointDiscoveryEnabled + case strings.EqualFold(value, endpointDiscoveryAuto): + *dst = aws.EndpointDiscoveryAuto + } +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateUseDualStackEndpoint(dst *aws.DualStackEndpointState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { + *dst = aws.DualStackEndpointStateEnabled + } else { + *dst = aws.DualStackEndpointStateDisabled + } + + return +} + +// updateEndpointDiscoveryType will only update the dst with the value in the section, if +// a valid key and corresponding EndpointDiscoveryType is found. +func updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key string) { + if !section.Has(key) { + return + } + + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { + *dst = aws.FIPSEndpointStateEnabled + } else { + *dst = aws.FIPSEndpointStateDisabled + } + + return +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 65c8de85..67843c31 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,272 @@ +# v1.17.48 (2024-12-19) + +* **Bug Fix**: Fix improper use of printf-style functions. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.47 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.46 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.45 (2024-11-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.44 (2024-11-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.43 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.42 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.41 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.40 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.39 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.38 (2024-10-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.37 (2024-09-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.36 (2024-09-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.35 (2024-09-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.34 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.33 (2024-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.32 (2024-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.31 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.30 (2024-08-26) + +* **Bug Fix**: Save SSO cached token expiry in UTC to ensure cross-SDK compatibility. + +# v1.17.29 (2024-08-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.28 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.27 (2024-07-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.26 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.25 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.24 (2024-07-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.23 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.22 (2024-06-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.21 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.20 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.19 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.18 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.17 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.16 (2024-05-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.15 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.14 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.13 (2024-05-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.12 (2024-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.11 (2024-04-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.10 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.9 (2024-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.8 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.7 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2024-03-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2024-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2024-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.16 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.14 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2023-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2023-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2023-12-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2023-11-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2023-11-21) + +* **Bug Fix**: Don't expect error responses to have a JSON payload in the endpointcreds provider. + +# v1.16.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2023-11-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-11-14) + +* **Feature**: Add support for dynamic auth token from file and EKS container host in absolute/relative URIs in the HTTP credential provider. + # v1.15.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go new file mode 100644 index 00000000..6ed71b42 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.go @@ -0,0 +1,58 @@ +// Package ec2rolecreds provides the credentials provider implementation for +// retrieving AWS credentials from Amazon EC2 Instance Roles via Amazon EC2 IMDS. +// +// # Concurrency and caching +// +// The Provider is not safe to be used concurrently, and does not provide any +// caching of credentials retrieved. You should wrap the Provider with a +// `aws.CredentialsCache` to provide concurrency safety, and caching of +// credentials. +// +// # Loading credentials with the SDK's AWS Config +// +// The EC2 Instance role credentials provider will automatically be the resolved +// credential provider in the credential chain if no other credential provider is +// resolved first. +// +// To explicitly instruct the SDK's credentials resolving to use the EC2 Instance +// role for credentials, you specify a `credentials_source` property in the config +// profile the SDK will load. +// +// [default] +// credential_source = Ec2InstanceMetadata +// +// # Loading credentials with the Provider directly +// +// Another way to use the EC2 Instance role credentials provider is to create it +// directly and assign it as the credentials provider for an API client. +// +// The following example creates a credentials provider for a command, and wraps +// it with the CredentialsCache before assigning the provider to the Amazon S3 API +// client's Credentials option. +// +// provider := imds.New(imds.Options{}) +// +// // Create the service client value configured for credentials. +// svc := s3.New(s3.Options{ +// Credentials: aws.NewCredentialsCache(provider), +// }) +// +// If you need more control, you can set the configuration options on the +// credentials provider using the imds.Options type to configure the EC2 IMDS +// API Client and ExpiryWindow of the retrieved credentials. +// +// provider := imds.New(imds.Options{ +// // See imds.Options type's documentation for more options available. +// Client: imds.New(Options{ +// HTTPClient: customHTTPClient, +// }), +// +// // Modify how soon credentials expire prior to their original expiry time. +// ExpiryWindow: 5 * time.Minute, +// }) +// +// # EC2 IMDS API Client +// +// See the github.com/aws/aws-sdk-go-v2/feature/ec2/imds module for more details on +// configuring the client, and options available. +package ec2rolecreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go new file mode 100644 index 00000000..5c699f16 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.go @@ -0,0 +1,229 @@ +package ec2rolecreds + +import ( + "bufio" + "context" + "encoding/json" + "fmt" + "math" + "path" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + sdkrand "github.com/aws/aws-sdk-go-v2/internal/rand" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" +) + +// ProviderName provides a name of EC2Role provider +const ProviderName = "EC2RoleProvider" + +// GetMetadataAPIClient provides the interface for an EC2 IMDS API client for the +// GetMetadata operation. +type GetMetadataAPIClient interface { + GetMetadata(context.Context, *imds.GetMetadataInput, ...func(*imds.Options)) (*imds.GetMetadataOutput, error) +} + +// A Provider retrieves credentials from the EC2 service, and keeps track if +// those credentials are expired. +// +// The New function must be used to create the with a custom EC2 IMDS client. +// +// p := &ec2rolecreds.New(func(o *ec2rolecreds.Options{ +// o.Client = imds.New(imds.Options{/* custom options */}) +// }) +type Provider struct { + options Options +} + +// Options is a list of user settable options for setting the behavior of the Provider. +type Options struct { + // The API client that will be used by the provider to make GetMetadata API + // calls to EC2 IMDS. + // + // If nil, the provider will default to the EC2 IMDS client. + Client GetMetadataAPIClient +} + +// New returns an initialized Provider value configured to retrieve +// credentials from EC2 Instance Metadata service. +func New(optFns ...func(*Options)) *Provider { + options := Options{} + + for _, fn := range optFns { + fn(&options) + } + + if options.Client == nil { + options.Client = imds.New(imds.Options{}) + } + + return &Provider{ + options: options, + } +} + +// Retrieve retrieves credentials from the EC2 service. Error will be returned +// if the request fails, or unable to extract the desired credentials. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + credsList, err := requestCredList(ctx, p.options.Client) + if err != nil { + return aws.Credentials{Source: ProviderName}, err + } + + if len(credsList) == 0 { + return aws.Credentials{Source: ProviderName}, + fmt.Errorf("unexpected empty EC2 IMDS role list") + } + credsName := credsList[0] + + roleCreds, err := requestCred(ctx, p.options.Client, credsName) + if err != nil { + return aws.Credentials{Source: ProviderName}, err + } + + creds := aws.Credentials{ + AccessKeyID: roleCreds.AccessKeyID, + SecretAccessKey: roleCreds.SecretAccessKey, + SessionToken: roleCreds.Token, + Source: ProviderName, + + CanExpire: true, + Expires: roleCreds.Expiration, + } + + // Cap role credentials Expires to 1 hour so they can be refreshed more + // often. Jitter will be applied credentials cache if being used. + if anHour := sdk.NowTime().Add(1 * time.Hour); creds.Expires.After(anHour) { + creds.Expires = anHour + } + + return creds, nil +} + +// HandleFailToRefresh will extend the credentials Expires time if it it is +// expired. If the credentials will not expire within the minimum time, they +// will be returned. +// +// If the credentials cannot expire, the original error will be returned. +func (p *Provider) HandleFailToRefresh(ctx context.Context, prevCreds aws.Credentials, err error) ( + aws.Credentials, error, +) { + if !prevCreds.CanExpire { + return aws.Credentials{}, err + } + + if prevCreds.Expires.After(sdk.NowTime().Add(5 * time.Minute)) { + return prevCreds, nil + } + + newCreds := prevCreds + randFloat64, err := sdkrand.CryptoRandFloat64() + if err != nil { + return aws.Credentials{}, fmt.Errorf("failed to get random float, %w", err) + } + + // Random distribution of [5,15) minutes. + expireOffset := time.Duration(randFloat64*float64(10*time.Minute)) + 5*time.Minute + newCreds.Expires = sdk.NowTime().Add(expireOffset) + + logger := middleware.GetLogger(ctx) + logger.Logf(logging.Warn, "Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted again in %v minutes.", math.Floor(expireOffset.Minutes())) + + return newCreds, nil +} + +// AdjustExpiresBy will adds the passed in duration to the passed in +// credential's Expires time, unless the time until Expires is less than 15 +// minutes. Returns the credentials, even if not updated. +func (p *Provider) AdjustExpiresBy(creds aws.Credentials, dur time.Duration) ( + aws.Credentials, error, +) { + if !creds.CanExpire { + return creds, nil + } + if creds.Expires.Before(sdk.NowTime().Add(15 * time.Minute)) { + return creds, nil + } + + creds.Expires = creds.Expires.Add(dur) + return creds, nil +} + +// ec2RoleCredRespBody provides the shape for unmarshaling credential +// request responses. +type ec2RoleCredRespBody struct { + // Success State + Expiration time.Time + AccessKeyID string + SecretAccessKey string + Token string + + // Error state + Code string + Message string +} + +const iamSecurityCredsPath = "/iam/security-credentials/" + +// requestCredList requests a list of credentials from the EC2 service. If +// there are no credentials, or there is an error making or receiving the +// request +func requestCredList(ctx context.Context, client GetMetadataAPIClient) ([]string, error) { + resp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{ + Path: iamSecurityCredsPath, + }) + if err != nil { + return nil, fmt.Errorf("no EC2 IMDS role found, %w", err) + } + defer resp.Content.Close() + + credsList := []string{} + s := bufio.NewScanner(resp.Content) + for s.Scan() { + credsList = append(credsList, s.Text()) + } + + if err := s.Err(); err != nil { + return nil, fmt.Errorf("failed to read EC2 IMDS role, %w", err) + } + + return credsList, nil +} + +// requestCred requests the credentials for a specific credentials from the EC2 service. +// +// If the credentials cannot be found, or there is an error reading the response +// and error will be returned. +func requestCred(ctx context.Context, client GetMetadataAPIClient, credsName string) (ec2RoleCredRespBody, error) { + resp, err := client.GetMetadata(ctx, &imds.GetMetadataInput{ + Path: path.Join(iamSecurityCredsPath, credsName), + }) + if err != nil { + return ec2RoleCredRespBody{}, + fmt.Errorf("failed to get %s EC2 IMDS role credentials, %w", + credsName, err) + } + defer resp.Content.Close() + + var respCreds ec2RoleCredRespBody + if err := json.NewDecoder(resp.Content).Decode(&respCreds); err != nil { + return ec2RoleCredRespBody{}, + fmt.Errorf("failed to decode %s EC2 IMDS role credentials, %w", + credsName, err) + } + + if !strings.EqualFold(respCreds.Code, "Success") { + // If an error code was returned something failed requesting the role. + return ec2RoleCredRespBody{}, + fmt.Errorf("failed to get %s EC2 IMDS role credentials, %w", + credsName, + &smithy.GenericAPIError{Code: respCreds.Code, Message: respCreds.Message}) + } + + return respCreds, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go new file mode 100644 index 00000000..c3f5dadc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.go @@ -0,0 +1,48 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go new file mode 100644 index 00000000..dc291c97 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.go @@ -0,0 +1,165 @@ +package client + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + "github.com/aws/smithy-go" + smithymiddleware "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// ServiceID is the client identifer +const ServiceID = "endpoint-credentials" + +// HTTPClient is a client for sending HTTP requests +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Options is the endpoint client configurable options +type Options struct { + // The endpoint to retrieve credentials from + Endpoint string + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // Set of options to modify how the credentials operation is invoked. + APIOptions []func(*smithymiddleware.Stack) error +} + +// Copy creates a copy of the API options. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*smithymiddleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + return to +} + +// Client is an client for retrieving AWS credentials from an endpoint +type Client struct { + options Options +} + +// New constructs a new Client from the given options +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + if options.HTTPClient == nil { + options.HTTPClient = awshttp.NewBuildableClient() + } + + if options.Retryer == nil { + // Amazon-owned implementations of this endpoint are known to sometimes + // return plaintext responses (i.e. no Code) like normal, add a few + // additional status codes + options.Retryer = retry.NewStandard(func(o *retry.StandardOptions) { + o.Retryables = append(o.Retryables, retry.RetryableHTTPStatusCode{ + Codes: map[int]struct{}{ + http.StatusTooManyRequests: {}, + }, + }) + }) + } + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +// GetCredentialsInput is the input to send with the endpoint service to receive credentials. +type GetCredentialsInput struct { + AuthorizationToken string +} + +// GetCredentials retrieves credentials from credential endpoint +func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput, optFns ...func(*Options)) (*GetCredentialsOutput, error) { + stack := smithymiddleware.NewStack("GetCredentials", smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + stack.Serialize.Add(&serializeOpGetCredential{}, smithymiddleware.After) + stack.Build.Add(&buildEndpoint{Endpoint: options.Endpoint}, smithymiddleware.After) + stack.Deserialize.Add(&deserializeOpGetCredential{}, smithymiddleware.After) + addProtocolFinalizerMiddlewares(stack, options, "GetCredentials") + retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{Retryer: options.Retryer}) + middleware.AddSDKAgentKey(middleware.FeatureMetadata, ServiceID) + smithyhttp.AddErrorCloseResponseBodyMiddleware(stack) + smithyhttp.AddCloseResponseBodyMiddleware(stack) + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, err + } + } + + handler := smithymiddleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, _, err := handler.Handle(ctx, params) + if err != nil { + return nil, err + } + + return result.(*GetCredentialsOutput), err +} + +// GetCredentialsOutput is the response from the credential endpoint +type GetCredentialsOutput struct { + Expiration *time.Time + AccessKeyID string + SecretAccessKey string + Token string + AccountID string +} + +// EndpointError is an error returned from the endpoint service +type EndpointError struct { + Code string `json:"code"` + Message string `json:"message"` + Fault smithy.ErrorFault `json:"-"` + statusCode int `json:"-"` +} + +// Error is the error mesage string +func (e *EndpointError) Error() string { + return fmt.Sprintf("%s: %s", e.Code, e.Message) +} + +// ErrorCode is the error code returned by the endpoint +func (e *EndpointError) ErrorCode() string { + return e.Code +} + +// ErrorMessage is the error message returned by the endpoint +func (e *EndpointError) ErrorMessage() string { + return e.Message +} + +// ErrorFault indicates error fault classification +func (e *EndpointError) ErrorFault() smithy.ErrorFault { + return e.Fault +} + +// HTTPStatusCode implements retry.HTTPStatusCode. +func (e *EndpointError) HTTPStatusCode() int { + return e.statusCode +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go new file mode 100644 index 00000000..748ee672 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.go @@ -0,0 +1,20 @@ +package client + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go new file mode 100644 index 00000000..f2820d20 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.go @@ -0,0 +1,164 @@ +package client + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/url" + + "github.com/aws/smithy-go" + smithymiddleware "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type buildEndpoint struct { + Endpoint string +} + +func (b *buildEndpoint) ID() string { + return "BuildEndpoint" +} + +func (b *buildEndpoint) HandleBuild(ctx context.Context, in smithymiddleware.BuildInput, next smithymiddleware.BuildHandler) ( + out smithymiddleware.BuildOutput, metadata smithymiddleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport, %T", in.Request) + } + + if len(b.Endpoint) == 0 { + return out, metadata, fmt.Errorf("endpoint not provided") + } + + parsed, err := url.Parse(b.Endpoint) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint, %w", err) + } + + request.URL = parsed + + return next.HandleBuild(ctx, in) +} + +type serializeOpGetCredential struct{} + +func (s *serializeOpGetCredential) ID() string { + return "OperationSerializer" +} + +func (s *serializeOpGetCredential) HandleSerialize(ctx context.Context, in smithymiddleware.SerializeInput, next smithymiddleware.SerializeHandler) ( + out smithymiddleware.SerializeOutput, metadata smithymiddleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type, %T", in.Request) + } + + params, ok := in.Parameters.(*GetCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters, %T", in.Parameters) + } + + const acceptHeader = "Accept" + request.Header[acceptHeader] = append(request.Header[acceptHeader][:0], "application/json") + + if len(params.AuthorizationToken) > 0 { + const authHeader = "Authorization" + request.Header[authHeader] = append(request.Header[authHeader][:0], params.AuthorizationToken) + } + + return next.HandleSerialize(ctx, in) +} + +type deserializeOpGetCredential struct{} + +func (d *deserializeOpGetCredential) ID() string { + return "OperationDeserializer" +} + +func (d *deserializeOpGetCredential) HandleDeserialize(ctx context.Context, in smithymiddleware.DeserializeInput, next smithymiddleware.DeserializeHandler) ( + out smithymiddleware.DeserializeOutput, metadata smithymiddleware.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, deserializeError(response) + } + + var shape *GetCredentialsOutput + if err = json.NewDecoder(response.Body).Decode(&shape); err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize json response, %w", err)} + } + + out.Result = shape + return out, metadata, err +} + +func deserializeError(response *smithyhttp.Response) error { + // we could be talking to anything, json isn't guaranteed + // see https://github.com/aws/aws-sdk-go-v2/issues/2316 + if response.Header.Get("Content-Type") == "application/json" { + return deserializeJSONError(response) + } + + msg, err := io.ReadAll(response.Body) + if err != nil { + return &smithy.DeserializationError{ + Err: fmt.Errorf("read response, %w", err), + } + } + + return &EndpointError{ + // no sensible value for Code + Message: string(msg), + Fault: stof(response.StatusCode), + statusCode: response.StatusCode, + } +} + +func deserializeJSONError(response *smithyhttp.Response) error { + var errShape *EndpointError + if err := json.NewDecoder(response.Body).Decode(&errShape); err != nil { + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode error message, %w", err), + } + } + + errShape.Fault = stof(response.StatusCode) + errShape.statusCode = response.StatusCode + return errShape +} + +// maps HTTP status code to smithy ErrorFault +func stof(code int) smithy.ErrorFault { + if code >= 500 { + return smithy.FaultServer + } + return smithy.FaultClient +} + +func addProtocolFinalizerMiddlewares(stack *smithymiddleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, smithymiddleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", smithymiddleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", smithymiddleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", smithymiddleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go new file mode 100644 index 00000000..2386153a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.go @@ -0,0 +1,193 @@ +// Package endpointcreds provides support for retrieving credentials from an +// arbitrary HTTP endpoint. +// +// The credentials endpoint Provider can receive both static and refreshable +// credentials that will expire. Credentials are static when an "Expiration" +// value is not provided in the endpoint's response. +// +// Static credentials will never expire once they have been retrieved. The format +// of the static credentials response: +// +// { +// "AccessKeyId" : "MUA...", +// "SecretAccessKey" : "/7PC5om....", +// } +// +// Refreshable credentials will expire within the "ExpiryWindow" of the Expiration +// value in the response. The format of the refreshable credentials response: +// +// { +// "AccessKeyId" : "MUA...", +// "SecretAccessKey" : "/7PC5om....", +// "Token" : "AQoDY....=", +// "Expiration" : "2016-02-25T06:03:31Z" +// } +// +// Errors should be returned in the following format and only returned with 400 +// or 500 HTTP status codes. +// +// { +// "code": "ErrorCode", +// "message": "Helpful error message." +// } +package endpointcreds + +import ( + "context" + "fmt" + "net/http" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client" + "github.com/aws/smithy-go/middleware" +) + +// ProviderName is the name of the credentials provider. +const ProviderName = `CredentialsEndpointProvider` + +type getCredentialsAPIClient interface { + GetCredentials(context.Context, *client.GetCredentialsInput, ...func(*client.Options)) (*client.GetCredentialsOutput, error) +} + +// Provider satisfies the aws.CredentialsProvider interface, and is a client to +// retrieve credentials from an arbitrary endpoint. +type Provider struct { + // The AWS Client to make HTTP requests to the endpoint with. The endpoint + // the request will be made to is provided by the aws.Config's + // EndpointResolver. + client getCredentialsAPIClient + + options Options +} + +// HTTPClient is a client for sending HTTP requests +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Options is structure of configurable options for Provider +type Options struct { + // Endpoint to retrieve credentials from. Required + Endpoint string + + // HTTPClient to handle sending HTTP requests to the target endpoint. + HTTPClient HTTPClient + + // Set of options to modify how the credentials operation is invoked. + APIOptions []func(*middleware.Stack) error + + // The Retryer to be used for determining whether a failed requested should be retried + Retryer aws.Retryer + + // Optional authorization token value if set will be used as the value of + // the Authorization header of the endpoint credential request. + // + // When constructed from environment, the provider will use the value of + // AWS_CONTAINER_AUTHORIZATION_TOKEN environment variable as the token + // + // Will be overridden if AuthorizationTokenProvider is configured + AuthorizationToken string + + // Optional auth provider func to dynamically load the auth token from a file + // everytime a credential is retrieved + // + // When constructed from environment, the provider will read and use the content + // of the file pointed to by AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE environment variable + // as the auth token everytime credentials are retrieved + // + // Will override AuthorizationToken if configured + AuthorizationTokenProvider AuthTokenProvider +} + +// AuthTokenProvider defines an interface to dynamically load a value to be passed +// for the Authorization header of a credentials request. +type AuthTokenProvider interface { + GetToken() (string, error) +} + +// TokenProviderFunc is a func type implementing AuthTokenProvider interface +// and enables customizing token provider behavior +type TokenProviderFunc func() (string, error) + +// GetToken func retrieves auth token according to TokenProviderFunc implementation +func (p TokenProviderFunc) GetToken() (string, error) { + return p() +} + +// New returns a credentials Provider for retrieving AWS credentials +// from arbitrary endpoint. +func New(endpoint string, optFns ...func(*Options)) *Provider { + o := Options{ + Endpoint: endpoint, + } + + for _, fn := range optFns { + fn(&o) + } + + p := &Provider{ + client: client.New(client.Options{ + HTTPClient: o.HTTPClient, + Endpoint: o.Endpoint, + APIOptions: o.APIOptions, + Retryer: o.Retryer, + }), + options: o, + } + + return p +} + +// Retrieve will attempt to request the credentials from the endpoint the Provider +// was configured for. And error will be returned if the retrieval fails. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + resp, err := p.getCredentials(ctx) + if err != nil { + return aws.Credentials{}, fmt.Errorf("failed to load credentials, %w", err) + } + + creds := aws.Credentials{ + AccessKeyID: resp.AccessKeyID, + SecretAccessKey: resp.SecretAccessKey, + SessionToken: resp.Token, + Source: ProviderName, + AccountID: resp.AccountID, + } + + if resp.Expiration != nil { + creds.CanExpire = true + creds.Expires = *resp.Expiration + } + + return creds, nil +} + +func (p *Provider) getCredentials(ctx context.Context) (*client.GetCredentialsOutput, error) { + authToken, err := p.resolveAuthToken() + if err != nil { + return nil, fmt.Errorf("resolve auth token: %v", err) + } + + return p.client.GetCredentials(ctx, &client.GetCredentialsInput{ + AuthorizationToken: authToken, + }) +} + +func (p *Provider) resolveAuthToken() (string, error) { + authToken := p.options.AuthorizationToken + + var err error + if p.options.AuthorizationTokenProvider != nil { + authToken, err = p.options.AuthorizationTokenProvider.GetToken() + if err != nil { + return "", err + } + } + + if strings.ContainsAny(authToken, "\r\n") { + return "", fmt.Errorf("authorization token contains invalid newline sequence") + } + + return authToken, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 365a8554..f674eaa7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.15.2" +const goModuleVersion = "1.17.48" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go new file mode 100644 index 00000000..a3137b8f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.go @@ -0,0 +1,92 @@ +// Package processcreds is a credentials provider to retrieve credentials from a +// external CLI invoked process. +// +// WARNING: The following describes a method of sourcing credentials from an external +// process. This can potentially be dangerous, so proceed with caution. Other +// credential providers should be preferred if at all possible. If using this +// option, you should make sure that the config file is as locked down as possible +// using security best practices for your operating system. +// +// # Concurrency and caching +// +// The Provider is not safe to be used concurrently, and does not provide any +// caching of credentials retrieved. You should wrap the Provider with a +// `aws.CredentialsCache` to provide concurrency safety, and caching of +// credentials. +// +// # Loading credentials with the SDKs AWS Config +// +// You can use credentials from a AWS shared config `credential_process` in a +// variety of ways. +// +// One way is to setup your shared config file, located in the default +// location, with the `credential_process` key and the command you want to be +// called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable +// (e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file. +// +// [default] +// credential_process = /command/to/call +// +// Loading configuration using external will use the credential process to +// retrieve credentials. NOTE: If there are credentials in the profile you are +// using, the credential process will not be used. +// +// // Initialize a session to load credentials. +// cfg, _ := config.LoadDefaultConfig(context.TODO()) +// +// // Create S3 service client to use the credentials. +// svc := s3.NewFromConfig(cfg) +// +// # Loading credentials with the Provider directly +// +// Another way to use the credentials process provider is by using the +// `NewProvider` constructor to create the provider and providing a it with a +// command to be executed to retrieve credentials. +// +// The following example creates a credentials provider for a command, and wraps +// it with the CredentialsCache before assigning the provider to the Amazon S3 API +// client's Credentials option. +// +// // Create credentials using the Provider. +// provider := processcreds.NewProvider("/path/to/command") +// +// // Create the service client value configured for credentials. +// svc := s3.New(s3.Options{ +// Credentials: aws.NewCredentialsCache(provider), +// }) +// +// If you need more control, you can set any configurable options in the +// credentials using one or more option functions. +// +// provider := processcreds.NewProvider("/path/to/command", +// func(o *processcreds.Options) { +// // Override the provider's default timeout +// o.Timeout = 2 * time.Minute +// }) +// +// You can also use your own `exec.Cmd` value by satisfying a value that satisfies +// the `NewCommandBuilder` interface and use the `NewProviderCommand` constructor. +// +// // Create an exec.Cmd +// cmdBuilder := processcreds.NewCommandBuilderFunc( +// func(ctx context.Context) (*exec.Cmd, error) { +// cmd := exec.CommandContext(ctx, +// "customCLICommand", +// "-a", "argument", +// ) +// cmd.Env = []string{ +// "ENV_VAR_FOO=value", +// "ENV_VAR_BAR=other_value", +// } +// +// return cmd, nil +// }, +// ) +// +// // Create credentials using your exec.Cmd and custom timeout +// provider := processcreds.NewProviderCommand(cmdBuilder, +// func(opt *processcreds.Provider) { +// // optionally override the provider's default timeout +// opt.Timeout = 1 * time.Second +// }) +package processcreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go new file mode 100644 index 00000000..911fcc32 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.go @@ -0,0 +1,285 @@ +package processcreds + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "os" + "os/exec" + "runtime" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdkio" +) + +const ( + // ProviderName is the name this credentials provider will label any + // returned credentials Value with. + ProviderName = `ProcessProvider` + + // DefaultTimeout default limit on time a process can run. + DefaultTimeout = time.Duration(1) * time.Minute +) + +// ProviderError is an error indicating failure initializing or executing the +// process credentials provider +type ProviderError struct { + Err error +} + +// Error returns the error message. +func (e *ProviderError) Error() string { + return fmt.Sprintf("process provider error: %v", e.Err) +} + +// Unwrap returns the underlying error the provider error wraps. +func (e *ProviderError) Unwrap() error { + return e.Err +} + +// Provider satisfies the credentials.Provider interface, and is a +// client to retrieve credentials from a process. +type Provider struct { + // Provides a constructor for exec.Cmd that are invoked by the provider for + // retrieving credentials. Use this to provide custom creation of exec.Cmd + // with things like environment variables, or other configuration. + // + // The provider defaults to the DefaultNewCommand function. + commandBuilder NewCommandBuilder + + options Options +} + +// Options is the configuration options for configuring the Provider. +type Options struct { + // Timeout limits the time a process can run. + Timeout time.Duration +} + +// NewCommandBuilder provides the interface for specifying how command will be +// created that the Provider will use to retrieve credentials with. +type NewCommandBuilder interface { + NewCommand(context.Context) (*exec.Cmd, error) +} + +// NewCommandBuilderFunc provides a wrapper type around a function pointer to +// satisfy the NewCommandBuilder interface. +type NewCommandBuilderFunc func(context.Context) (*exec.Cmd, error) + +// NewCommand calls the underlying function pointer the builder was initialized with. +func (fn NewCommandBuilderFunc) NewCommand(ctx context.Context) (*exec.Cmd, error) { + return fn(ctx) +} + +// DefaultNewCommandBuilder provides the default NewCommandBuilder +// implementation used by the provider. It takes a command and arguments to +// invoke. The command will also be initialized with the current process +// environment variables, stderr, and stdin pipes. +type DefaultNewCommandBuilder struct { + Args []string +} + +// NewCommand returns an initialized exec.Cmd with the builder's initialized +// Args. The command is also initialized current process environment variables, +// stderr, and stdin pipes. +func (b DefaultNewCommandBuilder) NewCommand(ctx context.Context) (*exec.Cmd, error) { + var cmdArgs []string + if runtime.GOOS == "windows" { + cmdArgs = []string{"cmd.exe", "/C"} + } else { + cmdArgs = []string{"sh", "-c"} + } + + if len(b.Args) == 0 { + return nil, &ProviderError{ + Err: fmt.Errorf("failed to prepare command: command must not be empty"), + } + } + + cmdArgs = append(cmdArgs, b.Args...) + cmd := exec.CommandContext(ctx, cmdArgs[0], cmdArgs[1:]...) + cmd.Env = os.Environ() + + cmd.Stderr = os.Stderr // display stderr on console for MFA + cmd.Stdin = os.Stdin // enable stdin for MFA + + return cmd, nil +} + +// NewProvider returns a pointer to a new Credentials object wrapping the +// Provider. +// +// The provider defaults to the DefaultNewCommandBuilder for creating command +// the Provider will use to retrieve credentials with. +func NewProvider(command string, options ...func(*Options)) *Provider { + var args []string + + // Ensure that the command arguments are not set if the provided command is + // empty. This will error out when the command is executed since no + // arguments are specified. + if len(command) > 0 { + args = []string{command} + } + + commanBuilder := DefaultNewCommandBuilder{ + Args: args, + } + return NewProviderCommand(commanBuilder, options...) +} + +// NewProviderCommand returns a pointer to a new Credentials object with the +// specified command, and default timeout duration. Use this to provide custom +// creation of exec.Cmd for options like environment variables, or other +// configuration. +func NewProviderCommand(builder NewCommandBuilder, options ...func(*Options)) *Provider { + p := &Provider{ + commandBuilder: builder, + options: Options{ + Timeout: DefaultTimeout, + }, + } + + for _, option := range options { + option(&p.options) + } + + return p +} + +// A CredentialProcessResponse is the AWS credentials format that must be +// returned when executing an external credential_process. +type CredentialProcessResponse struct { + // As of this writing, the Version key must be set to 1. This might + // increment over time as the structure evolves. + Version int + + // The access key ID that identifies the temporary security credentials. + AccessKeyID string `json:"AccessKeyId"` + + // The secret access key that can be used to sign requests. + SecretAccessKey string + + // The token that users must pass to the service API to use the temporary credentials. + SessionToken string + + // The date on which the current credentials expire. + Expiration *time.Time + + // The ID of the account for credentials + AccountID string `json:"AccountId"` +} + +// Retrieve executes the credential process command and returns the +// credentials, or error if the command fails. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + out, err := p.executeCredentialProcess(ctx) + if err != nil { + return aws.Credentials{Source: ProviderName}, err + } + + // Serialize and validate response + resp := &CredentialProcessResponse{} + if err = json.Unmarshal(out, resp); err != nil { + return aws.Credentials{Source: ProviderName}, &ProviderError{ + Err: fmt.Errorf("parse failed of process output: %s, error: %w", out, err), + } + } + + if resp.Version != 1 { + return aws.Credentials{Source: ProviderName}, &ProviderError{ + Err: fmt.Errorf("wrong version in process output (not 1)"), + } + } + + if len(resp.AccessKeyID) == 0 { + return aws.Credentials{Source: ProviderName}, &ProviderError{ + Err: fmt.Errorf("missing AccessKeyId in process output"), + } + } + + if len(resp.SecretAccessKey) == 0 { + return aws.Credentials{Source: ProviderName}, &ProviderError{ + Err: fmt.Errorf("missing SecretAccessKey in process output"), + } + } + + creds := aws.Credentials{ + Source: ProviderName, + AccessKeyID: resp.AccessKeyID, + SecretAccessKey: resp.SecretAccessKey, + SessionToken: resp.SessionToken, + AccountID: resp.AccountID, + } + + // Handle expiration + if resp.Expiration != nil { + creds.CanExpire = true + creds.Expires = *resp.Expiration + } + + return creds, nil +} + +// executeCredentialProcess starts the credential process on the OS and +// returns the results or an error. +func (p *Provider) executeCredentialProcess(ctx context.Context) ([]byte, error) { + if p.options.Timeout >= 0 { + var cancelFunc func() + ctx, cancelFunc = context.WithTimeout(ctx, p.options.Timeout) + defer cancelFunc() + } + + cmd, err := p.commandBuilder.NewCommand(ctx) + if err != nil { + return nil, err + } + + // get creds json on process's stdout + output := bytes.NewBuffer(make([]byte, 0, int(8*sdkio.KibiByte))) + if cmd.Stdout != nil { + cmd.Stdout = io.MultiWriter(cmd.Stdout, output) + } else { + cmd.Stdout = output + } + + execCh := make(chan error, 1) + go executeCommand(cmd, execCh) + + select { + case execError := <-execCh: + if execError == nil { + break + } + select { + case <-ctx.Done(): + return output.Bytes(), &ProviderError{ + Err: fmt.Errorf("credential process timed out: %w", execError), + } + default: + return output.Bytes(), &ProviderError{ + Err: fmt.Errorf("error in credential_process: %w", execError), + } + } + } + + out := output.Bytes() + if runtime.GOOS == "windows" { + // windows adds slashes to quotes + out = bytes.ReplaceAll(out, []byte(`\"`), []byte(`"`)) + } + + return out, nil +} + +func executeCommand(cmd *exec.Cmd, exec chan error) { + // Start the command + err := cmd.Start() + if err == nil { + err = cmd.Wait() + } + + exec <- err +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go new file mode 100644 index 00000000..ece1e65f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.go @@ -0,0 +1,81 @@ +// Package ssocreds provides a credential provider for retrieving temporary AWS +// credentials using an SSO access token. +// +// IMPORTANT: The provider in this package does not initiate or perform the AWS +// SSO login flow. The SDK provider expects that you have already performed the +// SSO login flow using AWS CLI using the "aws sso login" command, or by some +// other mechanism. The provider must find a valid non-expired access token for +// the AWS SSO user portal URL in ~/.aws/sso/cache. If a cached token is not +// found, it is expired, or the file is malformed an error will be returned. +// +// # Loading AWS SSO credentials with the AWS shared configuration file +// +// You can use configure AWS SSO credentials from the AWS shared configuration file by +// specifying the required keys in the profile and referencing an sso-session: +// +// sso_session +// sso_account_id +// sso_role_name +// +// For example, the following defines a profile "devsso" and specifies the AWS +// SSO parameters that defines the target account, role, sign-on portal, and +// the region where the user portal is located. Note: all SSO arguments must be +// provided, or an error will be returned. +// +// [profile devsso] +// sso_session = dev-session +// sso_role_name = SSOReadOnlyRole +// sso_account_id = 123456789012 +// +// [sso-session dev-session] +// sso_start_url = https://my-sso-portal.awsapps.com/start +// sso_region = us-east-1 +// sso_registration_scopes = sso:account:access +// +// Using the config module, you can load the AWS SDK shared configuration, and +// specify that this profile be used to retrieve credentials. For example: +// +// config, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigProfile("devsso")) +// if err != nil { +// return err +// } +// +// # Programmatically loading AWS SSO credentials directly +// +// You can programmatically construct the AWS SSO Provider in your application, +// and provide the necessary information to load and retrieve temporary +// credentials using an access token from ~/.aws/sso/cache. +// +// ssoClient := sso.NewFromConfig(cfg) +// ssoOidcClient := ssooidc.NewFromConfig(cfg) +// tokenPath, err := ssocreds.StandardCachedTokenFilepath("dev-session") +// if err != nil { +// return err +// } +// +// var provider aws.CredentialsProvider +// provider = ssocreds.New(ssoClient, "123456789012", "SSOReadOnlyRole", "https://my-sso-portal.awsapps.com/start", func(options *ssocreds.Options) { +// options.SSOTokenProvider = ssocreds.NewSSOTokenProvider(ssoOidcClient, tokenPath) +// }) +// +// // Wrap the provider with aws.CredentialsCache to cache the credentials until their expire time +// provider = aws.NewCredentialsCache(provider) +// +// credentials, err := provider.Retrieve(context.TODO()) +// if err != nil { +// return err +// } +// +// It is important that you wrap the Provider with aws.CredentialsCache if you +// are programmatically constructing the provider directly. This prevents your +// application from accessing the cached access token and requesting new +// credentials each time the credentials are used. +// +// # Additional Resources +// +// Configuring the AWS CLI to use AWS Single Sign-On: +// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +// +// AWS Single Sign-On User Guide: +// https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html +package ssocreds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go new file mode 100644 index 00000000..46ae2f92 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.go @@ -0,0 +1,233 @@ +package ssocreds + +import ( + "crypto/sha1" + "encoding/hex" + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" +) + +var osUserHomeDur = shareddefaults.UserHomeDir + +// StandardCachedTokenFilepath returns the filepath for the cached SSO token file, or +// error if unable get derive the path. Key that will be used to compute a SHA1 +// value that is hex encoded. +// +// Derives the filepath using the Key as: +// +// ~/.aws/sso/cache/.json +func StandardCachedTokenFilepath(key string) (string, error) { + homeDir := osUserHomeDur() + if len(homeDir) == 0 { + return "", fmt.Errorf("unable to get USER's home directory for cached token") + } + hash := sha1.New() + if _, err := hash.Write([]byte(key)); err != nil { + return "", fmt.Errorf("unable to compute cached token filepath key SHA1 hash, %w", err) + } + + cacheFilename := strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json" + + return filepath.Join(homeDir, ".aws", "sso", "cache", cacheFilename), nil +} + +type tokenKnownFields struct { + AccessToken string `json:"accessToken,omitempty"` + ExpiresAt *rfc3339 `json:"expiresAt,omitempty"` + + RefreshToken string `json:"refreshToken,omitempty"` + ClientID string `json:"clientId,omitempty"` + ClientSecret string `json:"clientSecret,omitempty"` +} + +type token struct { + tokenKnownFields + UnknownFields map[string]interface{} `json:"-"` +} + +func (t token) MarshalJSON() ([]byte, error) { + fields := map[string]interface{}{} + + setTokenFieldString(fields, "accessToken", t.AccessToken) + setTokenFieldRFC3339(fields, "expiresAt", t.ExpiresAt) + + setTokenFieldString(fields, "refreshToken", t.RefreshToken) + setTokenFieldString(fields, "clientId", t.ClientID) + setTokenFieldString(fields, "clientSecret", t.ClientSecret) + + for k, v := range t.UnknownFields { + if _, ok := fields[k]; ok { + return nil, fmt.Errorf("unknown token field %v, duplicates known field", k) + } + fields[k] = v + } + + return json.Marshal(fields) +} + +func setTokenFieldString(fields map[string]interface{}, key, value string) { + if value == "" { + return + } + fields[key] = value +} +func setTokenFieldRFC3339(fields map[string]interface{}, key string, value *rfc3339) { + if value == nil { + return + } + fields[key] = value +} + +func (t *token) UnmarshalJSON(b []byte) error { + var fields map[string]interface{} + if err := json.Unmarshal(b, &fields); err != nil { + return nil + } + + t.UnknownFields = map[string]interface{}{} + + for k, v := range fields { + var err error + switch k { + case "accessToken": + err = getTokenFieldString(v, &t.AccessToken) + case "expiresAt": + err = getTokenFieldRFC3339(v, &t.ExpiresAt) + case "refreshToken": + err = getTokenFieldString(v, &t.RefreshToken) + case "clientId": + err = getTokenFieldString(v, &t.ClientID) + case "clientSecret": + err = getTokenFieldString(v, &t.ClientSecret) + default: + t.UnknownFields[k] = v + } + + if err != nil { + return fmt.Errorf("field %q, %w", k, err) + } + } + + return nil +} + +func getTokenFieldString(v interface{}, value *string) error { + var ok bool + *value, ok = v.(string) + if !ok { + return fmt.Errorf("expect value to be string, got %T", v) + } + return nil +} + +func getTokenFieldRFC3339(v interface{}, value **rfc3339) error { + var stringValue string + if err := getTokenFieldString(v, &stringValue); err != nil { + return err + } + + timeValue, err := parseRFC3339(stringValue) + if err != nil { + return err + } + + *value = &timeValue + return nil +} + +func loadCachedToken(filename string) (token, error) { + fileBytes, err := ioutil.ReadFile(filename) + if err != nil { + return token{}, fmt.Errorf("failed to read cached SSO token file, %w", err) + } + + var t token + if err := json.Unmarshal(fileBytes, &t); err != nil { + return token{}, fmt.Errorf("failed to parse cached SSO token file, %w", err) + } + + if len(t.AccessToken) == 0 || t.ExpiresAt == nil || time.Time(*t.ExpiresAt).IsZero() { + return token{}, fmt.Errorf( + "cached SSO token must contain accessToken and expiresAt fields") + } + + return t, nil +} + +func storeCachedToken(filename string, t token, fileMode os.FileMode) (err error) { + tmpFilename := filename + ".tmp-" + strconv.FormatInt(sdk.NowTime().UnixNano(), 10) + if err := writeCacheFile(tmpFilename, fileMode, t); err != nil { + return err + } + + if err := os.Rename(tmpFilename, filename); err != nil { + return fmt.Errorf("failed to replace old cached SSO token file, %w", err) + } + + return nil +} + +func writeCacheFile(filename string, fileMode os.FileMode, t token) (err error) { + var f *os.File + f, err = os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_RDWR, fileMode) + if err != nil { + return fmt.Errorf("failed to create cached SSO token file %w", err) + } + + defer func() { + closeErr := f.Close() + if err == nil && closeErr != nil { + err = fmt.Errorf("failed to close cached SSO token file, %w", closeErr) + } + }() + + encoder := json.NewEncoder(f) + + if err = encoder.Encode(t); err != nil { + return fmt.Errorf("failed to serialize cached SSO token, %w", err) + } + + return nil +} + +type rfc3339 time.Time + +func parseRFC3339(v string) (rfc3339, error) { + parsed, err := time.Parse(time.RFC3339, v) + if err != nil { + return rfc3339{}, fmt.Errorf("expected RFC3339 timestamp: %w", err) + } + + return rfc3339(parsed), nil +} + +func (r *rfc3339) UnmarshalJSON(bytes []byte) (err error) { + var value string + + // Use JSON unmarshal to unescape the quoted value making use of JSON's + // unquoting rules. + if err = json.Unmarshal(bytes, &value); err != nil { + return err + } + + *r, err = parseRFC3339(value) + + return nil +} + +func (r *rfc3339) MarshalJSON() ([]byte, error) { + value := time.Time(*r).UTC().Format(time.RFC3339) + + // Use JSON unmarshal to unescape the quoted value making use of JSON's + // quoting rules. + return json.Marshal(value) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go new file mode 100644 index 00000000..8c230be8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.go @@ -0,0 +1,153 @@ +package ssocreds + +import ( + "context" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/sso" +) + +// ProviderName is the name of the provider used to specify the source of +// credentials. +const ProviderName = "SSOProvider" + +// GetRoleCredentialsAPIClient is a API client that implements the +// GetRoleCredentials operation. +type GetRoleCredentialsAPIClient interface { + GetRoleCredentials(context.Context, *sso.GetRoleCredentialsInput, ...func(*sso.Options)) ( + *sso.GetRoleCredentialsOutput, error, + ) +} + +// Options is the Provider options structure. +type Options struct { + // The Client which is configured for the AWS Region where the AWS SSO user + // portal is located. + Client GetRoleCredentialsAPIClient + + // The AWS account that is assigned to the user. + AccountID string + + // The role name that is assigned to the user. + RoleName string + + // The URL that points to the organization's AWS Single Sign-On (AWS SSO) + // user portal. + StartURL string + + // The filepath the cached token will be retrieved from. If unset Provider will + // use the startURL to determine the filepath at. + // + // ~/.aws/sso/cache/.json + // + // If custom cached token filepath is used, the Provider's startUrl + // parameter will be ignored. + CachedTokenFilepath string + + // Used by the SSOCredentialProvider if a token configuration + // profile is used in the shared config + SSOTokenProvider *SSOTokenProvider +} + +// Provider is an AWS credential provider that retrieves temporary AWS +// credentials by exchanging an SSO login token. +type Provider struct { + options Options + + cachedTokenFilepath string +} + +// New returns a new AWS Single Sign-On (AWS SSO) credential provider. The +// provided client is expected to be configured for the AWS Region where the +// AWS SSO user portal is located. +func New(client GetRoleCredentialsAPIClient, accountID, roleName, startURL string, optFns ...func(options *Options)) *Provider { + options := Options{ + Client: client, + AccountID: accountID, + RoleName: roleName, + StartURL: startURL, + } + + for _, fn := range optFns { + fn(&options) + } + + return &Provider{ + options: options, + cachedTokenFilepath: options.CachedTokenFilepath, + } +} + +// Retrieve retrieves temporary AWS credentials from the configured Amazon +// Single Sign-On (AWS SSO) user portal by exchanging the accessToken present +// in ~/.aws/sso/cache. However, if a token provider configuration exists +// in the shared config, then we ought to use the token provider rather then +// direct access on the cached token. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + var accessToken *string + if p.options.SSOTokenProvider != nil { + token, err := p.options.SSOTokenProvider.RetrieveBearerToken(ctx) + if err != nil { + return aws.Credentials{}, err + } + accessToken = &token.Value + } else { + if p.cachedTokenFilepath == "" { + cachedTokenFilepath, err := StandardCachedTokenFilepath(p.options.StartURL) + if err != nil { + return aws.Credentials{}, &InvalidTokenError{Err: err} + } + p.cachedTokenFilepath = cachedTokenFilepath + } + + tokenFile, err := loadCachedToken(p.cachedTokenFilepath) + if err != nil { + return aws.Credentials{}, &InvalidTokenError{Err: err} + } + + if tokenFile.ExpiresAt == nil || sdk.NowTime().After(time.Time(*tokenFile.ExpiresAt)) { + return aws.Credentials{}, &InvalidTokenError{} + } + accessToken = &tokenFile.AccessToken + } + + output, err := p.options.Client.GetRoleCredentials(ctx, &sso.GetRoleCredentialsInput{ + AccessToken: accessToken, + AccountId: &p.options.AccountID, + RoleName: &p.options.RoleName, + }) + if err != nil { + return aws.Credentials{}, err + } + + return aws.Credentials{ + AccessKeyID: aws.ToString(output.RoleCredentials.AccessKeyId), + SecretAccessKey: aws.ToString(output.RoleCredentials.SecretAccessKey), + SessionToken: aws.ToString(output.RoleCredentials.SessionToken), + CanExpire: true, + Expires: time.Unix(0, output.RoleCredentials.Expiration*int64(time.Millisecond)).UTC(), + Source: ProviderName, + AccountID: p.options.AccountID, + }, nil +} + +// InvalidTokenError is the error type that is returned if loaded token has +// expired or is otherwise invalid. To refresh the SSO session run AWS SSO +// login with the corresponding profile. +type InvalidTokenError struct { + Err error +} + +func (i *InvalidTokenError) Unwrap() error { + return i.Err +} + +func (i *InvalidTokenError) Error() string { + const msg = "the SSO session has expired or is invalid" + if i.Err == nil { + return msg + } + return msg + ": " + i.Err.Error() +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go new file mode 100644 index 00000000..7f4fc546 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.go @@ -0,0 +1,147 @@ +package ssocreds + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/ssooidc" + "github.com/aws/smithy-go/auth/bearer" +) + +// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API +// client for calling CreateToken operation to refresh the SSO token. +type CreateTokenAPIClient interface { + CreateToken(context.Context, *ssooidc.CreateTokenInput, ...func(*ssooidc.Options)) ( + *ssooidc.CreateTokenOutput, error, + ) +} + +// SSOTokenProviderOptions provides the options for configuring the +// SSOTokenProvider. +type SSOTokenProviderOptions struct { + // Client that can be overridden + Client CreateTokenAPIClient + + // The set of API Client options to be applied when invoking the + // CreateToken operation. + ClientOptions []func(*ssooidc.Options) + + // The path the file containing the cached SSO token will be read from. + // Initialized the NewSSOTokenProvider's cachedTokenFilepath parameter. + CachedTokenFilepath string +} + +// SSOTokenProvider provides an utility for refreshing SSO AccessTokens for +// Bearer Authentication. The SSOTokenProvider can only be used to refresh +// already cached SSO Tokens. This utility cannot perform the initial SSO +// create token. +// +// The SSOTokenProvider is not safe to use concurrently. It must be wrapped in +// a utility such as smithy-go's auth/bearer#TokenCache. The SDK's +// config.LoadDefaultConfig will automatically wrap the SSOTokenProvider with +// the smithy-go TokenCache, if the external configuration loaded configured +// for an SSO session. +// +// The initial SSO create token should be preformed with the AWS CLI before the +// Go application using the SSOTokenProvider will need to retrieve the SSO +// token. If the AWS CLI has not created the token cache file, this provider +// will return an error when attempting to retrieve the cached token. +// +// This provider will attempt to refresh the cached SSO token periodically if +// needed when RetrieveBearerToken is called. +// +// A utility such as the AWS CLI must be used to initially create the SSO +// session and cached token file. +// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +type SSOTokenProvider struct { + options SSOTokenProviderOptions +} + +var _ bearer.TokenProvider = (*SSOTokenProvider)(nil) + +// NewSSOTokenProvider returns an initialized SSOTokenProvider that will +// periodically refresh the SSO token cached stored in the cachedTokenFilepath. +// The cachedTokenFilepath file's content will be rewritten by the token +// provider when the token is refreshed. +// +// The client must be configured for the AWS region the SSO token was created for. +func NewSSOTokenProvider(client CreateTokenAPIClient, cachedTokenFilepath string, optFns ...func(o *SSOTokenProviderOptions)) *SSOTokenProvider { + options := SSOTokenProviderOptions{ + Client: client, + CachedTokenFilepath: cachedTokenFilepath, + } + for _, fn := range optFns { + fn(&options) + } + + provider := &SSOTokenProvider{ + options: options, + } + + return provider +} + +// RetrieveBearerToken returns the SSO token stored in the cachedTokenFilepath +// the SSOTokenProvider was created with. If the token has expired +// RetrieveBearerToken will attempt to refresh it. If the token cannot be +// refreshed or is not present an error will be returned. +// +// A utility such as the AWS CLI must be used to initially create the SSO +// session and cached token file. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html +func (p SSOTokenProvider) RetrieveBearerToken(ctx context.Context) (bearer.Token, error) { + cachedToken, err := loadCachedToken(p.options.CachedTokenFilepath) + if err != nil { + return bearer.Token{}, err + } + + if cachedToken.ExpiresAt != nil && sdk.NowTime().After(time.Time(*cachedToken.ExpiresAt)) { + cachedToken, err = p.refreshToken(ctx, cachedToken) + if err != nil { + return bearer.Token{}, fmt.Errorf("refresh cached SSO token failed, %w", err) + } + } + + expiresAt := aws.ToTime((*time.Time)(cachedToken.ExpiresAt)) + return bearer.Token{ + Value: cachedToken.AccessToken, + CanExpire: !expiresAt.IsZero(), + Expires: expiresAt, + }, nil +} + +func (p SSOTokenProvider) refreshToken(ctx context.Context, cachedToken token) (token, error) { + if cachedToken.ClientSecret == "" || cachedToken.ClientID == "" || cachedToken.RefreshToken == "" { + return token{}, fmt.Errorf("cached SSO token is expired, or not present, and cannot be refreshed") + } + + createResult, err := p.options.Client.CreateToken(ctx, &ssooidc.CreateTokenInput{ + ClientId: &cachedToken.ClientID, + ClientSecret: &cachedToken.ClientSecret, + RefreshToken: &cachedToken.RefreshToken, + GrantType: aws.String("refresh_token"), + }, p.options.ClientOptions...) + if err != nil { + return token{}, fmt.Errorf("unable to refresh SSO token, %w", err) + } + + expiresAt := sdk.NowTime().Add(time.Duration(createResult.ExpiresIn) * time.Second) + + cachedToken.AccessToken = aws.ToString(createResult.AccessToken) + cachedToken.ExpiresAt = (*rfc3339)(&expiresAt) + cachedToken.RefreshToken = aws.ToString(createResult.RefreshToken) + + fileInfo, err := os.Stat(p.options.CachedTokenFilepath) + if err != nil { + return token{}, fmt.Errorf("failed to stat cached SSO token file %w", err) + } + + if err = storeCachedToken(p.options.CachedTokenFilepath, cachedToken, fileInfo.Mode()); err != nil { + return token{}, fmt.Errorf("unable to cache refreshed SSO token, %w", err) + } + + return cachedToken, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go new file mode 100644 index 00000000..4c7f7993 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.go @@ -0,0 +1,326 @@ +// Package stscreds are credential Providers to retrieve STS AWS credentials. +// +// STS provides multiple ways to retrieve credentials which can be used when making +// future AWS service API operation calls. +// +// The SDK will ensure that per instance of credentials.Credentials all requests +// to refresh the credentials will be synchronized. But, the SDK is unable to +// ensure synchronous usage of the AssumeRoleProvider if the value is shared +// between multiple Credentials or service clients. +// +// # Assume Role +// +// To assume an IAM role using STS with the SDK you can create a new Credentials +// with the SDKs's stscreds package. +// +// // Initial credentials loaded from SDK's default credential chain. Such as +// // the environment, shared credentials (~/.aws/credentials), or EC2 Instance +// // Role. These credentials will be used to to make the STS Assume Role API. +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } +// +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN. +// stsSvc := sts.NewFromConfig(cfg) +// creds := stscreds.NewAssumeRoleProvider(stsSvc, "myRoleArn") +// +// cfg.Credentials = aws.NewCredentialsCache(creds) +// +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) +// +// # Assume Role with custom MFA Token provider +// +// To assume an IAM role with a MFA token you can either specify a custom MFA +// token provider or use the SDK's built in StdinTokenProvider that will prompt +// the user for a token code each time the credentials need to to be refreshed. +// Specifying a custom token provider allows you to control where the token +// code is retrieved from, and how it is refreshed. +// +// With a custom token provider, the provider is responsible for refreshing the +// token code when called. +// +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } +// +// staticTokenProvider := func() (string, error) { +// return someTokenCode, nil +// } +// +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN using the MFA token code provided. +// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { +// o.SerialNumber = aws.String("myTokenSerialNumber") +// o.TokenProvider = staticTokenProvider +// }) +// +// cfg.Credentials = aws.NewCredentialsCache(creds) +// +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) +// +// # Assume Role with MFA Token Provider +// +// To assume an IAM role with MFA for longer running tasks where the credentials +// may need to be refreshed setting the TokenProvider field of AssumeRoleProvider +// will allow the credential provider to prompt for new MFA token code when the +// role's credentials need to be refreshed. +// +// The StdinTokenProvider function is available to prompt on stdin to retrieve +// the MFA token code from the user. You can also implement custom prompts by +// satisfying the TokenProvider function signature. +// +// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will +// have undesirable results as the StdinTokenProvider will not be synchronized. A +// single Credentials with an AssumeRoleProvider can be shared safely. +// +// cfg, err := config.LoadDefaultConfig(context.TODO()) +// if err != nil { +// panic(err) +// } +// +// // Create the credentials from AssumeRoleProvider to assume the role +// // referenced by the "myRoleARN" ARN using the MFA token code provided. +// creds := stscreds.NewAssumeRoleProvider(sts.NewFromConfig(cfg), "myRoleArn", func(o *stscreds.AssumeRoleOptions) { +// o.SerialNumber = aws.String("myTokenSerialNumber") +// o.TokenProvider = stscreds.StdinTokenProvider +// }) +// +// cfg.Credentials = aws.NewCredentialsCache(creds) +// +// // Create service client value configured for credentials +// // from assumed role. +// svc := s3.NewFromConfig(cfg) +package stscreds + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/sts" + "github.com/aws/aws-sdk-go-v2/service/sts/types" +) + +// StdinTokenProvider will prompt on stdout and read from stdin for a string value. +// An error is returned if reading from stdin fails. +// +// Use this function go read MFA tokens from stdin. The function makes no attempt +// to make atomic prompts from stdin across multiple gorouties. +// +// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will +// have undesirable results as the StdinTokenProvider will not be synchronized. A +// single Credentials with an AssumeRoleProvider can be shared safely +// +// Will wait forever until something is provided on the stdin. +func StdinTokenProvider() (string, error) { + var v string + fmt.Printf("Assume Role MFA token code: ") + _, err := fmt.Scanln(&v) + + return v, err +} + +// ProviderName provides a name of AssumeRole provider +const ProviderName = "AssumeRoleProvider" + +// AssumeRoleAPIClient is a client capable of the STS AssumeRole operation. +type AssumeRoleAPIClient interface { + AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error) +} + +// DefaultDuration is the default amount of time in minutes that the +// credentials will be valid for. This value is only used by AssumeRoleProvider +// for specifying the default expiry duration of an assume role. +// +// Other providers such as WebIdentityRoleProvider do not use this value, and +// instead rely on STS API's default parameter handing to assign a default +// value. +var DefaultDuration = time.Duration(15) * time.Minute + +// AssumeRoleProvider retrieves temporary credentials from the STS service, and +// keeps track of their expiration time. +// +// This credential provider will be used by the SDKs default credential change +// when shared configuration is enabled, and the shared config or shared credentials +// file configure assume role. See Session docs for how to do this. +// +// AssumeRoleProvider does not provide any synchronization and it is not safe +// to share this value across multiple Credentials, Sessions, or service clients +// without also sharing the same Credentials instance. +type AssumeRoleProvider struct { + options AssumeRoleOptions +} + +// AssumeRoleOptions is the configurable options for AssumeRoleProvider +type AssumeRoleOptions struct { + // Client implementation of the AssumeRole operation. Required + Client AssumeRoleAPIClient + + // IAM Role ARN to be assumed. Required + RoleARN string + + // Session name, if you wish to uniquely identify this session. + RoleSessionName string + + // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. + Duration time.Duration + + // Optional ExternalID to pass along, defaults to nil if not set. + ExternalID *string + + // The policy plain text must be 2048 bytes or shorter. However, an internal + // conversion compresses it into a packed binary format with a separate limit. + // The PackedPolicySize response element indicates by percentage how close to + // the upper size limit the policy is, with 100% equaling the maximum allowed + // size. + Policy *string + + // The ARNs of IAM managed policies you want to use as managed session policies. + // The policies must exist in the same account as the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plain text that you use for both inline and managed session + // policies can't exceed 2,048 characters. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's identity-based + // policy and the session policies. You can use the role's temporary credentials + // in subsequent AWS API calls to access resources in the account that owns + // the role. You cannot use session policies to grant more permissions than + // those allowed by the identity-based policy of the role that is being assumed. + // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + PolicyARNs []types.PolicyDescriptorType + + // The identification number of the MFA device that is associated with the user + // who is making the AssumeRole call. Specify this value if the trust policy + // of the role being assumed includes a condition that requires MFA authentication. + // The value is either the serial number for a hardware device (such as GAHT12345678) + // or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). + SerialNumber *string + + // The source identity specified by the principal that is calling the AssumeRole + // operation. You can require users to specify a source identity when they assume a + // role. You do this by using the sts:SourceIdentity condition key in a role trust + // policy. You can use source identity information in CloudTrail logs to determine + // who took actions with a role. You can use the aws:SourceIdentity condition key + // to further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see Monitor + // and control actions taken with assumed roles + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + // in the IAM User Guide. + SourceIdentity *string + + // Async method of providing MFA token code for assuming an IAM role with MFA. + // The value returned by the function will be used as the TokenCode in the Retrieve + // call. See StdinTokenProvider for a provider that prompts and reads from stdin. + // + // This token provider will be called when ever the assumed role's + // credentials need to be refreshed when SerialNumber is set. + TokenProvider func() (string, error) + + // A list of session tags that you want to pass. Each session tag consists of a key + // name and an associated value. For more information about session tags, see + // Tagging STS Sessions + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the + // IAM User Guide. This parameter is optional. You can pass up to 50 session tags. + Tags []types.Tag + + // A list of keys for session tags that you want to set as transitive. If you set a + // tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see Chaining Roles with Session + // Tags + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. This parameter is optional. + TransitiveTagKeys []string +} + +// NewAssumeRoleProvider constructs and returns a credentials provider that +// will retrieve credentials by assuming a IAM role using STS. +func NewAssumeRoleProvider(client AssumeRoleAPIClient, roleARN string, optFns ...func(*AssumeRoleOptions)) *AssumeRoleProvider { + o := AssumeRoleOptions{ + Client: client, + RoleARN: roleARN, + } + + for _, fn := range optFns { + fn(&o) + } + + return &AssumeRoleProvider{ + options: o, + } +} + +// Retrieve generates a new set of temporary credentials using STS. +func (p *AssumeRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) { + // Apply defaults where parameters are not set. + if len(p.options.RoleSessionName) == 0 { + // Try to work out a role name that will hopefully end up unique. + p.options.RoleSessionName = fmt.Sprintf("aws-go-sdk-%d", time.Now().UTC().UnixNano()) + } + if p.options.Duration == 0 { + // Expire as often as AWS permits. + p.options.Duration = DefaultDuration + } + input := &sts.AssumeRoleInput{ + DurationSeconds: aws.Int32(int32(p.options.Duration / time.Second)), + PolicyArns: p.options.PolicyARNs, + RoleArn: aws.String(p.options.RoleARN), + RoleSessionName: aws.String(p.options.RoleSessionName), + ExternalId: p.options.ExternalID, + SourceIdentity: p.options.SourceIdentity, + Tags: p.options.Tags, + TransitiveTagKeys: p.options.TransitiveTagKeys, + } + if p.options.Policy != nil { + input.Policy = p.options.Policy + } + if p.options.SerialNumber != nil { + if p.options.TokenProvider != nil { + input.SerialNumber = p.options.SerialNumber + code, err := p.options.TokenProvider() + if err != nil { + return aws.Credentials{}, err + } + input.TokenCode = aws.String(code) + } else { + return aws.Credentials{}, fmt.Errorf("assume role with MFA enabled, but TokenProvider is not set") + } + } + + resp, err := p.options.Client.AssumeRole(ctx, input) + if err != nil { + return aws.Credentials{Source: ProviderName}, err + } + + var accountID string + if resp.AssumedRoleUser != nil { + accountID = getAccountID(resp.AssumedRoleUser) + } + + return aws.Credentials{ + AccessKeyID: *resp.Credentials.AccessKeyId, + SecretAccessKey: *resp.Credentials.SecretAccessKey, + SessionToken: *resp.Credentials.SessionToken, + Source: ProviderName, + + CanExpire: true, + Expires: *resp.Credentials.Expiration, + AccountID: accountID, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go new file mode 100644 index 00000000..b4b71970 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.go @@ -0,0 +1,169 @@ +package stscreds + +import ( + "context" + "fmt" + "io/ioutil" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/sts" + "github.com/aws/aws-sdk-go-v2/service/sts/types" +) + +var invalidIdentityTokenExceptionCode = (&types.InvalidIdentityTokenException{}).ErrorCode() + +const ( + // WebIdentityProviderName is the web identity provider name + WebIdentityProviderName = "WebIdentityCredentials" +) + +// AssumeRoleWithWebIdentityAPIClient is a client capable of the STS AssumeRoleWithWebIdentity operation. +type AssumeRoleWithWebIdentityAPIClient interface { + AssumeRoleWithWebIdentity(ctx context.Context, params *sts.AssumeRoleWithWebIdentityInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleWithWebIdentityOutput, error) +} + +// WebIdentityRoleProvider is used to retrieve credentials using +// an OIDC token. +type WebIdentityRoleProvider struct { + options WebIdentityRoleOptions +} + +// WebIdentityRoleOptions is a structure of configurable options for WebIdentityRoleProvider +type WebIdentityRoleOptions struct { + // Client implementation of the AssumeRoleWithWebIdentity operation. Required + Client AssumeRoleWithWebIdentityAPIClient + + // JWT Token Provider. Required + TokenRetriever IdentityTokenRetriever + + // IAM Role ARN to assume. Required + RoleARN string + + // Session name, if you wish to uniquely identify this session. + RoleSessionName string + + // Expiry duration of the STS credentials. STS will assign a default expiry + // duration if this value is unset. This is different from the Duration + // option of AssumeRoleProvider, which automatically assigns 15 minutes if + // Duration is unset. + // + // See the STS AssumeRoleWithWebIdentity API reference guide for more + // information on defaults. + // https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html + Duration time.Duration + + // An IAM policy in JSON format that you want to use as an inline session policy. + Policy *string + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you + // want to use as managed session policies. The policies must exist in the + // same account as the role. + PolicyARNs []types.PolicyDescriptorType +} + +// IdentityTokenRetriever is an interface for retrieving a JWT +type IdentityTokenRetriever interface { + GetIdentityToken() ([]byte, error) +} + +// IdentityTokenFile is for retrieving an identity token from the given file name +type IdentityTokenFile string + +// GetIdentityToken retrieves the JWT token from the file and returns the contents as a []byte +func (j IdentityTokenFile) GetIdentityToken() ([]byte, error) { + b, err := ioutil.ReadFile(string(j)) + if err != nil { + return nil, fmt.Errorf("unable to read file at %s: %v", string(j), err) + } + + return b, nil +} + +// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the +// provided stsiface.ClientAPI +func NewWebIdentityRoleProvider(client AssumeRoleWithWebIdentityAPIClient, roleARN string, tokenRetriever IdentityTokenRetriever, optFns ...func(*WebIdentityRoleOptions)) *WebIdentityRoleProvider { + o := WebIdentityRoleOptions{ + Client: client, + RoleARN: roleARN, + TokenRetriever: tokenRetriever, + } + + for _, fn := range optFns { + fn(&o) + } + + return &WebIdentityRoleProvider{options: o} +} + +// Retrieve will attempt to assume a role from a token which is located at +// 'WebIdentityTokenFilePath' specified destination and if that is empty an +// error will be returned. +func (p *WebIdentityRoleProvider) Retrieve(ctx context.Context) (aws.Credentials, error) { + b, err := p.options.TokenRetriever.GetIdentityToken() + if err != nil { + return aws.Credentials{}, fmt.Errorf("failed to retrieve jwt from provide source, %w", err) + } + + sessionName := p.options.RoleSessionName + if len(sessionName) == 0 { + // session name is used to uniquely identify a session. This simply + // uses unix time in nanoseconds to uniquely identify sessions. + sessionName = strconv.FormatInt(sdk.NowTime().UnixNano(), 10) + } + input := &sts.AssumeRoleWithWebIdentityInput{ + PolicyArns: p.options.PolicyARNs, + RoleArn: &p.options.RoleARN, + RoleSessionName: &sessionName, + WebIdentityToken: aws.String(string(b)), + } + if p.options.Duration != 0 { + // If set use the value, otherwise STS will assign a default expiration duration. + input.DurationSeconds = aws.Int32(int32(p.options.Duration / time.Second)) + } + if p.options.Policy != nil { + input.Policy = p.options.Policy + } + + resp, err := p.options.Client.AssumeRoleWithWebIdentity(ctx, input, func(options *sts.Options) { + options.Retryer = retry.AddWithErrorCodes(options.Retryer, invalidIdentityTokenExceptionCode) + }) + if err != nil { + return aws.Credentials{}, fmt.Errorf("failed to retrieve credentials, %w", err) + } + + var accountID string + if resp.AssumedRoleUser != nil { + accountID = getAccountID(resp.AssumedRoleUser) + } + + // InvalidIdentityToken error is a temporary error that can occur + // when assuming an Role with a JWT web identity token. + + value := aws.Credentials{ + AccessKeyID: aws.ToString(resp.Credentials.AccessKeyId), + SecretAccessKey: aws.ToString(resp.Credentials.SecretAccessKey), + SessionToken: aws.ToString(resp.Credentials.SessionToken), + Source: WebIdentityProviderName, + CanExpire: true, + Expires: *resp.Credentials.Expiration, + AccountID: accountID, + } + return value, nil +} + +// extract accountID from arn with format "arn:partition:service:region:account-id:[resource-section]" +func getAccountID(u *types.AssumedRoleUser) string { + if u.Arn == nil { + return "" + } + parts := strings.Split(*u.Arn, ":") + if len(parts) < 5 { + return "" + } + return parts[4] +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md new file mode 100644 index 00000000..9862361e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -0,0 +1,401 @@ +# v1.16.22 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.21 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.20 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.19 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.18 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.17 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.16 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.14 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2024-03-21) + +* **Feature**: Add config switch `DisableDefaultTimeout` that allows you to disable the default operation timeout (5 seconds) for IMDS calls. + +# v1.15.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.11 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.9 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.7 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2023-11-02) + +* No change notes available for this release. + +# v1.14.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.13 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.12 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.10 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2023-03-14) + +* **Feature**: Add flag to disable IMDSv1 fallback + +# v1.12.24 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.23 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.22 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.21 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.20 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.19 (2022-10-24) + +* **Bug Fix**: Fixes an issue that prevented logging of the API request or responses when the respective log modes were enabled. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.18 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.17 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.16 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.15 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.9 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-02-24) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-11-06) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-10-11) + +* **Feature**: Respect passed in Context Deadline/Timeout. Updates the IMDS Client operations to not override the passed in Context's Deadline or Timeout options. If an Client operation is called with a Context with a Deadline or Timeout, the client will no longer override it with the client's default timeout. +* **Bug Fix**: Fix IMDS client's response handling and operation timeout race. Fixes #1253 +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-07-15) + +* **Feature**: Support has been added for EC2 IPv6-enabled Instance Metadata Service Endpoints. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go new file mode 100644 index 00000000..3f4a10e2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go @@ -0,0 +1,352 @@ +package imds + +import ( + "context" + "fmt" + "net" + "net/http" + "os" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/retry" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalconfig "github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// ServiceID provides the unique name of this API client +const ServiceID = "ec2imds" + +// Client provides the API client for interacting with the Amazon EC2 Instance +// Metadata Service API. +type Client struct { + options Options +} + +// ClientEnableState provides an enumeration if the client is enabled, +// disabled, or default behavior. +type ClientEnableState = internalconfig.ClientEnableState + +// Enumeration values for ClientEnableState +const ( + ClientDefaultEnableState ClientEnableState = internalconfig.ClientDefaultEnableState // default behavior + ClientDisabled ClientEnableState = internalconfig.ClientDisabled // client disabled + ClientEnabled ClientEnableState = internalconfig.ClientEnabled // client enabled +) + +// EndpointModeState is an enum configuration variable describing the client endpoint mode. +// Not configurable directly, but used when using the NewFromConfig. +type EndpointModeState = internalconfig.EndpointModeState + +// Enumeration values for EndpointModeState +const ( + EndpointModeStateUnset EndpointModeState = internalconfig.EndpointModeStateUnset + EndpointModeStateIPv4 EndpointModeState = internalconfig.EndpointModeStateIPv4 + EndpointModeStateIPv6 EndpointModeState = internalconfig.EndpointModeStateIPv6 +) + +const ( + disableClientEnvVar = "AWS_EC2_METADATA_DISABLED" + + // Client endpoint options + endpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" + + defaultIPv4Endpoint = "http://169.254.169.254" + defaultIPv6Endpoint = "http://[fd00:ec2::254]" +) + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + options.HTTPClient = resolveHTTPClient(options.HTTPClient) + + if options.Retryer == nil { + options.Retryer = retry.NewStandard() + } + options.Retryer = retry.AddWithMaxBackoffDelay(options.Retryer, 1*time.Second) + + if options.ClientEnableState == ClientDefaultEnableState { + if v := os.Getenv(disableClientEnvVar); strings.EqualFold(v, "true") { + options.ClientEnableState = ClientDisabled + } + } + + if len(options.Endpoint) == 0 { + if v := os.Getenv(endpointEnvVar); len(v) != 0 { + options.Endpoint = v + } + } + + client := &Client{ + options: options, + } + + if client.options.tokenProvider == nil && !client.options.disableAPIToken { + client.options.tokenProvider = newTokenProvider(client, defaultTokenTTL) + } + + return client +} + +// NewFromConfig returns an initialized Client based the AWS SDK config, and +// functional options. Provide additional functional options to further +// configure the behavior of the client, such as changing the client's endpoint +// or adding custom middleware behavior. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + APIOptions: append([]func(*middleware.Stack) error{}, cfg.APIOptions...), + HTTPClient: cfg.HTTPClient, + ClientLogMode: cfg.ClientLogMode, + Logger: cfg.Logger, + } + + if cfg.Retryer != nil { + opts.Retryer = cfg.Retryer() + } + + resolveClientEnableState(cfg, &opts) + resolveEndpointConfig(cfg, &opts) + resolveEndpointModeConfig(cfg, &opts) + resolveEnableFallback(cfg, &opts) + + return New(opts, optFns...) +} + +// Options provides the fields for configuring the API client's behavior. +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation + // call to modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The endpoint the client will use to retrieve EC2 instance metadata. + // + // Specifies the EC2 Instance Metadata Service endpoint to use. If specified it overrides EndpointMode. + // + // If unset, and the environment variable AWS_EC2_METADATA_SERVICE_ENDPOINT + // has a value the client will use the value of the environment variable as + // the endpoint for operation calls. + // + // AWS_EC2_METADATA_SERVICE_ENDPOINT=http://[::1] + Endpoint string + + // The endpoint selection mode the client will use if no explicit endpoint is provided using the Endpoint field. + // + // Setting EndpointMode to EndpointModeStateIPv4 will configure the client to use the default EC2 IPv4 endpoint. + // Setting EndpointMode to EndpointModeStateIPv6 will configure the client to use the default EC2 IPv6 endpoint. + // + // By default if EndpointMode is not set (EndpointModeStateUnset) than the default endpoint selection mode EndpointModeStateIPv4. + EndpointMode EndpointModeState + + // The HTTP client to invoke API calls with. Defaults to client's default + // HTTP implementation if nil. + HTTPClient HTTPClient + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer aws.Retryer + + // Changes if the EC2 Instance Metadata client is enabled or not. Client + // will default to enabled if not set to ClientDisabled. When the client is + // disabled it will return an error for all operation calls. + // + // If ClientEnableState value is ClientDefaultEnableState (default value), + // and the environment variable "AWS_EC2_METADATA_DISABLED" is set to + // "true", the client will be disabled. + // + // AWS_EC2_METADATA_DISABLED=true + ClientEnableState ClientEnableState + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // Configure IMDSv1 fallback behavior. By default, the client will attempt + // to fall back to IMDSv1 as needed for backwards compatibility. When set to [aws.FalseTernary] + // the client will return any errors encountered from attempting to fetch a token + // instead of silently using the insecure data flow of IMDSv1. + // + // See [configuring IMDS] for more information. + // + // [configuring IMDS]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html + EnableFallback aws.Ternary + + // By default, all IMDS client operations enforce a 5-second timeout. You + // can disable that behavior with this setting. + DisableDefaultTimeout bool + + // provides the caching of API tokens used for operation calls. If unset, + // the API token will not be retrieved for the operation. + tokenProvider *tokenProvider + + // option to disable the API token provider for testing. + disableAPIToken bool +} + +// HTTPClient provides the interface for a client making HTTP requests with the +// API. +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a copy of the API options. +func (o Options) Copy() Options { + to := o + to.APIOptions = append([]func(*middleware.Stack) error{}, o.APIOptions...) + return to +} + +// WithAPIOptions wraps the API middleware functions, as a functional option +// for the API Client Options. Use this helper to add additional functional +// options to the API client, or operation calls. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), + stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + if options.ClientEnableState == ClientDisabled { + return nil, metadata, &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: fmt.Errorf( + "access disabled to EC2 IMDS via client option, or %q environment variable", + disableClientEnvVar), + } + } + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + return nil, metadata, &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + return result, metadata, err +} + +const ( + // HTTP client constants + defaultDialerTimeout = 250 * time.Millisecond + defaultResponseHeaderTimeout = 500 * time.Millisecond +) + +func resolveHTTPClient(client HTTPClient) HTTPClient { + if client == nil { + client = awshttp.NewBuildableClient() + } + + if c, ok := client.(*awshttp.BuildableClient); ok { + client = c. + WithDialerOptions(func(d *net.Dialer) { + // Use a custom Dial timeout for the EC2 Metadata service to account + // for the possibility the application might not be running in an + // environment with the service present. The client should fail fast in + // this case. + d.Timeout = defaultDialerTimeout + }). + WithTransportOptions(func(tr *http.Transport) { + // Use a custom Transport timeout for the EC2 Metadata service to + // account for the possibility that the application might be running in + // a container, and EC2Metadata service drops the connection after a + // single IP Hop. The client should fail fast in this case. + tr.ResponseHeaderTimeout = defaultResponseHeaderTimeout + }) + } + + return client +} + +func resolveClientEnableState(cfg aws.Config, options *Options) error { + if options.ClientEnableState != ClientDefaultEnableState { + return nil + } + value, found, err := internalconfig.ResolveClientEnableState(cfg.ConfigSources) + if err != nil || !found { + return err + } + options.ClientEnableState = value + return nil +} + +func resolveEndpointModeConfig(cfg aws.Config, options *Options) error { + if options.EndpointMode != EndpointModeStateUnset { + return nil + } + value, found, err := internalconfig.ResolveEndpointModeConfig(cfg.ConfigSources) + if err != nil || !found { + return err + } + options.EndpointMode = value + return nil +} + +func resolveEndpointConfig(cfg aws.Config, options *Options) error { + if len(options.Endpoint) != 0 { + return nil + } + value, found, err := internalconfig.ResolveEndpointConfig(cfg.ConfigSources) + if err != nil || !found { + return err + } + options.Endpoint = value + return nil +} + +func resolveEnableFallback(cfg aws.Config, options *Options) { + if options.EnableFallback != aws.UnknownTernary { + return + } + + disabled, ok := internalconfig.ResolveV1FallbackDisabled(cfg.ConfigSources) + if !ok { + return + } + + if disabled { + options.EnableFallback = aws.FalseTernary + } else { + options.EnableFallback = aws.TrueTernary + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go new file mode 100644 index 00000000..af58b6bb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.go @@ -0,0 +1,77 @@ +package imds + +import ( + "context" + "fmt" + "io" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getDynamicDataPath = "/latest/dynamic" + +// GetDynamicData uses the path provided to request information from the EC2 +// instance metadata service for dynamic data. The content will be returned +// as a string, or error if the request failed. +func (c *Client) GetDynamicData(ctx context.Context, params *GetDynamicDataInput, optFns ...func(*Options)) (*GetDynamicDataOutput, error) { + if params == nil { + params = &GetDynamicDataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDynamicData", params, optFns, + addGetDynamicDataMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetDynamicDataOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetDynamicDataInput provides the input parameters for the GetDynamicData +// operation. +type GetDynamicDataInput struct { + // The relative dynamic data path to retrieve. Can be empty string to + // retrieve a response containing a new line separated list of dynamic data + // resources available. + // + // Must not include the dynamic data base path. + // + // May include leading slash. If Path includes trailing slash the trailing + // slash will be included in the request for the resource. + Path string +} + +// GetDynamicDataOutput provides the output parameters for the GetDynamicData +// operation. +type GetDynamicDataOutput struct { + Content io.ReadCloser + + ResultMetadata middleware.Metadata +} + +func addGetDynamicDataMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetDynamicData", + buildGetDynamicDataPath, + buildGetDynamicDataOutput) +} + +func buildGetDynamicDataPath(params interface{}) (string, error) { + p, ok := params.(*GetDynamicDataInput) + if !ok { + return "", fmt.Errorf("unknown parameter type %T", params) + } + + return appendURIPath(getDynamicDataPath, p.Path), nil +} + +func buildGetDynamicDataOutput(resp *smithyhttp.Response) (interface{}, error) { + return &GetDynamicDataOutput{ + Content: resp.Body, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go new file mode 100644 index 00000000..5111cc90 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.go @@ -0,0 +1,103 @@ +package imds + +import ( + "context" + "encoding/json" + "fmt" + "io" + "strings" + "time" + + "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getIAMInfoPath = getMetadataPath + "/iam/info" + +// GetIAMInfo retrieves an identity document describing an +// instance. Error is returned if the request fails or is unable to parse +// the response. +func (c *Client) GetIAMInfo( + ctx context.Context, params *GetIAMInfoInput, optFns ...func(*Options), +) ( + *GetIAMInfoOutput, error, +) { + if params == nil { + params = &GetIAMInfoInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIAMInfo", params, optFns, + addGetIAMInfoMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetIAMInfoOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetIAMInfoInput provides the input parameters for GetIAMInfo operation. +type GetIAMInfoInput struct{} + +// GetIAMInfoOutput provides the output parameters for GetIAMInfo operation. +type GetIAMInfoOutput struct { + IAMInfo + + ResultMetadata middleware.Metadata +} + +func addGetIAMInfoMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetIAMInfo", + buildGetIAMInfoPath, + buildGetIAMInfoOutput, + ) +} + +func buildGetIAMInfoPath(params interface{}) (string, error) { + return getIAMInfoPath, nil +} + +func buildGetIAMInfoOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(resp.Body, ringBuffer) + + imdsResult := &GetIAMInfoOutput{} + if err = json.NewDecoder(body).Decode(&imdsResult.IAMInfo); err != nil { + return nil, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode instance identity document, %w", err), + Snapshot: ringBuffer.Bytes(), + } + } + // Any code other success is an error + if !strings.EqualFold(imdsResult.Code, "success") { + return nil, fmt.Errorf("failed to get EC2 IMDS IAM info, %s", + imdsResult.Code) + } + + return imdsResult, nil +} + +// IAMInfo provides the shape for unmarshaling an IAM info from the metadata +// API. +type IAMInfo struct { + Code string + LastUpdated time.Time + InstanceProfileArn string + InstanceProfileID string +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go new file mode 100644 index 00000000..dc8c09ed --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.go @@ -0,0 +1,110 @@ +package imds + +import ( + "context" + "encoding/json" + "fmt" + "io" + "time" + + "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getInstanceIdentityDocumentPath = getDynamicDataPath + "/instance-identity/document" + +// GetInstanceIdentityDocument retrieves an identity document describing an +// instance. Error is returned if the request fails or is unable to parse +// the response. +func (c *Client) GetInstanceIdentityDocument( + ctx context.Context, params *GetInstanceIdentityDocumentInput, optFns ...func(*Options), +) ( + *GetInstanceIdentityDocumentOutput, error, +) { + if params == nil { + params = &GetInstanceIdentityDocumentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetInstanceIdentityDocument", params, optFns, + addGetInstanceIdentityDocumentMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetInstanceIdentityDocumentOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetInstanceIdentityDocumentInput provides the input parameters for +// GetInstanceIdentityDocument operation. +type GetInstanceIdentityDocumentInput struct{} + +// GetInstanceIdentityDocumentOutput provides the output parameters for +// GetInstanceIdentityDocument operation. +type GetInstanceIdentityDocumentOutput struct { + InstanceIdentityDocument + + ResultMetadata middleware.Metadata +} + +func addGetInstanceIdentityDocumentMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetInstanceIdentityDocument", + buildGetInstanceIdentityDocumentPath, + buildGetInstanceIdentityDocumentOutput, + ) +} + +func buildGetInstanceIdentityDocumentPath(params interface{}) (string, error) { + return getInstanceIdentityDocumentPath, nil +} + +func buildGetInstanceIdentityDocumentOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(resp.Body, ringBuffer) + + output := &GetInstanceIdentityDocumentOutput{} + if err = json.NewDecoder(body).Decode(&output.InstanceIdentityDocument); err != nil { + return nil, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode instance identity document, %w", err), + Snapshot: ringBuffer.Bytes(), + } + } + + return output, nil +} + +// InstanceIdentityDocument provides the shape for unmarshaling +// an instance identity document +type InstanceIdentityDocument struct { + DevpayProductCodes []string `json:"devpayProductCodes"` + MarketplaceProductCodes []string `json:"marketplaceProductCodes"` + AvailabilityZone string `json:"availabilityZone"` + PrivateIP string `json:"privateIp"` + Version string `json:"version"` + Region string `json:"region"` + InstanceID string `json:"instanceId"` + BillingProducts []string `json:"billingProducts"` + InstanceType string `json:"instanceType"` + AccountID string `json:"accountId"` + PendingTime time.Time `json:"pendingTime"` + ImageID string `json:"imageId"` + KernelID string `json:"kernelId"` + RamdiskID string `json:"ramdiskId"` + Architecture string `json:"architecture"` +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go new file mode 100644 index 00000000..869bfc9f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.go @@ -0,0 +1,77 @@ +package imds + +import ( + "context" + "fmt" + "io" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getMetadataPath = "/latest/meta-data" + +// GetMetadata uses the path provided to request information from the Amazon +// EC2 Instance Metadata Service. The content will be returned as a string, or +// error if the request failed. +func (c *Client) GetMetadata(ctx context.Context, params *GetMetadataInput, optFns ...func(*Options)) (*GetMetadataOutput, error) { + if params == nil { + params = &GetMetadataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMetadata", params, optFns, + addGetMetadataMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetMetadataOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetMetadataInput provides the input parameters for the GetMetadata +// operation. +type GetMetadataInput struct { + // The relative metadata path to retrieve. Can be empty string to retrieve + // a response containing a new line separated list of metadata resources + // available. + // + // Must not include the metadata base path. + // + // May include leading slash. If Path includes trailing slash the trailing slash + // will be included in the request for the resource. + Path string +} + +// GetMetadataOutput provides the output parameters for the GetMetadata +// operation. +type GetMetadataOutput struct { + Content io.ReadCloser + + ResultMetadata middleware.Metadata +} + +func addGetMetadataMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetMetadata", + buildGetMetadataPath, + buildGetMetadataOutput) +} + +func buildGetMetadataPath(params interface{}) (string, error) { + p, ok := params.(*GetMetadataInput) + if !ok { + return "", fmt.Errorf("unknown parameter type %T", params) + } + + return appendURIPath(getMetadataPath, p.Path), nil +} + +func buildGetMetadataOutput(resp *smithyhttp.Response) (interface{}, error) { + return &GetMetadataOutput{ + Content: resp.Body, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go new file mode 100644 index 00000000..8c0572bb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.go @@ -0,0 +1,73 @@ +package imds + +import ( + "context" + "fmt" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// GetRegion retrieves an identity document describing an +// instance. Error is returned if the request fails or is unable to parse +// the response. +func (c *Client) GetRegion( + ctx context.Context, params *GetRegionInput, optFns ...func(*Options), +) ( + *GetRegionOutput, error, +) { + if params == nil { + params = &GetRegionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRegion", params, optFns, + addGetRegionMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetRegionOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetRegionInput provides the input parameters for GetRegion operation. +type GetRegionInput struct{} + +// GetRegionOutput provides the output parameters for GetRegion operation. +type GetRegionOutput struct { + Region string + + ResultMetadata middleware.Metadata +} + +func addGetRegionMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetRegion", + buildGetInstanceIdentityDocumentPath, + buildGetRegionOutput, + ) +} + +func buildGetRegionOutput(resp *smithyhttp.Response) (interface{}, error) { + out, err := buildGetInstanceIdentityDocumentOutput(resp) + if err != nil { + return nil, err + } + + result, ok := out.(*GetInstanceIdentityDocumentOutput) + if !ok { + return nil, fmt.Errorf("unexpected instance identity document type, %T", out) + } + + region := result.Region + if len(region) == 0 { + return "", fmt.Errorf("instance metadata did not return a region value") + } + + return &GetRegionOutput{ + Region: region, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go new file mode 100644 index 00000000..1f9ee97a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.go @@ -0,0 +1,119 @@ +package imds + +import ( + "context" + "fmt" + "io" + "strconv" + "strings" + "time" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getTokenPath = "/latest/api/token" +const tokenTTLHeader = "X-Aws-Ec2-Metadata-Token-Ttl-Seconds" + +// getToken uses the duration to return a token for EC2 IMDS, or an error if +// the request failed. +func (c *Client) getToken(ctx context.Context, params *getTokenInput, optFns ...func(*Options)) (*getTokenOutput, error) { + if params == nil { + params = &getTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "getToken", params, optFns, + addGetTokenMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*getTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type getTokenInput struct { + TokenTTL time.Duration +} + +type getTokenOutput struct { + Token string + TokenTTL time.Duration + + ResultMetadata middleware.Metadata +} + +func addGetTokenMiddleware(stack *middleware.Stack, options Options) error { + err := addRequestMiddleware(stack, + options, + "PUT", + "GetToken", + buildGetTokenPath, + buildGetTokenOutput) + if err != nil { + return err + } + + err = stack.Serialize.Add(&tokenTTLRequestHeader{}, middleware.After) + if err != nil { + return err + } + + return nil +} + +func buildGetTokenPath(interface{}) (string, error) { + return getTokenPath, nil +} + +func buildGetTokenOutput(resp *smithyhttp.Response) (v interface{}, err error) { + defer func() { + closeErr := resp.Body.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("response body close error: %v, original error: %w", closeErr, err) + } + }() + + ttlHeader := resp.Header.Get(tokenTTLHeader) + tokenTTL, err := strconv.ParseInt(ttlHeader, 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse API token, %w", err) + } + + var token strings.Builder + if _, err = io.Copy(&token, resp.Body); err != nil { + return nil, fmt.Errorf("unable to read API token, %w", err) + } + + return &getTokenOutput{ + Token: token.String(), + TokenTTL: time.Duration(tokenTTL) * time.Second, + }, nil +} + +type tokenTTLRequestHeader struct{} + +func (*tokenTTLRequestHeader) ID() string { return "tokenTTLRequestHeader" } +func (*tokenTTLRequestHeader) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("expect HTTP transport, got %T", in.Request) + } + + input, ok := in.Parameters.(*getTokenInput) + if !ok { + return out, metadata, fmt.Errorf("expect getTokenInput, got %T", in.Parameters) + } + + req.Header.Set(tokenTTLHeader, strconv.Itoa(int(input.TokenTTL/time.Second))) + + return next.HandleSerialize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go new file mode 100644 index 00000000..89036972 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.go @@ -0,0 +1,61 @@ +package imds + +import ( + "context" + "io" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const getUserDataPath = "/latest/user-data" + +// GetUserData uses the path provided to request information from the EC2 +// instance metadata service for dynamic data. The content will be returned +// as a string, or error if the request failed. +func (c *Client) GetUserData(ctx context.Context, params *GetUserDataInput, optFns ...func(*Options)) (*GetUserDataOutput, error) { + if params == nil { + params = &GetUserDataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetUserData", params, optFns, + addGetUserDataMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*GetUserDataOutput) + out.ResultMetadata = metadata + return out, nil +} + +// GetUserDataInput provides the input parameters for the GetUserData +// operation. +type GetUserDataInput struct{} + +// GetUserDataOutput provides the output parameters for the GetUserData +// operation. +type GetUserDataOutput struct { + Content io.ReadCloser + + ResultMetadata middleware.Metadata +} + +func addGetUserDataMiddleware(stack *middleware.Stack, options Options) error { + return addAPIRequestMiddleware(stack, + options, + "GetUserData", + buildGetUserDataPath, + buildGetUserDataOutput) +} + +func buildGetUserDataPath(params interface{}) (string, error) { + return getUserDataPath, nil +} + +func buildGetUserDataOutput(resp *smithyhttp.Response) (interface{}, error) { + return &GetUserDataOutput{ + Content: resp.Body, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go new file mode 100644 index 00000000..ad283cf8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.go @@ -0,0 +1,48 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type signRequestMiddleware struct { +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go new file mode 100644 index 00000000..d5765c36 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.go @@ -0,0 +1,12 @@ +// Package imds provides the API client for interacting with the Amazon EC2 +// Instance Metadata Service. +// +// All Client operation calls have a default timeout. If the operation is not +// completed before this timeout expires, the operation will be canceled. This +// timeout can be overridden through the following: +// - Set the options flag DisableDefaultTimeout +// - Provide a Context with a timeout or deadline with calling the client's operations. +// +// See the EC2 IMDS user guide for more information on using the API. +// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html +package imds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go new file mode 100644 index 00000000..d7540da3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.go @@ -0,0 +1,20 @@ +package imds + +import ( + "context" + "github.com/aws/smithy-go/middleware" +) + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go new file mode 100644 index 00000000..3f1bc52a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package imds + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.16.22" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go new file mode 100644 index 00000000..ce774558 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go @@ -0,0 +1,114 @@ +package config + +import ( + "fmt" + "strings" +) + +// ClientEnableState provides an enumeration if the client is enabled, +// disabled, or default behavior. +type ClientEnableState uint + +// Enumeration values for ClientEnableState +const ( + ClientDefaultEnableState ClientEnableState = iota + ClientDisabled + ClientEnabled +) + +// EndpointModeState is the EC2 IMDS Endpoint Configuration Mode +type EndpointModeState uint + +// Enumeration values for ClientEnableState +const ( + EndpointModeStateUnset EndpointModeState = iota + EndpointModeStateIPv4 + EndpointModeStateIPv6 +) + +// SetFromString sets the EndpointModeState based on the provided string value. Unknown values will default to EndpointModeStateUnset +func (e *EndpointModeState) SetFromString(v string) error { + v = strings.TrimSpace(v) + + switch { + case len(v) == 0: + *e = EndpointModeStateUnset + case strings.EqualFold(v, "IPv6"): + *e = EndpointModeStateIPv6 + case strings.EqualFold(v, "IPv4"): + *e = EndpointModeStateIPv4 + default: + return fmt.Errorf("unknown EC2 IMDS endpoint mode, must be either IPv6 or IPv4") + } + return nil +} + +// ClientEnableStateResolver is a config resolver interface for retrieving whether the IMDS client is disabled. +type ClientEnableStateResolver interface { + GetEC2IMDSClientEnableState() (ClientEnableState, bool, error) +} + +// EndpointModeResolver is a config resolver interface for retrieving the EndpointModeState configuration. +type EndpointModeResolver interface { + GetEC2IMDSEndpointMode() (EndpointModeState, bool, error) +} + +// EndpointResolver is a config resolver interface for retrieving the endpoint. +type EndpointResolver interface { + GetEC2IMDSEndpoint() (string, bool, error) +} + +type v1FallbackDisabledResolver interface { + GetEC2IMDSV1FallbackDisabled() (bool, bool) +} + +// ResolveClientEnableState resolves the ClientEnableState from a list of configuration sources. +func ResolveClientEnableState(sources []interface{}) (value ClientEnableState, found bool, err error) { + for _, source := range sources { + if resolver, ok := source.(ClientEnableStateResolver); ok { + value, found, err = resolver.GetEC2IMDSClientEnableState() + if err != nil || found { + return value, found, err + } + } + } + return value, found, err +} + +// ResolveEndpointModeConfig resolves the EndpointModeState from a list of configuration sources. +func ResolveEndpointModeConfig(sources []interface{}) (value EndpointModeState, found bool, err error) { + for _, source := range sources { + if resolver, ok := source.(EndpointModeResolver); ok { + value, found, err = resolver.GetEC2IMDSEndpointMode() + if err != nil || found { + return value, found, err + } + } + } + return value, found, err +} + +// ResolveEndpointConfig resolves the endpoint from a list of configuration sources. +func ResolveEndpointConfig(sources []interface{}) (value string, found bool, err error) { + for _, source := range sources { + if resolver, ok := source.(EndpointResolver); ok { + value, found, err = resolver.GetEC2IMDSEndpoint() + if err != nil || found { + return value, found, err + } + } + } + return value, found, err +} + +// ResolveV1FallbackDisabled ... +func ResolveV1FallbackDisabled(sources []interface{}) (bool, bool) { + for _, source := range sources { + if resolver, ok := source.(v1FallbackDisabledResolver); ok { + if v, found := resolver.GetEC2IMDSV1FallbackDisabled(); found { + return v, true + } + } + } + return false, false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go new file mode 100644 index 00000000..90cf4aeb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.go @@ -0,0 +1,313 @@ +package imds + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "net/url" + "path" + "time" + + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func addAPIRequestMiddleware(stack *middleware.Stack, + options Options, + operation string, + getPath func(interface{}) (string, error), + getOutput func(*smithyhttp.Response) (interface{}, error), +) (err error) { + err = addRequestMiddleware(stack, options, "GET", operation, getPath, getOutput) + if err != nil { + return err + } + + // Token Serializer build and state management. + if !options.disableAPIToken { + err = stack.Finalize.Insert(options.tokenProvider, (*retry.Attempt)(nil).ID(), middleware.After) + if err != nil { + return err + } + + err = stack.Deserialize.Insert(options.tokenProvider, "OperationDeserializer", middleware.Before) + if err != nil { + return err + } + } + + return nil +} + +func addRequestMiddleware(stack *middleware.Stack, + options Options, + method string, + operation string, + getPath func(interface{}) (string, error), + getOutput func(*smithyhttp.Response) (interface{}, error), +) (err error) { + err = awsmiddleware.AddSDKAgentKey(awsmiddleware.FeatureMetadata, "ec2-imds")(stack) + if err != nil { + return err + } + + // Operation timeout + err = stack.Initialize.Add(&operationTimeout{ + Disabled: options.DisableDefaultTimeout, + DefaultTimeout: defaultOperationTimeout, + }, middleware.Before) + if err != nil { + return err + } + + // Operation Serializer + err = stack.Serialize.Add(&serializeRequest{ + GetPath: getPath, + Method: method, + }, middleware.After) + if err != nil { + return err + } + + // Operation endpoint resolver + err = stack.Serialize.Insert(&resolveEndpoint{ + Endpoint: options.Endpoint, + EndpointMode: options.EndpointMode, + }, "OperationSerializer", middleware.Before) + if err != nil { + return err + } + + // Operation Deserializer + err = stack.Deserialize.Add(&deserializeResponse{ + GetOutput: getOutput, + }, middleware.After) + if err != nil { + return err + } + + err = stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: options.ClientLogMode.IsRequest(), + LogRequestWithBody: options.ClientLogMode.IsRequestWithBody(), + LogResponse: options.ClientLogMode.IsResponse(), + LogResponseWithBody: options.ClientLogMode.IsResponseWithBody(), + }, middleware.After) + if err != nil { + return err + } + + err = addSetLoggerMiddleware(stack, options) + if err != nil { + return err + } + + if err := addProtocolFinalizerMiddlewares(stack, options, operation); err != nil { + return fmt.Errorf("add protocol finalizers: %w", err) + } + + // Retry support + return retry.AddRetryMiddlewares(stack, retry.AddRetryMiddlewaresOptions{ + Retryer: options.Retryer, + LogRetryAttempts: options.ClientLogMode.IsRetries(), + }) +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +type serializeRequest struct { + GetPath func(interface{}) (string, error) + Method string +} + +func (*serializeRequest) ID() string { + return "OperationSerializer" +} + +func (m *serializeRequest) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + reqPath, err := m.GetPath(in.Parameters) + if err != nil { + return out, metadata, fmt.Errorf("unable to get request URL path, %w", err) + } + + request.Request.URL.Path = reqPath + request.Request.Method = m.Method + + return next.HandleSerialize(ctx, in) +} + +type deserializeResponse struct { + GetOutput func(*smithyhttp.Response) (interface{}, error) +} + +func (*deserializeResponse) ID() string { + return "OperationDeserializer" +} + +func (m *deserializeResponse) 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 + } + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, fmt.Errorf( + "unexpected transport response type, %T, want %T", out.RawResponse, resp) + } + defer resp.Body.Close() + + // read the full body so that any operation timeouts cleanup will not race + // the body being read. + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return out, metadata, fmt.Errorf("read response body failed, %w", err) + } + resp.Body = ioutil.NopCloser(bytes.NewReader(body)) + + // Anything that's not 200 |< 300 is error + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return out, metadata, &smithyhttp.ResponseError{ + Response: resp, + Err: fmt.Errorf("request to EC2 IMDS failed"), + } + } + + result, err := m.GetOutput(resp) + if err != nil { + return out, metadata, fmt.Errorf( + "unable to get deserialized result for response, %w", err, + ) + } + out.Result = result + + return out, metadata, err +} + +type resolveEndpoint struct { + Endpoint string + EndpointMode EndpointModeState +} + +func (*resolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *resolveEndpoint) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + var endpoint string + if len(m.Endpoint) > 0 { + endpoint = m.Endpoint + } else { + switch m.EndpointMode { + case EndpointModeStateIPv6: + endpoint = defaultIPv6Endpoint + case EndpointModeStateIPv4: + fallthrough + case EndpointModeStateUnset: + endpoint = defaultIPv4Endpoint + default: + return out, metadata, fmt.Errorf("unsupported IMDS endpoint mode") + } + } + + req.URL, err = url.Parse(endpoint) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + return next.HandleSerialize(ctx, in) +} + +const ( + defaultOperationTimeout = 5 * time.Second +) + +// operationTimeout adds a timeout on the middleware stack if the Context the +// stack was called with does not have a deadline. The next middleware must +// complete before the timeout, or the context will be canceled. +// +// If DefaultTimeout is zero, no default timeout will be used if the Context +// does not have a timeout. +// +// The next middleware must also ensure that any resources that are also +// canceled by the stack's context are completely consumed before returning. +// Otherwise the timeout cleanup will race the resource being consumed +// upstream. +type operationTimeout struct { + Disabled bool + DefaultTimeout time.Duration +} + +func (*operationTimeout) ID() string { return "OperationTimeout" } + +func (m *operationTimeout) HandleInitialize( + ctx context.Context, input middleware.InitializeInput, next middleware.InitializeHandler, +) ( + output middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.Disabled { + return next.HandleInitialize(ctx, input) + } + + if _, ok := ctx.Deadline(); !ok && m.DefaultTimeout != 0 { + var cancelFn func() + ctx, cancelFn = context.WithTimeout(ctx, m.DefaultTimeout) + defer cancelFn() + } + + return next.HandleInitialize(ctx, input) +} + +// appendURIPath joins a URI path component to the existing path with `/` +// separators between the path components. If the path being added ends with a +// trailing `/` that slash will be maintained. +func appendURIPath(base, add string) string { + reqPath := path.Join(base, add) + if len(add) != 0 && add[len(add)-1] == '/' { + reqPath += "/" + } + return reqPath +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %w", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %w", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go new file mode 100644 index 00000000..5703c6e1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.go @@ -0,0 +1,261 @@ +package imds + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "net/http" + "sync" + "sync/atomic" + "time" + + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const ( + // Headers for Token and TTL + tokenHeader = "x-aws-ec2-metadata-token" + defaultTokenTTL = 5 * time.Minute +) + +type tokenProvider struct { + client *Client + tokenTTL time.Duration + + token *apiToken + tokenMux sync.RWMutex + + disabled uint32 // Atomic updated +} + +func newTokenProvider(client *Client, ttl time.Duration) *tokenProvider { + return &tokenProvider{ + client: client, + tokenTTL: ttl, + } +} + +// apiToken provides the API token used by all operation calls for th EC2 +// Instance metadata service. +type apiToken struct { + token string + expires time.Time +} + +var timeNow = time.Now + +// Expired returns if the token is expired. +func (t *apiToken) Expired() bool { + // Calling Round(0) on the current time will truncate the monotonic reading only. Ensures credential expiry + // time is always based on reported wall-clock time. + return timeNow().Round(0).After(t.expires) +} + +func (t *tokenProvider) ID() string { return "APITokenProvider" } + +// HandleFinalize is the finalize stack middleware, that if the token provider is +// enabled, will attempt to add the cached API token to the request. If the API +// token is not cached, it will be retrieved in a separate API call, getToken. +// +// For retry attempts, handler must be added after attempt retryer. +// +// If request for getToken fails the token provider may be disabled from future +// requests, depending on the response status code. +func (t *tokenProvider) HandleFinalize( + ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if t.fallbackEnabled() && !t.enabled() { + // short-circuits to insecure data flow if token provider is disabled. + return next.HandleFinalize(ctx, input) + } + + req, ok := input.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport request type %T", input.Request) + } + + tok, err := t.getToken(ctx) + if err != nil { + // If the error allows the token to downgrade to insecure flow allow that. + var bypassErr *bypassTokenRetrievalError + if errors.As(err, &bypassErr) { + return next.HandleFinalize(ctx, input) + } + + return out, metadata, fmt.Errorf("failed to get API token, %w", err) + } + + req.Header.Set(tokenHeader, tok.token) + + return next.HandleFinalize(ctx, input) +} + +// HandleDeserialize is the deserialize stack middleware for determining if the +// operation the token provider is decorating failed because of a 401 +// unauthorized status code. If the operation failed for that reason the token +// provider needs to be re-enabled so that it can start adding the API token to +// operation calls. +func (t *tokenProvider) HandleDeserialize( + ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler, +) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, input) + if err == nil { + return out, metadata, err + } + + resp, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, fmt.Errorf("expect HTTP transport, got %T", out.RawResponse) + } + + if resp.StatusCode == http.StatusUnauthorized { // unauthorized + t.enable() + err = &retryableError{Err: err, isRetryable: true} + } + + return out, metadata, err +} + +func (t *tokenProvider) getToken(ctx context.Context) (tok *apiToken, err error) { + if t.fallbackEnabled() && !t.enabled() { + return nil, &bypassTokenRetrievalError{ + Err: fmt.Errorf("cannot get API token, provider disabled"), + } + } + + t.tokenMux.RLock() + tok = t.token + t.tokenMux.RUnlock() + + if tok != nil && !tok.Expired() { + return tok, nil + } + + tok, err = t.updateToken(ctx) + if err != nil { + return nil, err + } + + return tok, nil +} + +func (t *tokenProvider) updateToken(ctx context.Context) (*apiToken, error) { + t.tokenMux.Lock() + defer t.tokenMux.Unlock() + + // Prevent multiple requests to update retrieving the token. + if t.token != nil && !t.token.Expired() { + tok := t.token + return tok, nil + } + + result, err := t.client.getToken(ctx, &getTokenInput{ + TokenTTL: t.tokenTTL, + }) + if err != nil { + var statusErr interface{ HTTPStatusCode() int } + if errors.As(err, &statusErr) { + switch statusErr.HTTPStatusCode() { + // Disable future get token if failed because of 403, 404, or 405 + case http.StatusForbidden, + http.StatusNotFound, + http.StatusMethodNotAllowed: + + if t.fallbackEnabled() { + logger := middleware.GetLogger(ctx) + logger.Logf(logging.Warn, "falling back to IMDSv1: %v", err) + t.disable() + } + + // 400 errors are terminal, and need to be upstreamed + case http.StatusBadRequest: + return nil, err + } + } + + // Disable if request send failed or timed out getting response + var re *smithyhttp.RequestSendError + var ce *smithy.CanceledError + if errors.As(err, &re) || errors.As(err, &ce) { + atomic.StoreUint32(&t.disabled, 1) + } + + if !t.fallbackEnabled() { + // NOTE: getToken() is an implementation detail of some outer operation + // (e.g. GetMetadata). It has its own retries that have already been exhausted. + // Mark the underlying error as a terminal error. + err = &retryableError{Err: err, isRetryable: false} + return nil, err + } + + // Token couldn't be retrieved, fallback to IMDSv1 insecure flow for this request + // and allow the request to proceed. Future requests _may_ re-attempt fetching a + // token if not disabled. + return nil, &bypassTokenRetrievalError{Err: err} + } + + tok := &apiToken{ + token: result.Token, + expires: timeNow().Add(result.TokenTTL), + } + t.token = tok + + return tok, nil +} + +// enabled returns if the token provider is current enabled or not. +func (t *tokenProvider) enabled() bool { + return atomic.LoadUint32(&t.disabled) == 0 +} + +// fallbackEnabled returns false if EnableFallback is [aws.FalseTernary], true otherwise +func (t *tokenProvider) fallbackEnabled() bool { + switch t.client.options.EnableFallback { + case aws.FalseTernary: + return false + default: + return true + } +} + +// disable disables the token provider and it will no longer attempt to inject +// the token, nor request updates. +func (t *tokenProvider) disable() { + atomic.StoreUint32(&t.disabled, 1) +} + +// enable enables the token provide to start refreshing tokens, and adding them +// to the pending request. +func (t *tokenProvider) enable() { + t.tokenMux.Lock() + t.token = nil + t.tokenMux.Unlock() + atomic.StoreUint32(&t.disabled, 0) +} + +type bypassTokenRetrievalError struct { + Err error +} + +func (e *bypassTokenRetrievalError) Error() string { + return fmt.Sprintf("bypass token retrieval, %v", e.Err) +} + +func (e *bypassTokenRetrievalError) Unwrap() error { return e.Err } + +type retryableError struct { + Err error + isRetryable bool +} + +func (e *retryableError) RetryableError() bool { return e.isRetryable } + +func (e *retryableError) Error() string { return e.Err.Error() } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md index 2d01b10c..d2552e46 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md @@ -1,3 +1,399 @@ +# v1.17.44 (2024-12-19) + +* **Bug Fix**: Fix improper use of printf-style functions. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.43 (2024-12-03.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.42 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.41 (2024-11-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.40 (2024-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.39 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.38 (2024-11-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.37 (2024-11-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.36 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.35 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.34 (2024-10-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.33 (2024-10-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.32 (2024-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.31 (2024-10-09) + +* **Bug Fix**: Fixup some integration tests. + +# v1.17.30 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.29 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.28 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.27 (2024-10-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.26 (2024-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.25 (2024-09-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.24 (2024-09-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.23 (2024-09-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.22 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.21 (2024-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.20 (2024-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.19 (2024-09-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.18 (2024-09-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.17 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.16 (2024-08-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.15 (2024-08-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.14 (2024-08-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.13 (2024-08-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.12 (2024-08-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.11 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.10 (2024-08-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.9 (2024-07-24) + +* **Documentation**: Clarify region hint and credential usage in HeadBucketRegion. + +# v1.17.8 (2024-07-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.7 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2024-07-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2024-07-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2024-06-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.25 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.24 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.23 (2024-06-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.22 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.21 (2024-05-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.20 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.19 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.18 (2024-05-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.17 (2024-05-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.16 (2024-05-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2024-04-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.14 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2024-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2024-03-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2024-03-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2024-03-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2024-02-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2024-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2024-02-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2024-02-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.15 (2024-01-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.14 (2024-01-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.13 (2024-01-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.12 (2024-01-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.11 (2024-01-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.9 (2023-12-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.8 (2023-12-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.7 (2023-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.6 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.5 (2023-12-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-11-28.3) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-11-28.2) + +* **Feature**: Add S3Express support. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2023-11-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.3 (2023-11-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2023-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-11-17) + +* **Feature**: **BREAKING CHANGE** Correct nullability of a large number of S3 structure fields. See https://github.com/aws/aws-sdk-go-v2/issues/2162. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2023-11-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2023-11-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2023-11-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.5 (2023-11-09.2) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.4 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/bucket_region.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/bucket_region.go index 2d8bd7e0..8c701952 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/bucket_region.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/bucket_region.go @@ -17,15 +17,13 @@ const bucketRegionHeader = "X-Amz-Bucket-Region" // GetBucketRegion will attempt to get the region for a bucket using the // client's configured region to determine which AWS partition to perform the query on. // -// The request will not be signed, and will not use your AWS credentials. -// // A BucketNotFound error will be returned if the bucket does not exist in the // AWS partition the client region belongs to. // // For example to get the region of a bucket which exists in "eu-central-1" // you could provide a region hint of "us-west-2". // -// cfg, err := config.LoadDefaultConfig(context.TODO()) +// cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-west-2")) // if err != nil { // log.Println("error:", err) // return @@ -60,12 +58,22 @@ const bucketRegionHeader = "X-Amz-Bucket-Region" // if err != nil { // panic(err) // } +// +// If buckets are public, you may use anonymous credential like so. +// +// manager.GetBucketRegion(ctx, s3.NewFromConfig(cfg), bucket, func(o *s3.Options) { +// o.Credentials = nil +// // Or +// o.Credentials = aws.AnonymousCredentials{} +// }) +// +// The request with anonymous credentials will not be signed. +// Otherwise credentials would be required for private buckets. func GetBucketRegion(ctx context.Context, client HeadBucketAPIClient, bucket string, optFns ...func(*s3.Options)) (string, error) { var captureBucketRegion deserializeBucketRegion clientOptionFns := make([]func(*s3.Options), len(optFns)+1) clientOptionFns[0] = func(options *s3.Options) { - options.Credentials = aws.AnonymousCredentials{} options.APIOptions = append(options.APIOptions, captureBucketRegion.RegisterMiddleware) } copy(clientOptionFns[1:], optFns) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go index 2ebcea58..5a9fe2dd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/download.go @@ -183,7 +183,10 @@ func (d Downloader) Download(ctx context.Context, w io.WriterAt, input *s3.GetOb // Copy ClientOptions clientOptions := make([]func(*s3.Options), 0, len(impl.cfg.ClientOptions)+1) clientOptions = append(clientOptions, func(o *s3.Options) { - o.APIOptions = append(o.APIOptions, middleware.AddSDKAgentKey(middleware.FeatureMetadata, userAgentKey)) + o.APIOptions = append(o.APIOptions, + middleware.AddSDKAgentKey(middleware.FeatureMetadata, userAgentKey), + addFeatureUserAgent, // yes, there are two of these + ) }) clientOptions = append(clientOptions, impl.cfg.ClientOptions...) impl.cfg.ClientOptions = clientOptions @@ -436,8 +439,8 @@ func (d *downloader) setTotalBytes(resp *s3.GetObjectOutput) { if resp.ContentRange == nil { // ContentRange is nil when the full file contents is provided, and // is not chunked. Use ContentLength instead. - if resp.ContentLength > 0 { - d.totalBytes = resp.ContentLength + if aws.ToInt64(resp.ContentLength) > 0 { + d.totalBytes = aws.ToInt64(resp.ContentLength) return } } else { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go index d9dd866f..aacda4f6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go @@ -3,4 +3,4 @@ package manager // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.4" +const goModuleVersion = "1.17.44" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go index d68246c2..18aff6e9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/upload.go @@ -3,6 +3,7 @@ package manager import ( "bytes" "context" + "errors" "fmt" "io" "net/http" @@ -10,11 +11,13 @@ import ( "sync" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/internal/awsutil" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + smithymiddleware "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" ) // MaxUploadParts is the maximum allowed number of parts in a multi-part upload @@ -308,6 +311,10 @@ func (u Uploader) Upload(ctx context.Context, input *s3.PutObjectInput, opts ... clientOptions = append(clientOptions, func(o *s3.Options) { o.APIOptions = append(o.APIOptions, middleware.AddSDKAgentKey(middleware.FeatureMetadata, userAgentKey), + addFeatureUserAgent, // yes, there are two of these + func(s *smithymiddleware.Stack) error { + return s.Finalize.Insert(&setS3ExpressDefaultChecksum{}, "ResolveEndpointV2", smithymiddleware.After) + }, ) }) clientOptions = append(clientOptions, i.cfg.ClientOptions...) @@ -501,7 +508,7 @@ func (u *uploader) singlePart(r io.ReadSeeker, cleanup func()) (*UploadOutput, e return &UploadOutput{ Location: locationRecorder.location, - BucketKeyEnabled: out.BucketKeyEnabled, + BucketKeyEnabled: aws.ToBool(out.BucketKeyEnabled), ChecksumCRC32: out.ChecksumCRC32, ChecksumCRC32C: out.ChecksumCRC32C, ChecksumSHA1: out.ChecksumSHA1, @@ -568,9 +575,11 @@ type chunk struct { // since S3 required this list to be sent in sorted order. type completedParts []types.CompletedPart -func (a completedParts) Len() int { return len(a) } -func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a completedParts) Less(i, j int) bool { return a[i].PartNumber < a[j].PartNumber } +func (a completedParts) Len() int { return len(a) } +func (a completedParts) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a completedParts) Less(i, j int) bool { + return aws.ToInt32(a[i].PartNumber) < aws.ToInt32(a[j].PartNumber) +} // upload will perform a multipart upload using the firstBuf buffer containing // the first chunk of data. @@ -639,7 +648,7 @@ func (u *multiuploader) upload(firstBuf io.ReadSeeker, cleanup func()) (*UploadO UploadID: u.uploadID, CompletedParts: u.parts, - BucketKeyEnabled: completeOut.BucketKeyEnabled, + BucketKeyEnabled: aws.ToBool(completeOut.BucketKeyEnabled), ChecksumCRC32: completeOut.ChecksumCRC32, ChecksumCRC32C: completeOut.ChecksumCRC32C, ChecksumSHA1: completeOut.ChecksumSHA1, @@ -677,7 +686,7 @@ func (u *multiuploader) shouldContinue(part int32, nextChunkLen int, err error) msg = fmt.Sprintf("exceeded total allowed S3 limit MaxUploadParts (%d). Adjust PartSize to fit in this limit", MaxUploadParts) } - return false, fmt.Errorf(msg) + return false, errors.New(msg) } return true, err @@ -722,7 +731,7 @@ func (u *multiuploader) send(c chunk) error { // PutObject as they are never valid for individual parts of a // multipart upload. - PartNumber: c.num, + PartNumber: aws.Int32(c.num), UploadId: &u.uploadID, } // TODO should do copy then clear? @@ -734,7 +743,7 @@ func (u *multiuploader) send(c chunk) error { var completed types.CompletedPart awsutil.Copy(&completed, resp) - completed.PartNumber = c.num + completed.PartNumber = aws.Int32(c.num) u.m.Lock() u.parts = append(u.parts, completed) @@ -806,3 +815,70 @@ type readerAtSeeker interface { io.ReaderAt io.ReadSeeker } + +// setS3ExpressDefaultChecksum defaults to CRC32 for S3Express buckets, +// which is required when uploading to those through transfer manager. +type setS3ExpressDefaultChecksum struct{} + +func (*setS3ExpressDefaultChecksum) ID() string { + return "setS3ExpressDefaultChecksum" +} + +func (*setS3ExpressDefaultChecksum) HandleFinalize( + ctx context.Context, in smithymiddleware.FinalizeInput, next smithymiddleware.FinalizeHandler, +) ( + out smithymiddleware.FinalizeOutput, metadata smithymiddleware.Metadata, err error, +) { + const checksumHeader = "x-amz-checksum-algorithm" + + if internalcontext.GetS3Backend(ctx) != internalcontext.S3BackendS3Express { + return next.HandleFinalize(ctx, in) + } + + // If this is CreateMultipartUpload we need to ensure the checksum + // algorithm header is present. Otherwise everything is driven off the + // context setting and we can let it flow from there. + if middleware.GetOperationName(ctx) == "CreateMultipartUpload" { + r, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if internalcontext.GetChecksumInputAlgorithm(ctx) == "" { + r.Header.Set(checksumHeader, "CRC32") + } + return next.HandleFinalize(ctx, in) + } else if internalcontext.GetChecksumInputAlgorithm(ctx) == "" { + ctx = internalcontext.SetChecksumInputAlgorithm(ctx, string(types.ChecksumAlgorithmCrc32)) + } + + return next.HandleFinalize(ctx, in) +} + +func addFeatureUserAgent(stack *smithymiddleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(middleware.UserAgentFeatureS3Transfer) + return nil +} + +func getOrAddRequestUserAgent(stack *smithymiddleware.Stack) (*middleware.RequestUserAgent, error) { + id := (*middleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = middleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, smithymiddleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*middleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go new file mode 100644 index 00000000..0b81db54 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.go @@ -0,0 +1,45 @@ +package auth + +import ( + "github.com/aws/smithy-go/auth" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// HTTPAuthScheme is the SDK's internal implementation of smithyhttp.AuthScheme +// for pre-existing implementations where the signer was added to client +// config. SDK clients will key off of this type and ensure per-operation +// updates to those signers persist on the scheme itself. +type HTTPAuthScheme struct { + schemeID string + signer smithyhttp.Signer +} + +var _ smithyhttp.AuthScheme = (*HTTPAuthScheme)(nil) + +// NewHTTPAuthScheme returns an auth scheme instance with the given config. +func NewHTTPAuthScheme(schemeID string, signer smithyhttp.Signer) *HTTPAuthScheme { + return &HTTPAuthScheme{ + schemeID: schemeID, + signer: signer, + } +} + +// SchemeID identifies the auth scheme. +func (s *HTTPAuthScheme) SchemeID() string { + return s.schemeID +} + +// IdentityResolver gets the identity resolver for the auth scheme. +func (s *HTTPAuthScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { + return o.GetIdentityResolver(s.schemeID) +} + +// Signer gets the signer for the auth scheme. +func (s *HTTPAuthScheme) Signer() smithyhttp.Signer { + return s.signer +} + +// WithSigner returns a new instance of the auth scheme with the updated signer. +func (s *HTTPAuthScheme) WithSigner(signer smithyhttp.Signer) *HTTPAuthScheme { + return NewHTTPAuthScheme(s.schemeID, signer) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go index ff229c04..bbc2ec06 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.go @@ -16,6 +16,9 @@ const SigV4 = "sigv4" // Authentication Scheme Signature Version 4A const SigV4A = "sigv4a" +// SigV4S3Express identifies the S3 S3Express auth scheme. +const SigV4S3Express = "sigv4-s3express" + // None is a constant representing the // None Authentication Scheme const None = "none" @@ -24,9 +27,10 @@ const None = "none" // that indicates the list of supported AWS // authentication schemes var SupportedSchemes = map[string]bool{ - SigV4: true, - SigV4A: true, - None: true, + SigV4: true, + SigV4A: true, + SigV4S3Express: true, + None: true, } // AuthenticationScheme is a representation of @@ -93,10 +97,11 @@ func GetAuthenticationSchemes(p *smithy.Properties) ([]AuthenticationScheme, err for _, scheme := range authSchemes { authScheme, _ := scheme.(map[string]interface{}) - switch authScheme["name"] { - case SigV4: + version := authScheme["name"].(string) + switch version { + case SigV4, SigV4S3Express: v4Scheme := AuthenticationSchemeV4{ - Name: SigV4, + Name: version, SigningName: getSigningName(authScheme), SigningRegion: getSigningRegion(authScheme), DisableDoubleEncoding: getDisableDoubleEncoding(authScheme), diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go new file mode 100644 index 00000000..f059b5d3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.go @@ -0,0 +1,43 @@ +package smithy + +import ( + "context" + "fmt" + "time" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/auth/bearer" +) + +// BearerTokenAdapter adapts smithy bearer.Token to smithy auth.Identity. +type BearerTokenAdapter struct { + Token bearer.Token +} + +var _ auth.Identity = (*BearerTokenAdapter)(nil) + +// Expiration returns the time of expiration for the token. +func (v *BearerTokenAdapter) Expiration() time.Time { + return v.Token.Expires +} + +// BearerTokenProviderAdapter adapts smithy bearer.TokenProvider to smithy +// auth.IdentityResolver. +type BearerTokenProviderAdapter struct { + Provider bearer.TokenProvider +} + +var _ (auth.IdentityResolver) = (*BearerTokenProviderAdapter)(nil) + +// GetIdentity retrieves a bearer token using the underlying provider. +func (v *BearerTokenProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( + auth.Identity, error, +) { + token, err := v.Provider.RetrieveBearerToken(ctx) + if err != nil { + return nil, fmt.Errorf("get token: %w", err) + } + + return &BearerTokenAdapter{Token: token}, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go new file mode 100644 index 00000000..a8828152 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.go @@ -0,0 +1,35 @@ +package smithy + +import ( + "context" + "fmt" + + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/auth/bearer" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// BearerTokenSignerAdapter adapts smithy bearer.Signer to smithy http +// auth.Signer. +type BearerTokenSignerAdapter struct { + Signer bearer.Signer +} + +var _ (smithyhttp.Signer) = (*BearerTokenSignerAdapter)(nil) + +// SignRequest signs the request with the provided bearer token. +func (v *BearerTokenSignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, _ smithy.Properties) error { + ca, ok := identity.(*BearerTokenAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + signed, err := v.Signer.SignWithBearerToken(ctx, ca.Token, r) + if err != nil { + return fmt.Errorf("sign request: %w", err) + } + + *r = *signed.(*smithyhttp.Request) + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go new file mode 100644 index 00000000..f926c4aa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.go @@ -0,0 +1,46 @@ +package smithy + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// CredentialsAdapter adapts aws.Credentials to auth.Identity. +type CredentialsAdapter struct { + Credentials aws.Credentials +} + +var _ auth.Identity = (*CredentialsAdapter)(nil) + +// Expiration returns the time of expiration for the credentials. +func (v *CredentialsAdapter) Expiration() time.Time { + return v.Credentials.Expires +} + +// CredentialsProviderAdapter adapts aws.CredentialsProvider to auth.IdentityResolver. +type CredentialsProviderAdapter struct { + Provider aws.CredentialsProvider +} + +var _ (auth.IdentityResolver) = (*CredentialsProviderAdapter)(nil) + +// GetIdentity retrieves AWS credentials using the underlying provider. +func (v *CredentialsProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( + auth.Identity, error, +) { + if v.Provider == nil { + return &CredentialsAdapter{Credentials: aws.Credentials{}}, nil + } + + creds, err := v.Provider.Retrieve(ctx) + if err != nil { + return nil, fmt.Errorf("get credentials: %w", err) + } + + return &CredentialsAdapter{Credentials: creds}, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go new file mode 100644 index 00000000..42b45867 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.go @@ -0,0 +1,2 @@ +// Package smithy adapts concrete AWS auth and signing types to the generic smithy versions. +package smithy diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go new file mode 100644 index 00000000..24db8e14 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.go @@ -0,0 +1,57 @@ +package smithy + +import ( + "context" + "fmt" + + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// V4SignerAdapter adapts v4.HTTPSigner to smithy http.Signer. +type V4SignerAdapter struct { + Signer v4.HTTPSigner + Logger logging.Logger + LogSigning bool +} + +var _ (smithyhttp.Signer) = (*V4SignerAdapter)(nil) + +// SignRequest signs the request with the provided identity. +func (v *V4SignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { + ca, ok := identity.(*CredentialsAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + name, ok := smithyhttp.GetSigV4SigningName(&props) + if !ok { + return fmt.Errorf("sigv4 signing name is required") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&props) + if !ok { + return fmt.Errorf("sigv4 signing region is required") + } + + hash := v4.GetPayloadHash(ctx) + signingTime := sdk.NowTime() + skew := internalcontext.GetAttemptSkewContext(ctx) + signingTime = signingTime.Add(skew) + err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, signingTime, func(o *v4.SignerOptions) { + o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) + + o.Logger = v.Logger + o.LogSigning = v.LogSigning + }) + if err != nil { + return fmt.Errorf("sign http: %w", err) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/awsutil/path_value.go deleted file mode 100644 index 58ef438a..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/awsutil/path_value.go +++ /dev/null @@ -1,225 +0,0 @@ -package awsutil - -import ( - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/jmespath/go-jmespath" -) - -var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) - -// rValuesAtPath returns a slice of values found in value v. The values -// in v are explored recursively so all nested values are collected. -func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value { - pathparts := strings.Split(path, "||") - if len(pathparts) > 1 { - for _, pathpart := range pathparts { - vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm) - if len(vals) > 0 { - return vals - } - } - return nil - } - - values := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))} - components := strings.Split(path, ".") - for len(values) > 0 && len(components) > 0 { - var index *int64 - var indexStar bool - c := strings.TrimSpace(components[0]) - if c == "" { // no actual component, illegal syntax - return nil - } else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] { - // TODO normalize case for user - return nil // don't support unexported fields - } - - // parse this component - if m := indexRe.FindStringSubmatch(c); m != nil { - c = m[1] - if m[2] == "" { - index = nil - indexStar = true - } else { - i, _ := strconv.ParseInt(m[2], 10, 32) - index = &i - indexStar = false - } - } - - nextvals := []reflect.Value{} - for _, value := range values { - // pull component name out of struct member - if value.Kind() != reflect.Struct { - continue - } - - if c == "*" { // pull all members - for i := 0; i < value.NumField(); i++ { - if f := reflect.Indirect(value.Field(i)); f.IsValid() { - nextvals = append(nextvals, f) - } - } - continue - } - - value = value.FieldByNameFunc(func(name string) bool { - if c == name { - return true - } else if !caseSensitive && strings.EqualFold(name, c) { - return true - } - return false - }) - - if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 { - if !value.IsNil() { - value.Set(reflect.Zero(value.Type())) - } - return []reflect.Value{value} - } - - if createPath && value.Kind() == reflect.Ptr && value.IsNil() { - // TODO if the value is the terminus it should not be created - // if the value to be set to its position is nil. - value.Set(reflect.New(value.Type().Elem())) - value = value.Elem() - } else { - value = reflect.Indirect(value) - } - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - - if indexStar || index != nil { - nextvals = []reflect.Value{} - for _, valItem := range values { - value := reflect.Indirect(valItem) - if value.Kind() != reflect.Slice { - continue - } - - if indexStar { // grab all indices - for i := 0; i < value.Len(); i++ { - idx := reflect.Indirect(value.Index(i)) - if idx.IsValid() { - nextvals = append(nextvals, idx) - } - } - continue - } - - // pull out index - i := int(*index) - if i >= value.Len() { // check out of bounds - if createPath { - // TODO resize slice - } else { - continue - } - } else if i < 0 { // support negative indexing - i = value.Len() + i - } - value = reflect.Indirect(value.Index(i)) - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - } - - components = components[1:] - } - return values -} - -// ValuesAtPath returns a list of values at the case insensitive lexical -// path inside of a structure. -func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { - result, err := jmespath.Search(path, i) - if err != nil { - return nil, err - } - - v := reflect.ValueOf(result) - if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) { - return nil, nil - } - if s, ok := result.([]interface{}); ok { - return s, err - } - if v.Kind() == reflect.Map && v.Len() == 0 { - return nil, nil - } - if v.Kind() == reflect.Slice { - out := make([]interface{}, v.Len()) - for i := 0; i < v.Len(); i++ { - out[i] = v.Index(i).Interface() - } - return out, nil - } - - return []interface{}{result}, nil -} - -// SetValueAtPath sets a value at the case insensitive lexical path inside -// of a structure. -func SetValueAtPath(i interface{}, path string, v interface{}) { - if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) - } - } -} - -func setValue(dstVal reflect.Value, src interface{}) { - if dstVal.Kind() == reflect.Ptr { - dstVal = reflect.Indirect(dstVal) - } - srcVal := reflect.ValueOf(src) - - if !srcVal.IsValid() { // src is literal nil - if dstVal.CanAddr() { - // Convert to pointer so that pointer's value can be nil'ed - // dstVal = dstVal.Addr() - } - dstVal.Set(reflect.Zero(dstVal.Type())) - - } else if srcVal.Kind() == reflect.Ptr { - if srcVal.IsNil() { - srcVal = reflect.Zero(dstVal.Type()) - } else { - srcVal = reflect.ValueOf(src).Elem() - } - dstVal.Set(srcVal) - } else { - if dstVal.Kind() == reflect.String { - dstVal.SetString(srcVal.String()) - } else { - dstVal.Set(srcVal) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index d260b444..5a5cdf06 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,146 @@ +# v1.3.26 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.25 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.24 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.23 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.22 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.21 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.20 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.19 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.18 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.17 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.16 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.15 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.14 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.13 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.12 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.11 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.10 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.9 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.8 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.5 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2024-03-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.2.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index 991b7b84..a46fe9de 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.2.2" +const goModuleVersion = "1.3.26" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go new file mode 100644 index 00000000..f0c283d3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.go @@ -0,0 +1,52 @@ +package context + +import ( + "context" + "time" + + "github.com/aws/smithy-go/middleware" +) + +type s3BackendKey struct{} +type checksumInputAlgorithmKey struct{} +type clockSkew struct{} + +const ( + // S3BackendS3Express identifies the S3Express backend + S3BackendS3Express = "S3Express" +) + +// SetS3Backend stores the resolved endpoint backend within the request +// context, which is required for a variety of custom S3 behaviors. +func SetS3Backend(ctx context.Context, typ string) context.Context { + return middleware.WithStackValue(ctx, s3BackendKey{}, typ) +} + +// GetS3Backend retrieves the stored endpoint backend within the context. +func GetS3Backend(ctx context.Context) string { + v, _ := middleware.GetStackValue(ctx, s3BackendKey{}).(string) + return v +} + +// SetChecksumInputAlgorithm sets the request checksum algorithm on the +// context. +func SetChecksumInputAlgorithm(ctx context.Context, value string) context.Context { + return middleware.WithStackValue(ctx, checksumInputAlgorithmKey{}, value) +} + +// GetChecksumInputAlgorithm returns the checksum algorithm from the context. +func GetChecksumInputAlgorithm(ctx context.Context) string { + v, _ := middleware.GetStackValue(ctx, checksumInputAlgorithmKey{}).(string) + return v +} + +// SetAttemptSkewContext sets the clock skew value on the context +func SetAttemptSkewContext(ctx context.Context, v time.Duration) context.Context { + return middleware.WithStackValue(ctx, clockSkew{}, v) +} + +// GetAttemptSkewContext gets the clock skew value from the context +func GetAttemptSkewContext(ctx context.Context) time.Duration { + x, _ := middleware.GetStackValue(ctx, clockSkew{}).(time.Duration) + return x +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go index ba603275..91414afe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.go @@ -12,11 +12,12 @@ type Partition struct { // PartitionConfig provides the endpoint metadata for an AWS region or partition. type PartitionConfig struct { - Name string `json:"name"` - DnsSuffix string `json:"dnsSuffix"` - DualStackDnsSuffix string `json:"dualStackDnsSuffix"` - SupportsFIPS bool `json:"supportsFIPS"` - SupportsDualStack bool `json:"supportsDualStack"` + Name string `json:"name"` + DnsSuffix string `json:"dnsSuffix"` + DualStackDnsSuffix string `json:"dualStackDnsSuffix"` + SupportsFIPS bool `json:"supportsFIPS"` + SupportsDualStack bool `json:"supportsDualStack"` + ImplicitGlobalRegion string `json:"implicitGlobalRegion"` } type RegionOverrides struct { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go index 7ea49d4e..5f077999 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go @@ -11,13 +11,14 @@ func GetPartition(region string) *PartitionConfig { var partitions = []Partition{ { ID: "aws", - RegionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$", + RegionRegex: "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ - Name: "aws", - DnsSuffix: "amazonaws.com", - DualStackDnsSuffix: "api.aws", - SupportsFIPS: true, - SupportsDualStack: true, + Name: "aws", + DnsSuffix: "amazonaws.com", + DualStackDnsSuffix: "api.aws", + SupportsFIPS: true, + SupportsDualStack: true, + ImplicitGlobalRegion: "us-east-1", }, Regions: map[string]RegionOverrides{ "af-south-1": { @@ -90,6 +91,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "ap-southeast-4": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, "aws-global": { Name: nil, DnsSuffix: nil, @@ -104,6 +112,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "ca-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, "eu-central-1": { Name: nil, DnsSuffix: nil, @@ -160,6 +175,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "il-central-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, "me-central-1": { Name: nil, DnsSuffix: nil, @@ -215,11 +237,12 @@ var partitions = []Partition{ ID: "aws-cn", RegionRegex: "^cn\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ - Name: "aws-cn", - DnsSuffix: "amazonaws.com.cn", - DualStackDnsSuffix: "api.amazonwebservices.com.cn", - SupportsFIPS: true, - SupportsDualStack: true, + Name: "aws-cn", + DnsSuffix: "amazonaws.com.cn", + DualStackDnsSuffix: "api.amazonwebservices.com.cn", + SupportsFIPS: true, + SupportsDualStack: true, + ImplicitGlobalRegion: "cn-northwest-1", }, Regions: map[string]RegionOverrides{ "aws-cn-global": { @@ -249,11 +272,12 @@ var partitions = []Partition{ ID: "aws-us-gov", RegionRegex: "^us\\-gov\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ - Name: "aws-us-gov", - DnsSuffix: "amazonaws.com", - DualStackDnsSuffix: "api.aws", - SupportsFIPS: true, - SupportsDualStack: true, + Name: "aws-us-gov", + DnsSuffix: "amazonaws.com", + DualStackDnsSuffix: "api.aws", + SupportsFIPS: true, + SupportsDualStack: true, + ImplicitGlobalRegion: "us-gov-west-1", }, Regions: map[string]RegionOverrides{ "aws-us-gov-global": { @@ -283,11 +307,12 @@ var partitions = []Partition{ ID: "aws-iso", RegionRegex: "^us\\-iso\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ - Name: "aws-iso", - DnsSuffix: "c2s.ic.gov", - DualStackDnsSuffix: "c2s.ic.gov", - SupportsFIPS: true, - SupportsDualStack: false, + Name: "aws-iso", + DnsSuffix: "c2s.ic.gov", + DualStackDnsSuffix: "c2s.ic.gov", + SupportsFIPS: true, + SupportsDualStack: false, + ImplicitGlobalRegion: "us-iso-east-1", }, Regions: map[string]RegionOverrides{ "aws-iso-global": { @@ -317,11 +342,12 @@ var partitions = []Partition{ ID: "aws-iso-b", RegionRegex: "^us\\-isob\\-\\w+\\-\\d+$", DefaultConfig: PartitionConfig{ - Name: "aws-iso-b", - DnsSuffix: "sc2s.sgov.gov", - DualStackDnsSuffix: "sc2s.sgov.gov", - SupportsFIPS: true, - SupportsDualStack: false, + Name: "aws-iso-b", + DnsSuffix: "sc2s.sgov.gov", + DualStackDnsSuffix: "sc2s.sgov.gov", + SupportsFIPS: true, + SupportsDualStack: false, + ImplicitGlobalRegion: "us-isob-east-1", }, Regions: map[string]RegionOverrides{ "aws-iso-b-global": { @@ -340,4 +366,38 @@ var partitions = []Partition{ }, }, }, + { + ID: "aws-iso-e", + RegionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-e", + DnsSuffix: "cloud.adc-e.uk", + DualStackDnsSuffix: "cloud.adc-e.uk", + SupportsFIPS: true, + SupportsDualStack: false, + ImplicitGlobalRegion: "eu-isoe-west-1", + }, + Regions: map[string]RegionOverrides{ + "eu-isoe-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, + }, + }, + { + ID: "aws-iso-f", + RegionRegex: "^us\\-isof\\-\\w+\\-\\d+$", + DefaultConfig: PartitionConfig{ + Name: "aws-iso-f", + DnsSuffix: "csp.hci.ic.gov", + DualStackDnsSuffix: "csp.hci.ic.gov", + SupportsFIPS: true, + SupportsDualStack: false, + ImplicitGlobalRegion: "us-isof-south-1", + }, + Regions: map[string]RegionOverrides{}, + }, } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json index ab107ca5..a2f06808 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json @@ -9,7 +9,7 @@ "supportsDualStack" : true, "supportsFIPS" : true }, - "regionRegex" : "^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$", + "regionRegex" : "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", "regions" : { "af-south-1" : { "description" : "Africa (Cape Town)" @@ -44,12 +44,18 @@ "ap-southeast-4" : { "description" : "Asia Pacific (Melbourne)" }, + "ap-southeast-5" : { + "description" : "Asia Pacific (Malaysia)" + }, "aws-global" : { "description" : "AWS Standard global region" }, "ca-central-1" : { "description" : "Canada (Central)" }, + "ca-west-1" : { + "description" : "Canada West (Calgary)" + }, "eu-central-1" : { "description" : "Europe (Frankfurt)" }, @@ -195,7 +201,11 @@ "supportsFIPS" : true }, "regionRegex" : "^eu\\-isoe\\-\\w+\\-\\d+$", - "regions" : { } + "regions" : { + "eu-isoe-west-1" : { + "description" : "EU ISOE West" + } + } }, { "id" : "aws-iso-f", "outputs" : { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go new file mode 100644 index 00000000..67950ca3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.go @@ -0,0 +1,201 @@ +package endpoints + +import ( + "fmt" + "regexp" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" +) + +const ( + defaultProtocol = "https" + defaultSigner = "v4" +) + +var ( + protocolPriority = []string{"https", "http"} + signerPriority = []string{"v4"} +) + +// Options provide configuration needed to direct how endpoints are resolved. +type Options struct { + // Disable usage of HTTPS (TLS / SSL) + DisableHTTPS bool +} + +// Partitions is a slice of partition +type Partitions []Partition + +// ResolveEndpoint resolves a service endpoint for the given region and options. +func (ps Partitions) ResolveEndpoint(region string, opts Options) (aws.Endpoint, error) { + if len(ps) == 0 { + return aws.Endpoint{}, fmt.Errorf("no partitions found") + } + + for i := 0; i < len(ps); i++ { + if !ps[i].canResolveEndpoint(region) { + continue + } + + return ps[i].ResolveEndpoint(region, opts) + } + + // fallback to first partition format to use when resolving the endpoint. + return ps[0].ResolveEndpoint(region, opts) +} + +// Partition is an AWS partition description for a service and its' region endpoints. +type Partition struct { + ID string + RegionRegex *regexp.Regexp + PartitionEndpoint string + IsRegionalized bool + Defaults Endpoint + Endpoints Endpoints +} + +func (p Partition) canResolveEndpoint(region string) bool { + _, ok := p.Endpoints[region] + return ok || p.RegionRegex.MatchString(region) +} + +// ResolveEndpoint resolves and service endpoint for the given region and options. +func (p Partition) ResolveEndpoint(region string, options Options) (resolved aws.Endpoint, err error) { + if len(region) == 0 && len(p.PartitionEndpoint) != 0 { + region = p.PartitionEndpoint + } + + e, _ := p.endpointForRegion(region) + + return e.resolve(p.ID, region, p.Defaults, options), nil +} + +func (p Partition) endpointForRegion(region string) (Endpoint, bool) { + if e, ok := p.Endpoints[region]; ok { + return e, true + } + + if !p.IsRegionalized { + return p.Endpoints[p.PartitionEndpoint], region == p.PartitionEndpoint + } + + // Unable to find any matching endpoint, return + // blank that will be used for generic endpoint creation. + return Endpoint{}, false +} + +// Endpoints is a map of service config regions to endpoints +type Endpoints map[string]Endpoint + +// CredentialScope is the credential scope of a region and service +type CredentialScope struct { + Region string + Service string +} + +// Endpoint is a service endpoint description +type Endpoint struct { + // True if the endpoint cannot be resolved for this partition/region/service + Unresolveable aws.Ternary + + Hostname string + Protocols []string + + CredentialScope CredentialScope + + SignatureVersions []string `json:"signatureVersions"` +} + +func (e Endpoint) resolve(partition, region string, def Endpoint, options Options) aws.Endpoint { + var merged Endpoint + merged.mergeIn(def) + merged.mergeIn(e) + e = merged + + var u string + if e.Unresolveable != aws.TrueTernary { + // Only attempt to resolve the endpoint if it can be resolved. + hostname := strings.Replace(e.Hostname, "{region}", region, 1) + + scheme := getEndpointScheme(e.Protocols, options.DisableHTTPS) + u = scheme + "://" + hostname + } + + signingRegion := e.CredentialScope.Region + if len(signingRegion) == 0 { + signingRegion = region + } + signingName := e.CredentialScope.Service + + return aws.Endpoint{ + URL: u, + PartitionID: partition, + SigningRegion: signingRegion, + SigningName: signingName, + SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), + } +} + +func (e *Endpoint) mergeIn(other Endpoint) { + if other.Unresolveable != aws.UnknownTernary { + e.Unresolveable = other.Unresolveable + } + if len(other.Hostname) > 0 { + e.Hostname = other.Hostname + } + if len(other.Protocols) > 0 { + e.Protocols = other.Protocols + } + if len(other.CredentialScope.Region) > 0 { + e.CredentialScope.Region = other.CredentialScope.Region + } + if len(other.CredentialScope.Service) > 0 { + e.CredentialScope.Service = other.CredentialScope.Service + } + if len(other.SignatureVersions) > 0 { + e.SignatureVersions = other.SignatureVersions + } +} + +func getEndpointScheme(protocols []string, disableHTTPS bool) string { + if disableHTTPS { + return "http" + } + + return getByPriority(protocols, protocolPriority, defaultProtocol) +} + +func getByPriority(s []string, p []string, def string) string { + if len(s) == 0 { + return def + } + + for i := 0; i < len(p); i++ { + for j := 0; j < len(s); j++ { + if s[j] == p[i] { + return s[j] + } + } + } + + return s[0] +} + +// MapFIPSRegion extracts the intrinsic AWS region from one that may have an +// embedded FIPS microformat. +func MapFIPSRegion(region string) string { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(region, fipsInfix) || + strings.Contains(region, fipsPrefix) || + strings.Contains(region, fipsSuffix) { + region = strings.ReplaceAll(region, fipsInfix, "-") + region = strings.ReplaceAll(region, fipsPrefix, "") + region = strings.ReplaceAll(region, fipsSuffix, "") + } + + return region +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 1a188a57..748a80fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,148 @@ +# v2.6.26 (2024-12-19) + +* **Bug Fix**: Fix improper use of printf-style functions. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.25 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.24 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.23 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.22 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.21 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.20 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.19 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.18 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.17 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.16 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.15 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.14 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.13 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.12 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.11 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.10 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.9 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.8 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.5 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.3 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.6.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.5.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index adb6f699..6a5a4b64 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.5.2" +const goModuleVersion = "2.6.26" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md new file mode 100644 index 00000000..be61098b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -0,0 +1,275 @@ +# v1.8.1 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. + +# v1.8.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. + +# v1.7.3 (2024-01-22) + +* **Bug Fix**: Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons. + +# v1.7.2 (2023-12-08) + +* **Bug Fix**: Correct loading of [services *] sections into shared config. + +# v1.7.1 (2023-11-16) + +* **Bug Fix**: Fix recognition of trailing comments in shared config properties. # or ; separators that aren't preceded by whitespace at the end of a property value should be considered part of it. + +# v1.7.0 (2023-11-13) + +* **Feature**: Replace the legacy config parser with a modern, less-strict implementation. Parsing failures within a section will now simply ignore the invalid line rather than silently drop the entire section. + +# v1.6.0 (2023-11-09.2) + +* **Feature**: BREAKFIX: In order to support subproperty parsing, invalid property definitions must not be ignored + +# v1.5.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.1 (2023-11-07) + +* **Bug Fix**: Fix subproperty performance regression + +# v1.5.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.45 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.43 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. + +# v1.3.42 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.41 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.40 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.39 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.38 (2023-07-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.37 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.36 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.35 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.34 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.33 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.32 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.31 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.30 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.29 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.28 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.27 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.26 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.25 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.24 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.23 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.22 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.21 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.20 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.19 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.18 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.17 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.16 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.15 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.14 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.13 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.12 (2022-05-17) + +* **Bug Fix**: Removes the fuzz testing files from the module, as they are invalid and not used. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.11 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.10 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.9 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.8 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.7 (2022-03-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2022-02-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.5 (2022-01-28) + +* **Bug Fix**: Fixes the SDK's handling of `duration_sections` in the shared credentials file or specified in multiple shared config and shared credentials files under the same profile. [#1568](https://github.com/aws/aws-sdk-go-v2/pull/1568). Thanks to [Amir Szekely](https://github.com/kichik) for help reproduce this bug. + +# v1.3.4 (2022-01-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2022-01-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2021-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.2 (2021-08-27) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-08-04) + +* **Feature**: adds error handling for defered close calls +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.1 (2021-07-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.0 (2021-07-01) + +* **Feature**: Support for `:`, `=`, `[`, `]` being present in expression values. + +# v1.0.1 (2021-06-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.0 (2021-05-20) + +* **Release**: The `github.com/aws/aws-sdk-go-v2/internal/ini` package is now a Go Module. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go new file mode 100644 index 00000000..0f278d55 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.go @@ -0,0 +1,22 @@ +package ini + +import "fmt" + +// UnableToReadFile is an error indicating that a ini file could not be read +type UnableToReadFile struct { + Err error +} + +// Error returns an error message and the underlying error message if present +func (e *UnableToReadFile) Error() string { + base := "unable to read file" + if e.Err == nil { + return base + } + return fmt.Sprintf("%s: %v", base, e.Err) +} + +// Unwrap returns the underlying error +func (e *UnableToReadFile) Unwrap() error { + return e.Err +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go new file mode 100644 index 00000000..ef6a3811 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ini + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.8.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go new file mode 100644 index 00000000..cefcce91 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.go @@ -0,0 +1,56 @@ +// Package ini implements parsing of the AWS shared config file. +// +// Example: +// sections, err := ini.OpenFile("/path/to/file") +// if err != nil { +// panic(err) +// } +// +// profile := "foo" +// section, ok := sections.GetSection(profile) +// if !ok { +// fmt.Printf("section %q could not be found", profile) +// } +package ini + +import ( + "fmt" + "io" + "os" + "strings" +) + +// OpenFile parses shared config from the given file path. +func OpenFile(path string) (sections Sections, err error) { + f, oerr := os.Open(path) + if oerr != nil { + return Sections{}, &UnableToReadFile{Err: oerr} + } + + defer func() { + closeErr := f.Close() + if err == nil { + err = closeErr + } else if closeErr != nil { + err = fmt.Errorf("close error: %v, original error: %w", closeErr, err) + } + }() + + return Parse(f, path) +} + +// Parse parses shared config from the given reader. +func Parse(r io.Reader, path string) (Sections, error) { + contents, err := io.ReadAll(r) + if err != nil { + return Sections{}, fmt.Errorf("read all: %v", err) + } + + lines := strings.Split(string(contents), "\n") + tokens, err := tokenize(lines) + if err != nil { + return Sections{}, fmt.Errorf("tokenize: %v", err) + } + + return parse(tokens, path), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go new file mode 100644 index 00000000..2422d904 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.go @@ -0,0 +1,109 @@ +package ini + +import ( + "fmt" + "strings" +) + +func parse(tokens []lineToken, path string) Sections { + parser := &parser{ + path: path, + sections: NewSections(), + } + parser.parse(tokens) + return parser.sections +} + +type parser struct { + csection, ckey string // current state + path string // source file path + sections Sections // parse result +} + +func (p *parser) parse(tokens []lineToken) { + for _, otok := range tokens { + switch tok := otok.(type) { + case *lineTokenProfile: + p.handleProfile(tok) + case *lineTokenProperty: + p.handleProperty(tok) + case *lineTokenSubProperty: + p.handleSubProperty(tok) + case *lineTokenContinuation: + p.handleContinuation(tok) + } + } +} + +func (p *parser) handleProfile(tok *lineTokenProfile) { + name := tok.Name + if tok.Type != "" { + name = fmt.Sprintf("%s %s", tok.Type, tok.Name) + } + p.ckey = "" + p.csection = name + if _, ok := p.sections.container[name]; !ok { + p.sections.container[name] = NewSection(name) + } +} + +func (p *parser) handleProperty(tok *lineTokenProperty) { + if p.csection == "" { + return // LEGACY: don't error on "global" properties + } + + p.ckey = tok.Key + if _, ok := p.sections.container[p.csection].values[tok.Key]; ok { + section := p.sections.container[p.csection] + section.Logs = append(p.sections.container[p.csection].Logs, + fmt.Sprintf( + "For profile: %v, overriding %v value, with a %v value found in a duplicate profile defined later in the same file %v. \n", + p.csection, tok.Key, tok.Key, p.path, + ), + ) + p.sections.container[p.csection] = section + } + + p.sections.container[p.csection].values[tok.Key] = Value{ + str: tok.Value, + } + p.sections.container[p.csection].SourceFile[tok.Key] = p.path +} + +func (p *parser) handleSubProperty(tok *lineTokenSubProperty) { + if p.csection == "" { + return // LEGACY: don't error on "global" properties + } + + if p.ckey == "" || p.sections.container[p.csection].values[p.ckey].str != "" { + // This is an "orphaned" subproperty, either because it's at + // the beginning of a section or because the last property's + // value isn't empty. Either way we're lenient here and + // "promote" this to a normal property. + p.handleProperty(&lineTokenProperty{ + Key: tok.Key, + Value: strings.TrimSpace(trimPropertyComment(tok.Value)), + }) + return + } + + if p.sections.container[p.csection].values[p.ckey].mp == nil { + p.sections.container[p.csection].values[p.ckey] = Value{ + mp: map[string]string{}, + } + } + p.sections.container[p.csection].values[p.ckey].mp[tok.Key] = tok.Value +} + +func (p *parser) handleContinuation(tok *lineTokenContinuation) { + if p.ckey == "" { + return + } + + value, _ := p.sections.container[p.csection].values[p.ckey] + if value.str != "" && value.mp == nil { + value.str = fmt.Sprintf("%s\n%s", value.str, tok.Value) + } + + p.sections.container[p.csection].values[p.ckey] = value +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go new file mode 100644 index 00000000..dd89848e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.go @@ -0,0 +1,157 @@ +package ini + +import ( + "sort" +) + +// Sections is a map of Section structures that represent +// a configuration. +type Sections struct { + container map[string]Section +} + +// NewSections returns empty ini Sections +func NewSections() Sections { + return Sections{ + container: make(map[string]Section, 0), + } +} + +// GetSection will return section p. If section p does not exist, +// false will be returned in the second parameter. +func (t Sections) GetSection(p string) (Section, bool) { + v, ok := t.container[p] + return v, ok +} + +// HasSection denotes if Sections consist of a section with +// provided name. +func (t Sections) HasSection(p string) bool { + _, ok := t.container[p] + return ok +} + +// SetSection sets a section value for provided section name. +func (t Sections) SetSection(p string, v Section) Sections { + t.container[p] = v + return t +} + +// DeleteSection deletes a section entry/value for provided section name./ +func (t Sections) DeleteSection(p string) { + delete(t.container, p) +} + +// values represents a map of union values. +type values map[string]Value + +// List will return a list of all sections that were successfully +// parsed. +func (t Sections) List() []string { + keys := make([]string, len(t.container)) + i := 0 + for k := range t.container { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + +// Section contains a name and values. This represent +// a sectioned entry in a configuration file. +type Section struct { + // Name is the Section profile name + Name string + + // values are the values within parsed profile + values values + + // Errors is the list of errors + Errors []error + + // Logs is the list of logs + Logs []string + + // SourceFile is the INI Source file from where this section + // was retrieved. They key is the property, value is the + // source file the property was retrieved from. + SourceFile map[string]string +} + +// NewSection returns an initialize section for the name +func NewSection(name string) Section { + return Section{ + Name: name, + values: values{}, + SourceFile: map[string]string{}, + } +} + +// List will return a list of all +// services in values +func (t Section) List() []string { + keys := make([]string, len(t.values)) + i := 0 + for k := range t.values { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + +// UpdateSourceFile updates source file for a property to provided filepath. +func (t Section) UpdateSourceFile(property string, filepath string) { + t.SourceFile[property] = filepath +} + +// UpdateValue updates value for a provided key with provided value +func (t Section) UpdateValue(k string, v Value) error { + t.values[k] = v + return nil +} + +// Has will return whether or not an entry exists in a given section +func (t Section) Has(k string) bool { + _, ok := t.values[k] + return ok +} + +// ValueType will returned what type the union is set to. If +// k was not found, the NoneType will be returned. +func (t Section) ValueType(k string) (ValueType, bool) { + v, ok := t.values[k] + return v.Type, ok +} + +// Bool returns a bool value at k +func (t Section) Bool(k string) (bool, bool) { + return t.values[k].BoolValue() +} + +// Int returns an integer value at k +func (t Section) Int(k string) (int64, bool) { + return t.values[k].IntValue() +} + +// Map returns a map value at k +func (t Section) Map(k string) map[string]string { + return t.values[k].MapValue() +} + +// Float64 returns a float value at k +func (t Section) Float64(k string) (float64, bool) { + return t.values[k].FloatValue() +} + +// String returns the string value at k +func (t Section) String(k string) string { + _, ok := t.values[k] + if !ok { + return "" + } + return t.values[k].StringValue() +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go new file mode 100644 index 00000000..ed77d083 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.go @@ -0,0 +1,89 @@ +package ini + +import ( + "strings" +) + +func trimProfileComment(s string) string { + r, _, _ := strings.Cut(s, "#") + r, _, _ = strings.Cut(r, ";") + return r +} + +func trimPropertyComment(s string) string { + r, _, _ := strings.Cut(s, " #") + r, _, _ = strings.Cut(r, " ;") + r, _, _ = strings.Cut(r, "\t#") + r, _, _ = strings.Cut(r, "\t;") + return r +} + +// assumes no surrounding comment +func splitProperty(s string) (string, string, bool) { + equalsi := strings.Index(s, "=") + coloni := strings.Index(s, ":") // LEGACY: also supported for property assignment + sep := "=" + if equalsi == -1 || coloni != -1 && coloni < equalsi { + sep = ":" + } + + k, v, ok := strings.Cut(s, sep) + if !ok { + return "", "", false + } + return strings.TrimSpace(k), strings.TrimSpace(v), true +} + +// assumes no surrounding comment, whitespace, or profile brackets +func splitProfile(s string) (string, string) { + var first int + for i, r := range s { + if isLineSpace(r) { + if first == 0 { + first = i + } + } else { + if first != 0 { + return s[:first], s[i:] + } + } + } + if first == 0 { + return "", s // type component is effectively blank + } + return "", "" +} + +func isLineSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +func unquote(s string) string { + if isSingleQuoted(s) || isDoubleQuoted(s) { + return s[1 : len(s)-1] + } + return s +} + +// applies various legacy conversions to property values: +// - remote wrapping single/doublequotes +func legacyStrconv(s string) string { + s = unquote(s) + return s +} + +func isSingleQuoted(s string) bool { + return hasAffixes(s, "'", "'") +} + +func isDoubleQuoted(s string) bool { + return hasAffixes(s, `"`, `"`) +} + +func isBracketed(s string) bool { + return hasAffixes(s, "[", "]") +} + +func hasAffixes(s, left, right string) bool { + return strings.HasPrefix(s, left) && strings.HasSuffix(s, right) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go new file mode 100644 index 00000000..6e9a0374 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.go @@ -0,0 +1,32 @@ +package ini + +type lineToken interface { + isLineToken() +} + +type lineTokenProfile struct { + Type string + Name string +} + +func (*lineTokenProfile) isLineToken() {} + +type lineTokenProperty struct { + Key string + Value string +} + +func (*lineTokenProperty) isLineToken() {} + +type lineTokenContinuation struct { + Value string +} + +func (*lineTokenContinuation) isLineToken() {} + +type lineTokenSubProperty struct { + Key string + Value string +} + +func (*lineTokenSubProperty) isLineToken() {} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go new file mode 100644 index 00000000..89a77368 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.go @@ -0,0 +1,92 @@ +package ini + +import ( + "strings" +) + +func tokenize(lines []string) ([]lineToken, error) { + tokens := make([]lineToken, 0, len(lines)) + for _, line := range lines { + if len(strings.TrimSpace(line)) == 0 || isLineComment(line) { + continue + } + + if tok := asProfile(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asProperty(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asSubProperty(line); tok != nil { + tokens = append(tokens, tok) + } else if tok := asContinuation(line); tok != nil { + tokens = append(tokens, tok) + } // unrecognized tokens are effectively ignored + } + return tokens, nil +} + +func isLineComment(line string) bool { + trimmed := strings.TrimLeft(line, " \t") + return strings.HasPrefix(trimmed, "#") || strings.HasPrefix(trimmed, ";") +} + +func asProfile(line string) *lineTokenProfile { // " [ type name ] ; comment" + trimmed := strings.TrimSpace(trimProfileComment(line)) // "[ type name ]" + if !isBracketed(trimmed) { + return nil + } + trimmed = trimmed[1 : len(trimmed)-1] // " type name " (or just " name ") + trimmed = strings.TrimSpace(trimmed) // "type name" / "name" + typ, name := splitProfile(trimmed) + return &lineTokenProfile{ + Type: typ, + Name: name, + } +} + +func asProperty(line string) *lineTokenProperty { + if isLineSpace(rune(line[0])) { + return nil + } + + trimmed := trimPropertyComment(line) + trimmed = strings.TrimRight(trimmed, " \t") + k, v, ok := splitProperty(trimmed) + if !ok { + return nil + } + + return &lineTokenProperty{ + Key: strings.ToLower(k), // LEGACY: normalize key case + Value: legacyStrconv(v), // LEGACY: see func docs + } +} + +func asSubProperty(line string) *lineTokenSubProperty { + if !isLineSpace(rune(line[0])) { + return nil + } + + // comments on sub-properties are included in the value + trimmed := strings.TrimLeft(line, " \t") + k, v, ok := splitProperty(trimmed) + if !ok { + return nil + } + + return &lineTokenSubProperty{ // same LEGACY constraints as in normal property + Key: strings.ToLower(k), + Value: legacyStrconv(v), + } +} + +func asContinuation(line string) *lineTokenContinuation { + if !isLineSpace(rune(line[0])) { + return nil + } + + // includes comments like sub-properties + trimmed := strings.TrimLeft(line, " \t") + return &lineTokenContinuation{ + Value: trimmed, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go new file mode 100644 index 00000000..e3706b3c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.go @@ -0,0 +1,93 @@ +package ini + +import ( + "fmt" + "strconv" + "strings" +) + +// ValueType is an enum that will signify what type +// the Value is +type ValueType int + +func (v ValueType) String() string { + switch v { + case NoneType: + return "NONE" + case StringType: + return "STRING" + } + + return "" +} + +// ValueType enums +const ( + NoneType = ValueType(iota) + StringType + QuotedStringType +) + +// Value is a union container +type Value struct { + Type ValueType + + str string + mp map[string]string +} + +// NewStringValue returns a Value type generated using a string input. +func NewStringValue(str string) (Value, error) { + return Value{str: str}, nil +} + +func (v Value) String() string { + switch v.Type { + case StringType: + return fmt.Sprintf("string: %s", string(v.str)) + case QuotedStringType: + return fmt.Sprintf("quoted string: %s", string(v.str)) + default: + return "union not set" + } +} + +// MapValue returns a map value for sub properties +func (v Value) MapValue() map[string]string { + return v.mp +} + +// IntValue returns an integer value +func (v Value) IntValue() (int64, bool) { + i, err := strconv.ParseInt(string(v.str), 0, 64) + if err != nil { + return 0, false + } + return i, true +} + +// FloatValue returns a float value +func (v Value) FloatValue() (float64, bool) { + f, err := strconv.ParseFloat(string(v.str), 64) + if err != nil { + return 0, false + } + return f, true +} + +// BoolValue returns a bool value +func (v Value) BoolValue() (bool, bool) { + // we don't use ParseBool as it recognizes more than what we've + // historically supported + if strings.EqualFold(v.str, "true") { + return true, true + } else if strings.EqualFold(v.str, "false") { + return false, true + } + return false, false +} + +// StringValue returns the string value +func (v Value) StringValue() string { + return v.str +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go new file mode 100644 index 00000000..8e24a3f0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.go @@ -0,0 +1,42 @@ +package middleware + +import ( + "context" + "sync/atomic" + "time" + + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/smithy-go/middleware" +) + +// AddTimeOffsetMiddleware sets a value representing clock skew on the request context. +// This can be read by other operations (such as signing) to correct the date value they send +// on the request +type AddTimeOffsetMiddleware struct { + Offset *atomic.Int64 +} + +// ID the identifier for AddTimeOffsetMiddleware +func (m *AddTimeOffsetMiddleware) ID() string { return "AddTimeOffsetMiddleware" } + +// HandleBuild sets a value for attemptSkew on the request context if one is set on the client. +func (m AddTimeOffsetMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + if m.Offset != nil { + offset := time.Duration(m.Offset.Load()) + ctx = internalcontext.SetAttemptSkewContext(ctx, offset) + } + return next.HandleBuild(ctx, in) +} + +// HandleDeserialize gets the clock skew context from the context, and if set, sets it on the pointer +// held by AddTimeOffsetMiddleware +func (m *AddTimeOffsetMiddleware) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + if v := internalcontext.GetAttemptSkewContext(ctx); v != 0 { + m.Offset.Store(v.Nanoseconds()) + } + return next.HandleDeserialize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go new file mode 100644 index 00000000..c96b717e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.go @@ -0,0 +1,47 @@ +package shareddefaults + +import ( + "os" + "os/user" + "path/filepath" +) + +// SharedCredentialsFilename returns the SDK's default file path +// for the shared credentials file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/credentials +// - Windows: %USERPROFILE%\.aws\credentials +func SharedCredentialsFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "credentials") +} + +// SharedConfigFilename returns the SDK's default file path for +// the shared config file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/config +// - Windows: %USERPROFILE%\.aws\config +func SharedConfigFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "config") +} + +// UserHomeDir returns the home directory for the user the process is +// running under. +func UserHomeDir() string { + // Ignore errors since we only care about Windows and *nix. + home, _ := os.UserHomeDir() + + if len(home) > 0 { + return home + } + + currUser, _ := user.Current() + if currUser != nil { + home = currUser.HomeDir + } + + return home +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md index bd6df25e..d33be634 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md @@ -1,3 +1,147 @@ +# v1.3.26 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.25 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.24 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.23 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.22 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.21 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.20 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.19 (2024-10-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.18 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.17 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.16 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.15 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.14 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.13 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.12 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.11 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.10 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.9 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.8 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.5 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.2.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go index c3f3ccd2..38acd0b7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go @@ -3,4 +3,4 @@ package v4a // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.2.2" +const goModuleVersion = "1.3.26" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/smithy.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/smithy.go new file mode 100644 index 00000000..af4f6abc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/smithy.go @@ -0,0 +1,92 @@ +package v4a + +import ( + "context" + "fmt" + "time" + + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// CredentialsAdapter adapts v4a.Credentials to smithy auth.Identity. +type CredentialsAdapter struct { + Credentials Credentials +} + +var _ auth.Identity = (*CredentialsAdapter)(nil) + +// Expiration returns the time of expiration for the credentials. +func (v *CredentialsAdapter) Expiration() time.Time { + return v.Credentials.Expires +} + +// CredentialsProviderAdapter adapts v4a.CredentialsProvider to +// auth.IdentityResolver. +type CredentialsProviderAdapter struct { + Provider CredentialsProvider +} + +var _ (auth.IdentityResolver) = (*CredentialsProviderAdapter)(nil) + +// GetIdentity retrieves v4a credentials using the underlying provider. +func (v *CredentialsProviderAdapter) GetIdentity(ctx context.Context, _ smithy.Properties) ( + auth.Identity, error, +) { + creds, err := v.Provider.RetrievePrivateKey(ctx) + if err != nil { + return nil, fmt.Errorf("get credentials: %w", err) + } + + return &CredentialsAdapter{Credentials: creds}, nil +} + +// SignerAdapter adapts v4a.HTTPSigner to smithy http.Signer. +type SignerAdapter struct { + Signer HTTPSigner + Logger logging.Logger + LogSigning bool +} + +var _ (smithyhttp.Signer) = (*SignerAdapter)(nil) + +// SignRequest signs the request with the provided identity. +func (v *SignerAdapter) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { + ca, ok := identity.(*CredentialsAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + name, ok := smithyhttp.GetSigV4SigningName(&props) + if !ok { + return fmt.Errorf("sigv4a signing name is required") + } + + regions, ok := smithyhttp.GetSigV4ASigningRegions(&props) + if !ok { + return fmt.Errorf("sigv4a signing region is required") + } + + hash := v4.GetPayloadHash(ctx) + signingTime := sdk.NowTime() + if skew := internalcontext.GetAttemptSkewContext(ctx); skew != 0 { + signingTime.Add(skew) + } + err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, regions, signingTime, func(o *SignerOptions) { + o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) + + o.Logger = v.Logger + o.LogSigning = v.LogSigning + }) + if err != nil { + return fmt.Errorf("sign http: %w", err) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index 39326ead..8ab28d3a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,3 +1,51 @@ +# v1.12.1 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. + +# v1.12.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. + +# v1.11.5 (2024-09-20) + +* No change notes available for this release. + +# v1.11.4 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. + +# v1.11.3 (2024-06-28) + +* No change notes available for this release. + +# v1.11.2 (2024-03-29) + +* No change notes available for this release. + +# v1.11.1 (2024-02-21) + +* No change notes available for this release. + +# v1.11.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. + +# v1.10.4 (2023-12-07) + +* No change notes available for this release. + +# v1.10.3 (2023-11-30) + +* No change notes available for this release. + +# v1.10.2 (2023-11-29) + +* No change notes available for this release. + +# v1.10.1 (2023-11-15) + +* No change notes available for this release. + # v1.10.0 (2023-10-31) * **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index e57bbab9..1514acbe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.0" +const goModuleVersion = "1.12.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md index 755c7245..11dcc52d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md @@ -1,3 +1,156 @@ +# v1.4.7 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.20 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.19 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.18 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.17 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.16 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.15 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.14 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.13 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.12 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.11 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.10 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.9 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.8 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.7 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.6 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.5 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.4 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2024-03-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.2.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go index 6c101400..f0b41695 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go @@ -3,4 +3,4 @@ package checksum // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.2.2" +const goModuleVersion = "1.4.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_add.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_add.go index 3e17d221..1b727acb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_add.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_add.go @@ -2,7 +2,6 @@ package checksum import ( "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" ) // InputMiddlewareOptions provides the options for the request @@ -81,28 +80,25 @@ func AddInputMiddleware(stack *middleware.Stack, options InputMiddlewareOptions) stack.Build.Remove("ContentChecksum") - // Create the compute checksum middleware that will be added as both a - // build and finalize handler. inputChecksum := &computeInputPayloadChecksum{ RequireChecksum: options.RequireChecksum, EnableTrailingChecksum: options.EnableTrailingChecksum, EnableComputePayloadHash: options.EnableComputeSHA256PayloadHash, EnableDecodedContentLengthHeader: options.EnableDecodedContentLengthHeader, } - - // Insert header checksum after ComputeContentLength middleware, must also - // be before the computePayloadHash middleware handlers. - err = stack.Build.Insert(inputChecksum, - (*smithyhttp.ComputeContentLength)(nil).ID(), - middleware.After) - if err != nil { + if err := stack.Finalize.Insert(inputChecksum, "ResolveEndpointV2", middleware.After); err != nil { return err } // If trailing checksum is not supported no need for finalize handler to be added. if options.EnableTrailingChecksum { - err = stack.Finalize.Insert(inputChecksum, "Retry", middleware.After) - if err != nil { + trailerMiddleware := &addInputChecksumTrailer{ + EnableTrailingChecksum: inputChecksum.EnableTrailingChecksum, + RequireChecksum: inputChecksum.RequireChecksum, + EnableComputePayloadHash: inputChecksum.EnableComputePayloadHash, + EnableDecodedContentLengthHeader: inputChecksum.EnableDecodedContentLengthHeader, + } + if err := stack.Finalize.Insert(trailerMiddleware, "Retry", middleware.After); err != nil { return err } } @@ -117,7 +113,6 @@ func RemoveInputMiddleware(stack *middleware.Stack) { stack.Initialize.Remove(id) id = (*computeInputPayloadChecksum)(nil).ID() - stack.Build.Remove(id) stack.Finalize.Remove(id) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_compute_input_checksum.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_compute_input_checksum.go index 0b3c4891..7ffca33f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_compute_input_checksum.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_compute_input_checksum.go @@ -9,6 +9,8 @@ import ( "strconv" v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -70,10 +72,11 @@ type computeInputPayloadChecksum struct { // when used with trailing checksums, and aws-chunked content-encoding. EnableDecodedContentLengthHeader bool - buildHandlerRun bool - deferToFinalizeHandler bool + useTrailer bool } +type useTrailer struct{} + // ID provides the middleware's identifier. func (m *computeInputPayloadChecksum) ID() string { return "AWSChecksum:ComputeInputPayloadChecksum" @@ -102,13 +105,11 @@ func (e computeInputHeaderChecksumError) Unwrap() error { return e.Err } // // The build handler must be inserted in the stack before ContentPayloadHash // and after ComputeContentLength. -func (m *computeInputPayloadChecksum) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +func (m *computeInputPayloadChecksum) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - m.buildHandlerRun = true - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, computeInputHeaderChecksumError{ @@ -145,13 +146,13 @@ func (m *computeInputPayloadChecksum) HandleBuild( } algorithm = Algorithm("MD5") } - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } // If the checksum header is already set nothing to do. checksumHeader := AlgorithmHTTPHeader(algorithm) if checksum = req.Header.Get(checksumHeader); checksum != "" { - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } computePayloadHash := m.EnableComputePayloadHash @@ -169,22 +170,19 @@ func (m *computeInputPayloadChecksum) HandleBuild( } // If trailing checksums are supported, the request is HTTPS, and the - // stream is not nil or empty, there is nothing to do in the build stage. - // The checksum will be added to the request as a trailing checksum in the - // finalize handler. + // stream is not nil or empty, instead switch to a trailing checksum. // // Nil and empty streams will always be handled as a request header, // regardless if the operation supports trailing checksums or not. - if req.IsHTTPS() { + if req.IsHTTPS() && !presignedurlcust.GetIsPresigning(ctx) { if stream != nil && streamLength != 0 && m.EnableTrailingChecksum { if m.EnableComputePayloadHash { - // payload hash is set as header in Build middleware handler, - // ContentSHA256Header. + // ContentSHA256Header middleware handles the header ctx = v4.SetPayloadHash(ctx, streamingUnsignedPayloadTrailerPayloadHash) } - - m.deferToFinalizeHandler = true - return next.HandleBuild(ctx, in) + m.useTrailer = true + ctx = middleware.WithStackValue(ctx, useTrailer{}, true) + return next.HandleFinalize(ctx, in) } // If trailing checksums are not enabled but protocol is still HTTPS @@ -225,7 +223,7 @@ func (m *computeInputPayloadChecksum) HandleBuild( ctx = v4.SetPayloadHash(ctx, sha256Checksum) } - return next.HandleBuild(ctx, in) + return next.HandleFinalize(ctx, in) } type computeInputTrailingChecksumError struct { @@ -244,26 +242,31 @@ func (e computeInputTrailingChecksumError) Error() string { } func (e computeInputTrailingChecksumError) Unwrap() error { return e.Err } -// HandleFinalize handles computing the payload's checksum, in the following cases: +// addInputChecksumTrailer // - Is HTTPS, not HTTP // - A checksum was specified via the Input // - Trailing checksums are supported. -// -// The finalize handler must be inserted in the stack before Signing, and after Retry. -func (m *computeInputPayloadChecksum) HandleFinalize( +type addInputChecksumTrailer struct { + EnableTrailingChecksum bool + RequireChecksum bool + EnableComputePayloadHash bool + EnableDecodedContentLengthHeader bool +} + +// ID identifies this middleware. +func (*addInputChecksumTrailer) ID() string { + return "addInputChecksumTrailer" +} + +// HandleFinalize wraps the request body to write the trailing checksum. +func (m *addInputChecksumTrailer) HandleFinalize( ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, ) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - if !m.deferToFinalizeHandler { - if !m.buildHandlerRun { - return out, metadata, computeInputTrailingChecksumError{ - Msg: "build handler was removed without also removing finalize handler", - } - } + if enabled, _ := middleware.GetStackValue(ctx, useTrailer{}).(bool); !enabled { return next.HandleFinalize(ctx, in) } - req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, computeInputTrailingChecksumError{ @@ -374,7 +377,7 @@ func (m *computeInputPayloadChecksum) HandleFinalize( } func getInputAlgorithm(ctx context.Context) (Algorithm, bool, error) { - ctxAlgorithm := getContextInputAlgorithm(ctx) + ctxAlgorithm := internalcontext.GetChecksumInputAlgorithm(ctx) if ctxAlgorithm == "" { return "", false, nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_setup_context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_setup_context.go index f7295254..3db73afe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_setup_context.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/middleware_setup_context.go @@ -3,6 +3,7 @@ package checksum import ( "context" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" "github.com/aws/smithy-go/middleware" ) @@ -35,33 +36,13 @@ func (m *setupInputContext) HandleInitialize( // check is input resource has a checksum algorithm algorithm, ok := m.GetAlgorithm(in.Parameters) if ok && len(algorithm) != 0 { - ctx = setContextInputAlgorithm(ctx, algorithm) + ctx = internalcontext.SetChecksumInputAlgorithm(ctx, algorithm) } } return next.HandleInitialize(ctx, in) } -// inputAlgorithmKey is the key set on context used to identify, retrieves the -// request checksum algorithm if present on the context. -type inputAlgorithmKey struct{} - -// setContextInputAlgorithm sets the request checksum algorithm on the context. -// -// Scoped to stack values. -func setContextInputAlgorithm(ctx context.Context, value string) context.Context { - return middleware.WithStackValue(ctx, inputAlgorithmKey{}, value) -} - -// getContextInputAlgorithm returns the checksum algorithm from the context if -// one was specified. Empty string is returned if one is not specified. -// -// Scoped to stack values. -func getContextInputAlgorithm(ctx context.Context) (v string) { - v, _ = middleware.GetStackValue(ctx, inputAlgorithmKey{}).(string) - return v -} - type setupOutputContext struct { // GetValidationMode is a function to get the checksum validation // mode of the output payload from the input parameters. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 99a54769..962ab791 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,156 @@ +# v1.12.7 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.20 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.19 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.18 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.17 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.16 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.15 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.14 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.13 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.12 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.11 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.10 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.9 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.8 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.7 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.6 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.5 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.4 (2024-03-05) + +* **Bug Fix**: Restore typo'd API `AddAsIsInternalPresigingMiddleware` as an alias for backwards compatibility. + +# v1.11.3 (2024-03-04) + +* **Bug Fix**: Correct a typo in internal AddAsIsPresigningMiddleware API. + +# v1.11.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.10.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go index cc919701..5d5286f9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.go @@ -27,13 +27,21 @@ func GetIsPresigning(ctx context.Context) bool { type isPresigningKey struct{} -// AddAsIsPresigingMiddleware adds a middleware to the head of the stack that +// AddAsIsPresigningMiddleware adds a middleware to the head of the stack that // will update the stack's context to be flagged as being invoked for the // purpose of presigning. -func AddAsIsPresigingMiddleware(stack *middleware.Stack) error { +func AddAsIsPresigningMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(asIsPresigningMiddleware{}, middleware.Before) } +// AddAsIsPresigingMiddleware is an alias for backwards compatibility. +// +// Deprecated: This API was released with a typo. Use +// [AddAsIsPresigningMiddleware] instead. +func AddAsIsPresigingMiddleware(stack *middleware.Stack) error { + return AddAsIsPresigningMiddleware(stack) +} + type asIsPresigningMiddleware struct{} func (asIsPresigningMiddleware) ID() string { return "AsIsPresigningMiddleware" } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 66b8acd8..4c54f642 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.10.2" +const goModuleVersion = "1.12.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md index 2d3ad6a9..48e64ce8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md @@ -1,3 +1,147 @@ +# v1.18.7 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.18 (2024-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.17 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.16 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.15 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.14 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.13 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.12 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.11 (2024-06-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.10 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.9 (2024-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.8 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.7 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2024-03-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2024-02-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2023-12-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2023-11-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.16.2 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go index 5c003a13..60a3c68f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go @@ -3,4 +3,4 @@ package s3shared // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.16.2" +const goModuleVersion = "1.18.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/metadata_retriever.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/metadata_retriever.go index f52f2f11..7251588b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/metadata_retriever.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/metadata_retriever.go @@ -5,6 +5,7 @@ import ( awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -30,6 +31,8 @@ func (m *metadataRetriever) HandleDeserialize(ctx context.Context, in middleware ) { out, metadata, err = next.HandleDeserialize(ctx, in) + span, _ := tracing.GetSpan(ctx) + resp, ok := out.RawResponse.(*smithyhttp.Response) if !ok { // No raw response to wrap with. @@ -40,12 +43,14 @@ func (m *metadataRetriever) HandleDeserialize(ctx context.Context, in middleware if v := resp.Header.Get("X-Amz-Request-Id"); len(v) != 0 { // set reqID on metadata for successful responses. awsmiddleware.SetRequestIDMetadata(&metadata, v) + span.SetProperty("aws.request_id", v) } // look up host-id if v := resp.Header.Get("X-Amz-Id-2"); len(v) != 0 { // set reqID on metadata for successful responses. SetHostIDMetadata(&metadata, v) + span.SetProperty("aws.extended_request_id", v) } return out, metadata, err diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/CHANGELOG.md new file mode 100644 index 00000000..110fa2cc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/CHANGELOG.md @@ -0,0 +1,903 @@ +# v1.93.2 (2024-12-27) + +* **Documentation**: Updates Amazon RDS documentation to correct various descriptions. + +# v1.93.1 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.93.0 (2024-12-16) + +* **Feature**: This release adds support for the "MYSQL_CACHING_SHA2_PASSWORD" enum value for RDS Proxy ClientPasswordAuthType. + +# v1.92.0 (2024-12-02) + +* **Feature**: Amazon RDS supports CloudWatch Database Insights. You can use the SDK to create, modify, and describe the DatabaseInsightsMode for your DB instances and clusters. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.91.0 (2024-11-20) + +* **Feature**: This release adds support for scale storage on the DB instance using a Blue/Green Deployment. + +# v1.90.0 (2024-11-18) + +* **Feature**: Add support for the automatic pause/resume feature of Aurora Serverless v2. +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.89.2 (2024-11-12) + +* **Documentation**: Updates Amazon RDS documentation for Amazon RDS Extended Support for Amazon Aurora MySQL. + +# v1.89.1 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.89.0 (2024-10-28) + +* **Feature**: This release adds support for Enhanced Monitoring and Performance Insights when restoring Aurora Limitless Database DB clusters. It also adds support for the os-upgrade pending maintenance action. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.88.0 (2024-10-22) + +* **Feature**: Global clusters now expose the Endpoint attribute as one of its fields. It is a Read/Write endpoint for the global cluster which resolves to the Global Cluster writer instance. + +# v1.87.3 (2024-10-17) + +* **Documentation**: Updates Amazon RDS documentation for TAZ IAM support + +# v1.87.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.87.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.87.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.86.1 (2024-10-03) + +* No change notes available for this release. + +# v1.86.0 (2024-10-01) + +* **Feature**: This release provides additional support for enabling Aurora Limitless Database DB clusters. + +# v1.85.2 (2024-09-27) + +* No change notes available for this release. + +# v1.85.1 (2024-09-25) + +* No change notes available for this release. + +# v1.85.0 (2024-09-23) + +* **Feature**: Support ComputeRedundancy parameter in ModifyDBShardGroup API. Add DBShardGroupArn in DBShardGroup API response. Remove InvalidMaxAcuFault from CreateDBShardGroup and ModifyDBShardGroup API. Both API will throw InvalidParameterValueException for invalid ACU configuration. + +# v1.84.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.83.2 (2024-09-18) + +* **Documentation**: Updates Amazon RDS documentation with information upgrading snapshots with unsupported engine versions for RDS for MySQL and RDS for PostgreSQL. + +# v1.83.1 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. +* **Documentation**: Updates Amazon RDS documentation with configuration information about the BYOL model for RDS for Db2. + +# v1.83.0 (2024-09-16) + +* **Feature**: Launching Global Cluster tagging. + +# v1.82.5 (2024-09-12) + +* **Documentation**: This release adds support for the os-upgrade pending maintenance action for Amazon Aurora DB clusters. + +# v1.82.4 (2024-09-04) + +* No change notes available for this release. + +# v1.82.3 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.82.2 (2024-08-22) + +* No change notes available for this release. + +# v1.82.1 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.82.0 (2024-08-01) + +* **Feature**: This release adds support for specifying optional MinACU parameter in CreateDBShardGroup and ModifyDBShardGroup API. DBShardGroup response will contain MinACU if specified. + +# v1.81.5 (2024-07-18) + +* **Documentation**: Updates Amazon RDS documentation to specify an eventual consistency model for DescribePendingMaintenanceActions. + +# v1.81.4 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.81.3 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.81.2 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.81.1 (2024-06-27) + +* **Documentation**: Updates Amazon RDS documentation for TAZ export to S3. + +# v1.81.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.80.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.80.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.79.7 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.79.6 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.79.5 (2024-06-04) + +* No change notes available for this release. + +# v1.79.4 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.79.3 (2024-05-30) + +* **Documentation**: Updates Amazon RDS documentation for Aurora Postgres DBname. + +# v1.79.2 (2024-05-23) + +* No change notes available for this release. + +# v1.79.1 (2024-05-21) + +* **Documentation**: Updates Amazon RDS documentation for Db2 license through AWS Marketplace. + +# v1.79.0 (2024-05-20) + +* **Feature**: This release adds support for EngineLifecycleSupport on DBInstances, DBClusters, and GlobalClusters. + +# v1.78.3 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.78.2 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.78.1 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.78.0 (2024-04-26) + +* **Feature**: SupportsLimitlessDatabase field added to describe-db-engine-versions to indicate whether the DB engine version supports Aurora Limitless Database. + +# v1.77.3 (2024-04-25) + +* **Documentation**: Updates Amazon RDS documentation for setting local time zones for RDS for Db2 DB instances. + +# v1.77.2 (2024-04-23) + +* **Documentation**: Fix the example ARN for ModifyActivityStreamRequest + +# v1.77.1 (2024-04-11) + +* **Documentation**: Updates Amazon RDS documentation for Standard Edition 2 support in RDS Custom for Oracle. + +# v1.77.0 (2024-04-09) + +* **Feature**: This release adds support for specifying the CA certificate to use for the new db instance when restoring from db snapshot, restoring from s3, restoring to point in time, and creating a db instance read replica. + +# v1.76.1 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.76.0 (2024-03-18) + +* **Feature**: This release launches the ModifyIntegration API and support for data filtering for zero-ETL Integrations. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.75.2 (2024-03-14) + +* **Documentation**: Updates Amazon RDS documentation for EBCDIC collation for RDS for Db2. + +# v1.75.1 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Documentation**: Updates Amazon RDS documentation for io2 storage for Multi-AZ DB clusters +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.75.0 (2024-03-06) + +* **Feature**: Updated the input of CreateDBCluster and ModifyDBCluster to support setting CA certificates. Updated the output of DescribeDBCluster to show current CA certificate setting value. + +# v1.74.2 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.74.1 (2024-03-04) + +* **Bug Fix**: Update internal/presigned-url dependency for corrected API name. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.74.0 (2024-02-26) + +* **Feature**: This release adds support for gp3 data volumes for Multi-AZ DB Clusters. + +# v1.73.0 (2024-02-23) + +* **Feature**: Add pattern and length based validations for DBShardGroupIdentifier +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.72.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.71.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.71.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.71.0 (2024-02-16) + +* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. +* **Documentation**: Doc only update for a valid option in DB parameter group + +# v1.70.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.69.0 (2024-01-29) + +* **Feature**: Introduced support for the InsufficientDBInstanceCapacityFault error in the RDS RestoreDBClusterFromSnapshot and RestoreDBClusterToPointInTime API methods. This provides enhanced error handling, ensuring a more robust experience. + +# v1.68.0 (2024-01-24) + +* **Feature**: This release adds support for Aurora Limitless Database. + +# v1.67.0 (2024-01-22) + +* **Feature**: Introduced support for the InsufficientDBInstanceCapacityFault error in the RDS CreateDBCluster API method. This provides enhanced error handling, ensuring a more robust experience when creating database clusters with insufficient instance capacity. + +# v1.66.2 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.66.1 (2023-12-27) + +* No change notes available for this release. + +# v1.66.0 (2023-12-21) + +* **Feature**: This release adds support for using RDS Data API with Aurora PostgreSQL Serverless v2 and provisioned DB clusters. + +# v1.65.0 (2023-12-19) + +* **Feature**: RDS - The release adds two new APIs: DescribeDBRecommendations and ModifyDBRecommendation + +# v1.64.6 (2023-12-15) + +* **Documentation**: Updates Amazon RDS documentation by adding code examples + +# v1.64.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.64.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.64.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.64.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.64.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.64.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.63.3 (2023-11-27.2) + +* **Documentation**: Updates Amazon RDS documentation for support for RDS for Db2. + +# v1.63.2 (2023-11-27) + +* No change notes available for this release. + +# v1.63.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.63.0 (2023-11-17) + +* **Feature**: This release adds support for option groups and replica enhancements to Amazon RDS Custom. + +# v1.62.4 (2023-11-15) + +* **Documentation**: Updates Amazon RDS documentation for support for upgrading RDS for MySQL snapshots from version 5.7 to version 8.0. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.62.3 (2023-11-10) + +* **Documentation**: Updates Amazon RDS documentation for zero-ETL integrations. + +# v1.62.2 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.62.1 (2023-11-08) + +* **Documentation**: This Amazon RDS release adds support for patching the OS of an RDS Custom for Oracle DB instance. You can now upgrade the database or operating system using the modify-db-instance command. + +# v1.62.0 (2023-11-07) + +* **Feature**: This Amazon RDS release adds support for the multi-tenant configuration. In this configuration, an RDS DB instance can contain multiple tenant databases. In RDS for Oracle, a tenant database is a pluggable database (PDB). + +# v1.61.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Feature**: This release adds support for customized networking resources to Amazon RDS Custom. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.60.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.59.0 (2023-10-30) + +* **Feature**: This release launches the CreateIntegration, DeleteIntegration, and DescribeIntegrations APIs to manage zero-ETL Integrations. + +# v1.58.0 (2023-10-24) + +* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). + +# v1.57.0 (2023-10-18) + +* **Feature**: This release adds support for upgrading the storage file system configuration on the DB instance using a blue/green deployment or a read replica. + +# v1.56.0 (2023-10-12) + +* **Feature**: This release adds support for adding a dedicated log volume to open-source RDS instances. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.55.2 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.55.1 (2023-10-05) + +* **Documentation**: Updates Amazon RDS documentation for corrections and minor improvements. + +# v1.55.0 (2023-10-02) + +* **Feature**: Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response. + +# v1.54.0 (2023-09-05) + +* **Feature**: Add support for feature integration with AWS Backup. + +# v1.53.0 (2023-08-24) + +* **Feature**: This release updates the supported versions for Percona XtraBackup in Aurora MySQL. + +# v1.52.0 (2023-08-22) + +* **Feature**: Adding parameters to CreateCustomDbEngineVersion reserved for future use. + +# v1.51.0 (2023-08-21) + +* **Feature**: Adding support for RDS Aurora Global Database Unplanned Failover +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.3 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.2 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.1 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.0 (2023-08-01) + +* **Feature**: Added support for deleted clusters PiTR. + +# v1.49.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Feature**: This release adds support for Aurora MySQL local write forwarding, which allows for forwarding of write operations from reader DB instances to the writer DB instance. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.48.1 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.48.0 (2023-07-25) + +* **Feature**: This release adds support for monitoring storage optimization progress on the DescribeDBInstances API. + +# v1.47.0 (2023-07-21) + +* **Feature**: Adds support for the DBSystemID parameter of CreateDBInstance to RDS Custom for Oracle. + +# v1.46.2 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.46.1 (2023-07-06) + +* **Documentation**: Updates Amazon RDS documentation for creating DB instances and creating Aurora global clusters. + +# v1.46.0 (2023-06-28) + +* **Feature**: Amazon Relational Database Service (RDS) now supports joining a RDS for SQL Server instance to a self-managed Active Directory. + +# v1.45.3 (2023-06-23) + +* **Documentation**: Documentation improvements for create, describe, and modify DB clusters and DB instances. + +# v1.45.2 (2023-06-15) + +* No change notes available for this release. + +# v1.45.1 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.0 (2023-05-31) + +* **Feature**: This release adds support for changing the engine for Oracle using the ModifyDbInstance API + +# v1.44.1 (2023-05-18) + +* **Documentation**: RDS documentation update for the EngineVersion parameter of ModifyDBSnapshot + +# v1.44.0 (2023-05-10) + +* **Feature**: Amazon Relational Database Service (RDS) updates for the new Aurora I/O-Optimized storage type for Amazon Aurora DB clusters + +# v1.43.3 (2023-05-04) + +* No change notes available for this release. + +# v1.43.2 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.1 (2023-04-19) + +* **Documentation**: Adds support for the ImageId parameter of CreateCustomDBEngineVersion to RDS Custom for Oracle + +# v1.43.0 (2023-04-14) + +* **Feature**: This release adds support of modifying the engine mode of database clusters. + +# v1.42.3 (2023-04-10) + +* No change notes available for this release. + +# v1.42.2 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.42.1 (2023-04-06) + +* **Documentation**: Adds and updates the SDK examples + +# v1.42.0 (2023-03-29) + +* **Feature**: Add support for creating a read replica DB instance from a Multi-AZ DB cluster. + +# v1.41.0 (2023-03-24) + +* **Feature**: Added error code CreateCustomDBEngineVersionFault for when the create custom engine version for Custom engines fails. + +# v1.40.7 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.40.6 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.40.5 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.40.4 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.40.3 (2023-02-15) + +* **Documentation**: Database Activity Stream support for RDS for SQL Server. + +# v1.40.2 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. + +# v1.40.1 (2023-01-23) + +* No change notes available for this release. + +# v1.40.0 (2023-01-10) + +* **Feature**: This release adds support for configuring allocated storage on the CreateDBInstanceReadReplica, RestoreDBInstanceFromDBSnapshot, and RestoreDBInstanceToPointInTime APIs. + +# v1.39.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). +* **Feature**: This release adds support for specifying which certificate authority (CA) to use for a DB instance's server certificate during DB instance creation, as well as other CA enhancements. + +# v1.38.0 (2022-12-28) + +* **Feature**: This release adds support for Custom Engine Version (CEV) on RDS Custom SQL Server. + +# v1.37.0 (2022-12-22) + +* **Feature**: Add support for managing master user password in AWS Secrets Manager for the DBInstance and DBCluster. + +# v1.36.0 (2022-12-19) + +* **Feature**: Add support for --enable-customer-owned-ip to RDS create-db-instance-read-replica API for RDS on Outposts. + +# v1.35.1 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.0 (2022-12-13) + +* **Feature**: This deployment adds ClientPasswordAuthType field to the Auth structure of the DBProxy. + +# v1.34.0 (2022-12-12) + +* **Feature**: Update the RDS API model to support copying option groups during the CopyDBSnapshot operation + +# v1.33.0 (2022-12-06) + +* **Feature**: This release adds the BlueGreenDeploymentNotFoundFault to the AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource operations. + +# v1.32.0 (2022-12-05) + +* **Feature**: This release adds the InvalidDBInstanceStateFault to the RestoreDBClusterFromSnapshot operation. + +# v1.31.1 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.0 (2022-11-28) + +* **Feature**: This release enables new Aurora and RDS feature called Blue/Green Deployments that makes updates to databases safer, simpler and faster. + +# v1.30.1 (2022-11-22) + +* No change notes available for this release. + +# v1.30.0 (2022-11-16) + +* **Feature**: This release adds support for container databases (CDBs) to Amazon RDS Custom for Oracle. A CDB contains one PDB at creation. You can add more PDBs using Oracle SQL. You can also customize your database installation by setting the Oracle base, Oracle home, and the OS user name and group. + +# v1.29.0 (2022-11-14) + +* **Feature**: This release adds support for restoring an RDS Multi-AZ DB cluster snapshot to a Single-AZ deployment or a Multi-AZ DB instance deployment. + +# v1.28.1 (2022-11-10) + +* No change notes available for this release. + +# v1.28.0 (2022-11-01) + +* **Feature**: Relational Database Service - This release adds support for configuring Storage Throughput on RDS database instances. + +# v1.27.0 (2022-10-25) + +* **Feature**: Relational Database Service - This release adds support for exporting DB cluster data to Amazon S3. + +# v1.26.3 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2022-09-19) + +* **Feature**: This release adds support for Amazon RDS Proxy with SQL Server compatibility. + +# v1.25.6 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.4 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2022-08-30) + +* No change notes available for this release. + +# v1.25.2 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2022-08-26) + +* **Documentation**: Removes support for RDS Custom from DBInstanceClass in ModifyDBInstance + +# v1.25.0 (2022-08-23) + +* **Feature**: RDS for Oracle supports Oracle Data Guard switchover and read replica backups. + +# v1.24.0 (2022-08-17) + +* **Feature**: Adds support for Internet Protocol Version 6 (IPv6) for RDS Aurora database clusters. + +# v1.23.6 (2022-08-14) + +* **Documentation**: Adds support for RDS Custom to DBInstanceClass in ModifyDBInstance + +# v1.23.5 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.4 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.3 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2022-07-26) + +* **Documentation**: Adds support for using RDS Proxies with RDS for MariaDB databases. + +# v1.23.0 (2022-07-22) + +* **Feature**: This release adds the "ModifyActivityStream" API with support for audit policy state locking and unlocking. + +# v1.22.1 (2022-07-21) + +* **Documentation**: Adds support for creating an RDS Proxy for an RDS for MariaDB database. + +# v1.22.0 (2022-07-05) + +* **Feature**: Adds waiters support for DBCluster. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.5 (2022-07-01) + +* **Documentation**: Adds support for additional retention periods to Performance Insights. + +# v1.21.4 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2022-05-06) + +* **Documentation**: Various documentation improvements. + +# v1.21.0 (2022-04-29) + +* **Feature**: Feature - Adds support for Internet Protocol Version 6 (IPv6) on RDS database instances. + +# v1.20.1 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2022-04-20) + +* **Feature**: Added a new cluster-level attribute to set the capacity range for Aurora Serverless v2 instances. + +# v1.19.0 (2022-04-15) + +* **Feature**: Removes Amazon RDS on VMware with the deletion of APIs related to Custom Availability Zones and Media installation + +# v1.18.4 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.2 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2022-03-15) + +* **Documentation**: Various documentation improvements + +# v1.18.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: Updated service client model to latest release. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-01-14) + +* **Feature**: Updated API models +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. +* **Feature**: Updated to latest service endpoints + +# v1.13.1 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2021-11-30) + +* **Feature**: API client updated + +# v1.12.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. +* **Feature**: Updated service to latest API model. +* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature. + +# v1.11.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Feature**: Updated service to latest API model. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-10-21) + +* **Feature**: API client updated +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.1 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2021-09-17) + +* **Feature**: Updated API client and endpoints to latest revision. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.1 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-08-04) + +* **Feature**: Updated to latest API model. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-07-15) + +* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-06-25) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2021-06-11) + +* **Documentation**: Updated to latest API model. + +# v1.4.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_client.go new file mode 100644 index 00000000..9eaf354b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_client.go @@ -0,0 +1,1064 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "RDS" +const ServiceAPIVersion = "2014-10-31" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/rds") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/rds") +} + +// Client provides the API client to make operations call for Amazon Relational +// Database Service. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/rds") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "rds", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/rds") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +// HTTPPresignerV4 represents presigner interface used by presign url client +type HTTPPresignerV4 interface { + PresignHTTP( + ctx context.Context, credentials aws.Credentials, r *http.Request, + payloadHash string, service string, region string, signingTime time.Time, + optFns ...func(*v4.SignerOptions), + ) (url string, signedHeader http.Header, err error) +} + +// PresignOptions represents the presign client options +type PresignOptions struct { + + // ClientOptions are list of functional options to mutate client options used by + // the presign client. + ClientOptions []func(*Options) + + // Presigner is the presigner used by the presign url client + Presigner HTTPPresignerV4 +} + +func (o PresignOptions) copy() PresignOptions { + clientOptions := make([]func(*Options), len(o.ClientOptions)) + copy(clientOptions, o.ClientOptions) + o.ClientOptions = clientOptions + return o +} + +// WithPresignClientFromClientOptions is a helper utility to retrieve a function +// that takes PresignOption as input +func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) { + return withPresignClientFromClientOptions(optFns).options +} + +type withPresignClientFromClientOptions []func(*Options) + +func (w withPresignClientFromClientOptions) options(o *PresignOptions) { + o.ClientOptions = append(o.ClientOptions, w...) +} + +// PresignClient represents the presign url client +type PresignClient struct { + client *Client + options PresignOptions +} + +// NewPresignClient generates a presign client using provided API Client and +// presign options +func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient { + var options PresignOptions + for _, fn := range optFns { + fn(&options) + } + if len(options.ClientOptions) != 0 { + c = New(c.options, options.ClientOptions...) + } + + if options.Presigner == nil { + options.Presigner = newDefaultV4Signer(c.options) + } + + return &PresignClient{ + client: c, + options: options, + } +} + +func withNopHTTPClientAPIOption(o *Options) { + o.HTTPClient = smithyhttp.NopClient{} +} + +type presignContextPolyfillMiddleware struct { +} + +func (*presignContextPolyfillMiddleware) ID() string { + return "presignContextPolyfill" +} + +func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + schemeID := rscheme.Scheme.SchemeID() + + if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { + if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr) + } + } else if schemeID == "aws.auth#sigv4a" { + if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) + } + } + + return next.HandleFinalize(ctx, in) +} + +type presignConverter PresignOptions + +func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { + if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { + stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + } + stack.Deserialize.Clear() + stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) + stack.Build.Remove("UserAgent") + if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { + return err + } + + pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ + CredentialsProvider: options.Credentials, + Presigner: c.Presigner, + LogSigning: options.ClientLogMode.IsSigning(), + }) + if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { + return err + } + if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { + return err + } + // convert request to a GET request + err = query.AddAsGetRequestMiddleware(stack) + if err != nil { + return err + } + err = presignedurlcust.AddAsIsPresigningMiddleware(stack) + if err != nil { + return err + } + return nil +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBCluster.go new file mode 100644 index 00000000..a2cfcdd8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBCluster.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates an Identity and Access Management (IAM) role with a DB cluster. +func (c *Client) AddRoleToDBCluster(ctx context.Context, params *AddRoleToDBClusterInput, optFns ...func(*Options)) (*AddRoleToDBClusterOutput, error) { + if params == nil { + params = &AddRoleToDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddRoleToDBCluster", params, optFns, c.addOperationAddRoleToDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddRoleToDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddRoleToDBClusterInput struct { + + // The name of the DB cluster to associate the IAM role with. + // + // This member is required. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) of the IAM role to associate with the Aurora DB + // cluster, for example arn:aws:iam::123456789012:role/AuroraAccessRole . + // + // This member is required. + RoleArn *string + + // The name of the feature for the DB cluster that the IAM role is to be + // associated with. For information about supported feature names, see DBEngineVersion. + FeatureName *string + + noSmithyDocumentSerde +} + +type AddRoleToDBClusterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddRoleToDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddRoleToDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddRoleToDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddRoleToDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAddRoleToDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddRoleToDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddRoleToDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddRoleToDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBInstance.go new file mode 100644 index 00000000..b8b201fe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddRoleToDBInstance.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates an Amazon Web Services Identity and Access Management (IAM) role +// with a DB instance. +// +// To add a role to a DB instance, the status of the DB instance must be available . +// +// This command doesn't apply to RDS Custom. +func (c *Client) AddRoleToDBInstance(ctx context.Context, params *AddRoleToDBInstanceInput, optFns ...func(*Options)) (*AddRoleToDBInstanceOutput, error) { + if params == nil { + params = &AddRoleToDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddRoleToDBInstance", params, optFns, c.addOperationAddRoleToDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddRoleToDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddRoleToDBInstanceInput struct { + + // The name of the DB instance to associate the IAM role with. + // + // This member is required. + DBInstanceIdentifier *string + + // The name of the feature for the DB instance that the IAM role is to be + // associated with. For information about supported feature names, see DBEngineVersion. + // + // This member is required. + FeatureName *string + + // The Amazon Resource Name (ARN) of the IAM role to associate with the DB + // instance, for example arn:aws:iam::123456789012:role/AccessRole . + // + // This member is required. + RoleArn *string + + noSmithyDocumentSerde +} + +type AddRoleToDBInstanceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddRoleToDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddRoleToDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddRoleToDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddRoleToDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAddRoleToDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddRoleToDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddRoleToDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddRoleToDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddSourceIdentifierToSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddSourceIdentifierToSubscription.go new file mode 100644 index 00000000..62f02d03 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddSourceIdentifierToSubscription.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds a source identifier to an existing RDS event notification subscription. +func (c *Client) AddSourceIdentifierToSubscription(ctx context.Context, params *AddSourceIdentifierToSubscriptionInput, optFns ...func(*Options)) (*AddSourceIdentifierToSubscriptionOutput, error) { + if params == nil { + params = &AddSourceIdentifierToSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddSourceIdentifierToSubscription", params, optFns, c.addOperationAddSourceIdentifierToSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddSourceIdentifierToSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddSourceIdentifierToSubscriptionInput struct { + + // The identifier of the event source to be added. + // + // Constraints: + // + // - If the source type is a DB instance, a DBInstanceIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster, a DBClusterIdentifier value must be + // supplied. + // + // - If the source type is a DB parameter group, a DBParameterGroupName value + // must be supplied. + // + // - If the source type is a DB security group, a DBSecurityGroupName value must + // be supplied. + // + // - If the source type is a DB snapshot, a DBSnapshotIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier + // value must be supplied. + // + // - If the source type is an RDS Proxy, a DBProxyName value must be supplied. + // + // This member is required. + SourceIdentifier *string + + // The name of the RDS event notification subscription you want to add a source + // identifier to. + // + // This member is required. + SubscriptionName *string + + noSmithyDocumentSerde +} + +type AddSourceIdentifierToSubscriptionOutput struct { + + // Contains the results of a successful invocation of the + // DescribeEventSubscriptions action. + EventSubscription *types.EventSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddSourceIdentifierToSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddSourceIdentifierToSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddSourceIdentifierToSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddSourceIdentifierToSubscription"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAddSourceIdentifierToSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddSourceIdentifierToSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddSourceIdentifierToSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddSourceIdentifierToSubscription", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddTagsToResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddTagsToResource.go new file mode 100644 index 00000000..7babb64c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AddTagsToResource.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds metadata tags to an Amazon RDS resource. These tags can also be used with +// cost allocation reporting to track cost associated with Amazon RDS resources, or +// used in a Condition statement in an IAM policy for Amazon RDS. +// +// For an overview on tagging your relational database resources, see [Tagging Amazon RDS Resources] or [Tagging Amazon Aurora and Amazon RDS Resources]. +// +// [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html +// [Tagging Amazon Aurora and Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html +func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { + if params == nil { + params = &AddTagsToResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, c.addOperationAddTagsToResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddTagsToResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddTagsToResourceInput struct { + + // The Amazon RDS resource that the tags are added to. This value is an Amazon + // Resource Name (ARN). For information about creating an ARN, see [Constructing an RDS Amazon Resource Name (ARN)]. + // + // [Constructing an RDS Amazon Resource Name (ARN)]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + ResourceName *string + + // The tags to be assigned to the Amazon RDS resource. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type AddTagsToResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAddTagsToResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddTagsToResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AddTagsToResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAddTagsToResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAddTagsToResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AddTagsToResource", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ApplyPendingMaintenanceAction.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ApplyPendingMaintenanceAction.go new file mode 100644 index 00000000..a8410f47 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ApplyPendingMaintenanceAction.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Applies a pending maintenance action to a resource (for example, to a DB +// instance). +func (c *Client) ApplyPendingMaintenanceAction(ctx context.Context, params *ApplyPendingMaintenanceActionInput, optFns ...func(*Options)) (*ApplyPendingMaintenanceActionOutput, error) { + if params == nil { + params = &ApplyPendingMaintenanceActionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ApplyPendingMaintenanceAction", params, optFns, c.addOperationApplyPendingMaintenanceActionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ApplyPendingMaintenanceActionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ApplyPendingMaintenanceActionInput struct { + + // The pending maintenance action to apply to this resource. + // + // Valid Values: + // + // - ca-certificate-rotation + // + // - db-upgrade + // + // - hardware-maintenance + // + // - os-upgrade + // + // - system-update + // + // For more information about these actions, see [Maintenance actions for Amazon Aurora] or [Maintenance actions for Amazon RDS]. + // + // [Maintenance actions for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-rds + // [Maintenance actions for Amazon Aurora]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-aurora + // + // This member is required. + ApplyAction *string + + // A value that specifies the type of opt-in request, or undoes an opt-in request. + // An opt-in request of type immediate can't be undone. + // + // Valid Values: + // + // - immediate - Apply the maintenance action immediately. + // + // - next-maintenance - Apply the maintenance action during the next maintenance + // window for the resource. + // + // - undo-opt-in - Cancel any existing next-maintenance opt-in requests. + // + // This member is required. + OptInType *string + + // The RDS Amazon Resource Name (ARN) of the resource that the pending maintenance + // action applies to. For information about creating an ARN, see [Constructing an RDS Amazon Resource Name (ARN)]. + // + // [Constructing an RDS Amazon Resource Name (ARN)]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +type ApplyPendingMaintenanceActionOutput struct { + + // Describes the pending maintenance actions for a resource. + ResourcePendingMaintenanceActions *types.ResourcePendingMaintenanceActions + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationApplyPendingMaintenanceActionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpApplyPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpApplyPendingMaintenanceAction{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ApplyPendingMaintenanceAction"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpApplyPendingMaintenanceActionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplyPendingMaintenanceAction(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opApplyPendingMaintenanceAction(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ApplyPendingMaintenanceAction", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AuthorizeDBSecurityGroupIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AuthorizeDBSecurityGroupIngress.go new file mode 100644 index 00000000..9f744777 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_AuthorizeDBSecurityGroupIngress.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables ingress to a DBSecurityGroup using one of two forms of authorization. +// First, EC2 or VPC security groups can be added to the DBSecurityGroup if the +// application using the database is running on EC2 or VPC instances. Second, IP +// ranges are available if the application accessing your database is running on +// the internet. Required parameters for this API are one of CIDR range, +// EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either +// EC2SecurityGroupName or EC2SecurityGroupId for non-VPC). +// +// You can't authorize ingress from an EC2 security group in one Amazon Web +// Services Region to an Amazon RDS DB instance in another. You can't authorize +// ingress from a VPC security group in one VPC to an Amazon RDS DB instance in +// another. +// +// For an overview of CIDR ranges, go to the [Wikipedia Tutorial]. +// +// EC2-Classic was retired on August 15, 2022. If you haven't migrated from +// EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For +// more information, see [Migrate from EC2-Classic to a VPC]in the Amazon EC2 User Guide, the blog [EC2-Classic Networking is Retiring – Here’s How to Prepare], and [Moving a DB instance not in a VPC into a VPC] in the +// Amazon RDS User Guide. +// +// [Migrate from EC2-Classic to a VPC]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html +// [Wikipedia Tutorial]: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing +// [EC2-Classic Networking is Retiring – Here’s How to Prepare]: http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/ +// [Moving a DB instance not in a VPC into a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html +func (c *Client) AuthorizeDBSecurityGroupIngress(ctx context.Context, params *AuthorizeDBSecurityGroupIngressInput, optFns ...func(*Options)) (*AuthorizeDBSecurityGroupIngressOutput, error) { + if params == nil { + params = &AuthorizeDBSecurityGroupIngressInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AuthorizeDBSecurityGroupIngress", params, optFns, c.addOperationAuthorizeDBSecurityGroupIngressMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AuthorizeDBSecurityGroupIngressOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AuthorizeDBSecurityGroupIngressInput struct { + + // The name of the DB security group to add authorization to. + // + // This member is required. + DBSecurityGroupName *string + + // The IP range to authorize. + CIDRIP *string + + // Id of the EC2 security group to authorize. For VPC DB security groups, + // EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and + // either EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupId *string + + // Name of the EC2 security group to authorize. For VPC DB security groups, + // EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and + // either EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupName *string + + // Amazon Web Services account number of the owner of the EC2 security group + // specified in the EC2SecurityGroupName parameter. The Amazon Web Services access + // key ID isn't an acceptable value. For VPC DB security groups, EC2SecurityGroupId + // must be provided. Otherwise, EC2SecurityGroupOwnerId and either + // EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupOwnerId *string + + noSmithyDocumentSerde +} + +type AuthorizeDBSecurityGroupIngressOutput struct { + + // Contains the details for an Amazon RDS DB security group. + // + // This data type is used as a response element in the DescribeDBSecurityGroups + // action. + DBSecurityGroup *types.DBSecurityGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAuthorizeDBSecurityGroupIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAuthorizeDBSecurityGroupIngress{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAuthorizeDBSecurityGroupIngress{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AuthorizeDBSecurityGroupIngress"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAuthorizeDBSecurityGroupIngressValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeDBSecurityGroupIngress(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAuthorizeDBSecurityGroupIngress(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AuthorizeDBSecurityGroupIngress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_BacktrackDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_BacktrackDBCluster.go new file mode 100644 index 00000000..4d8a095b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_BacktrackDBCluster.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Backtracks a DB cluster to a specific time, without creating a new DB cluster. +// +// For more information on backtracking, see [Backtracking an Aurora DB Cluster] in the Amazon Aurora User Guide. +// +// This action applies only to Aurora MySQL DB clusters. +// +// [Backtracking an Aurora DB Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Managing.Backtrack.html +func (c *Client) BacktrackDBCluster(ctx context.Context, params *BacktrackDBClusterInput, optFns ...func(*Options)) (*BacktrackDBClusterOutput, error) { + if params == nil { + params = &BacktrackDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BacktrackDBCluster", params, optFns, c.addOperationBacktrackDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BacktrackDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BacktrackDBClusterInput struct { + + // The timestamp of the time to backtrack the DB cluster to, specified in ISO 8601 + // format. For more information about ISO 8601, see the [ISO8601 Wikipedia page.] + // + // If the specified time isn't a consistent time for the DB cluster, Aurora + // automatically chooses the nearest possible consistent time for the DB cluster. + // + // Constraints: + // + // - Must contain a valid ISO 8601 timestamp. + // + // - Can't contain a timestamp set in the future. + // + // Example: 2017-07-08T18:00Z + // + // [ISO8601 Wikipedia page.]: http://en.wikipedia.org/wiki/ISO_8601 + // + // This member is required. + BacktrackTo *time.Time + + // The DB cluster identifier of the DB cluster to be backtracked. This parameter + // is stored as a lowercase string. + // + // Constraints: + // + // - Must contain from 1 to 63 alphanumeric characters or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster1 + // + // This member is required. + DBClusterIdentifier *string + + // Specifies whether to force the DB cluster to backtrack when binary logging is + // enabled. Otherwise, an error occurs when binary logging is enabled. + Force *bool + + // Specifies whether to backtrack the DB cluster to the earliest possible + // backtrack time when BacktrackTo is set to a timestamp earlier than the earliest + // backtrack time. When this parameter is disabled and BacktrackTo is set to a + // timestamp earlier than the earliest backtrack time, an error occurs. + UseEarliestTimeOnPointInTimeUnavailable *bool + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the DescribeDBClusterBacktracks +// action. +type BacktrackDBClusterOutput struct { + + // Contains the backtrack identifier. + BacktrackIdentifier *string + + // The timestamp of the time at which the backtrack was requested. + BacktrackRequestCreationTime *time.Time + + // The timestamp of the time to which the DB cluster was backtracked. + BacktrackTo *time.Time + + // The timestamp of the time from which the DB cluster was backtracked. + BacktrackedFrom *time.Time + + // Contains a user-supplied DB cluster identifier. This identifier is the unique + // key that identifies a DB cluster. + DBClusterIdentifier *string + + // The status of the backtrack. This property returns one of the following values: + // + // - applying - The backtrack is currently being applied to or rolled back from + // the DB cluster. + // + // - completed - The backtrack has successfully been applied to or rolled back + // from the DB cluster. + // + // - failed - An error occurred while the backtrack was applied to or rolled back + // from the DB cluster. + // + // - pending - The backtrack is currently pending application to or rollback from + // the DB cluster. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBacktrackDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpBacktrackDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpBacktrackDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "BacktrackDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpBacktrackDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBacktrackDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBacktrackDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "BacktrackDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CancelExportTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CancelExportTask.go new file mode 100644 index 00000000..a485e62b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CancelExportTask.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Cancels an export task in progress that is exporting a snapshot or cluster to +// Amazon S3. Any data that has already been written to the S3 bucket isn't +// removed. +func (c *Client) CancelExportTask(ctx context.Context, params *CancelExportTaskInput, optFns ...func(*Options)) (*CancelExportTaskOutput, error) { + if params == nil { + params = &CancelExportTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelExportTask", params, optFns, c.addOperationCancelExportTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelExportTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelExportTaskInput struct { + + // The identifier of the snapshot or cluster export task to cancel. + // + // This member is required. + ExportTaskIdentifier *string + + noSmithyDocumentSerde +} + +// Contains the details of a snapshot or cluster export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks +// operation. +type CancelExportTaskOutput struct { + + // The data exported from the snapshot or cluster. + // + // Valid Values: + // + // - database - Export all the data from a specified database. + // + // - database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. + // + // - database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + // + // - database.schema.table table-name - Export a table of the database schema. + // This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + ExportOnly []string + + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. + ExportTaskIdentifier *string + + // The reason the export failed, if it failed. + FailureCause *string + + // The name of the IAM role that is used to write to Amazon S3 when exporting a + // snapshot or cluster. + IamRoleArn *string + + // The key identifier of the Amazon Web Services KMS key that is used to encrypt + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. + KmsKeyId *string + + // The progress of the snapshot or cluster export task as a percentage. + PercentProgress *int32 + + // The Amazon S3 bucket where the snapshot or cluster is exported to. + S3Bucket *string + + // The Amazon S3 bucket prefix that is the file name and path of the exported data. + S3Prefix *string + + // The time when the snapshot was created. + SnapshotTime *time.Time + + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. + SourceArn *string + + // The type of source for the export. + SourceType types.ExportSourceType + + // The progress status of the export task. The status can be one of the following: + // + // - CANCELED + // + // - CANCELING + // + // - COMPLETE + // + // - FAILED + // + // - IN_PROGRESS + // + // - STARTING + Status *string + + // The time when the snapshot or cluster export task ended. + TaskEndTime *time.Time + + // The time when the snapshot or cluster export task started. + TaskStartTime *time.Time + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int32 + + // A warning about the snapshot or cluster export task. + WarningMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelExportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCancelExportTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCancelExportTask{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelExportTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCancelExportTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelExportTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCancelExportTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CancelExportTask", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterParameterGroup.go new file mode 100644 index 00000000..3c3dd7d2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterParameterGroup.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies the specified DB cluster parameter group. +// +// You can't copy a default DB cluster parameter group. Instead, create a new +// custom DB cluster parameter group, which copies the default parameters and +// values for the specified DB cluster parameter group family. +func (c *Client) CopyDBClusterParameterGroup(ctx context.Context, params *CopyDBClusterParameterGroupInput, optFns ...func(*Options)) (*CopyDBClusterParameterGroupOutput, error) { + if params == nil { + params = &CopyDBClusterParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyDBClusterParameterGroup", params, optFns, c.addOperationCopyDBClusterParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyDBClusterParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyDBClusterParameterGroupInput struct { + + // The identifier or Amazon Resource Name (ARN) for the source DB cluster + // parameter group. For information about creating an ARN, see [Constructing an ARN for Amazon RDS]in the Amazon + // Aurora User Guide. + // + // Constraints: + // + // - Must specify a valid DB cluster parameter group. + // + // [Constructing an ARN for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + SourceDBClusterParameterGroupIdentifier *string + + // A description for the copied DB cluster parameter group. + // + // This member is required. + TargetDBClusterParameterGroupDescription *string + + // The identifier for the copied DB cluster parameter group. + // + // Constraints: + // + // - Can't be null, empty, or blank + // + // - Must contain from 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-cluster-param-group1 + // + // This member is required. + TargetDBClusterParameterGroupIdentifier *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CopyDBClusterParameterGroupOutput struct { + + // Contains the details of an Amazon RDS DB cluster parameter group. + // + // This data type is used as a response element in the + // DescribeDBClusterParameterGroups action. + DBClusterParameterGroup *types.DBClusterParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyDBClusterParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCopyDBClusterParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBClusterParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCopyDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopyDBClusterParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterSnapshot.go new file mode 100644 index 00000000..e14da5a3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBClusterSnapshot.go @@ -0,0 +1,433 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies a snapshot of a DB cluster. +// +// To copy a DB cluster snapshot from a shared manual DB cluster snapshot, +// SourceDBClusterSnapshotIdentifier must be the Amazon Resource Name (ARN) of the +// shared DB cluster snapshot. +// +// You can copy an encrypted DB cluster snapshot from another Amazon Web Services +// Region. In that case, the Amazon Web Services Region where you call the +// CopyDBClusterSnapshot operation is the destination Amazon Web Services Region +// for the encrypted DB cluster snapshot to be copied to. To copy an encrypted DB +// cluster snapshot from another Amazon Web Services Region, you must provide the +// following values: +// +// - KmsKeyId - The Amazon Web Services Key Management System (Amazon Web +// Services KMS) key identifier for the key to use to encrypt the copy of the DB +// cluster snapshot in the destination Amazon Web Services Region. +// +// - TargetDBClusterSnapshotIdentifier - The identifier for the new copy of the +// DB cluster snapshot in the destination Amazon Web Services Region. +// +// - SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for +// the encrypted DB cluster snapshot to be copied. This identifier must be in the +// ARN format for the source Amazon Web Services Region and is the same value as +// the SourceDBClusterSnapshotIdentifier in the presigned URL. +// +// To cancel the copy operation once it is in progress, delete the target DB +// cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that DB +// cluster snapshot is in "copying" status. +// +// For more information on copying encrypted Amazon Aurora DB cluster snapshots +// from one Amazon Web Services Region to another, see [Copying a Snapshot]in the Amazon Aurora User +// Guide. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [Copying a Snapshot]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_CopySnapshot.html +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) CopyDBClusterSnapshot(ctx context.Context, params *CopyDBClusterSnapshotInput, optFns ...func(*Options)) (*CopyDBClusterSnapshotOutput, error) { + if params == nil { + params = &CopyDBClusterSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyDBClusterSnapshot", params, optFns, c.addOperationCopyDBClusterSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyDBClusterSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyDBClusterSnapshotInput struct { + + // The identifier of the DB cluster snapshot to copy. This parameter isn't + // case-sensitive. + // + // You can't copy an encrypted, shared DB cluster snapshot from one Amazon Web + // Services Region to another. + // + // Constraints: + // + // - Must specify a valid system snapshot in the "available" state. + // + // - If the source snapshot is in the same Amazon Web Services Region as the + // copy, specify a valid DB snapshot identifier. + // + // - If the source snapshot is in a different Amazon Web Services Region than + // the copy, specify a valid DB cluster snapshot ARN. For more information, go to [Copying Snapshots Across Amazon Web Services Regions] + // in the Amazon Aurora User Guide. + // + // Example: my-cluster-snapshot1 + // + // [Copying Snapshots Across Amazon Web Services Regions]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_CopySnapshot.html#USER_CopySnapshot.AcrossRegions + // + // This member is required. + SourceDBClusterSnapshotIdentifier *string + + // The identifier of the new DB cluster snapshot to create from the source DB + // cluster snapshot. This parameter isn't case-sensitive. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster-snapshot2 + // + // This member is required. + TargetDBClusterSnapshotIdentifier *string + + // Specifies whether to copy all tags from the source DB cluster snapshot to the + // target DB cluster snapshot. By default, tags are not copied. + CopyTags *bool + + // The Amazon Web Services KMS key identifier for an encrypted DB cluster + // snapshot. The Amazon Web Services KMS key identifier is the key ARN, key ID, + // alias ARN, or alias name for the Amazon Web Services KMS key. + // + // If you copy an encrypted DB cluster snapshot from your Amazon Web Services + // account, you can specify a value for KmsKeyId to encrypt the copy with a new + // KMS key. If you don't specify a value for KmsKeyId , then the copy of the DB + // cluster snapshot is encrypted with the same KMS key as the source DB cluster + // snapshot. + // + // If you copy an encrypted DB cluster snapshot that is shared from another Amazon + // Web Services account, then you must specify a value for KmsKeyId . + // + // To copy an encrypted DB cluster snapshot to another Amazon Web Services Region, + // you must set KmsKeyId to the Amazon Web Services KMS key identifier you want to + // use to encrypt the copy of the DB cluster snapshot in the destination Amazon Web + // Services Region. KMS keys are specific to the Amazon Web Services Region that + // they are created in, and you can't use KMS keys from one Amazon Web Services + // Region in another Amazon Web Services Region. + // + // If you copy an unencrypted DB cluster snapshot and specify a value for the + // KmsKeyId parameter, an error is returned. + KmsKeyId *string + + // When you are copying a DB cluster snapshot from one Amazon Web Services + // GovCloud (US) Region to another, the URL that contains a Signature Version 4 + // signed request for the CopyDBClusterSnapshot API operation in the Amazon Web + // Services Region that contains the source DB cluster snapshot to copy. Use the + // PreSignedUrl parameter when copying an encrypted DB cluster snapshot from + // another Amazon Web Services Region. Don't specify PreSignedUrl when copying an + // encrypted DB cluster snapshot in the same Amazon Web Services Region. + // + // This setting applies only to Amazon Web Services GovCloud (US) Regions. It's + // ignored in other Amazon Web Services Regions. + // + // The presigned URL must be a valid request for the CopyDBClusterSnapshot API + // operation that can run in the source Amazon Web Services Region that contains + // the encrypted DB cluster snapshot to copy. The presigned URL request must + // contain the following parameter values: + // + // - KmsKeyId - The KMS key identifier for the KMS key to use to encrypt the copy + // of the DB cluster snapshot in the destination Amazon Web Services Region. This + // is the same identifier for both the CopyDBClusterSnapshot operation that is + // called in the destination Amazon Web Services Region, and the operation + // contained in the presigned URL. + // + // - DestinationRegion - The name of the Amazon Web Services Region that the DB + // cluster snapshot is to be created in. + // + // - SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier for + // the encrypted DB cluster snapshot to be copied. This identifier must be in the + // Amazon Resource Name (ARN) format for the source Amazon Web Services Region. For + // example, if you are copying an encrypted DB cluster snapshot from the us-west-2 + // Amazon Web Services Region, then your SourceDBClusterSnapshotIdentifier looks + // like the following example: + // arn:aws:rds:us-west-2:123456789012:cluster-snapshot:aurora-cluster1-snapshot-20161115 + // . + // + // To learn how to generate a Signature Version 4 signed request, see [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)] and [Signature Version 4 Signing Process]. + // + // If you are using an Amazon Web Services SDK tool or the CLI, you can specify + // SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl + // manually. Specifying SourceRegion autogenerates a presigned URL that is a valid + // request for the operation that can run in the source Amazon Web Services Region. + // + // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + PreSignedUrl *string + + // The AWS region the resource is in. The presigned URL will be created with this + // region, if the PresignURL member is empty set. + SourceRegion *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // Used by the SDK's PresignURL autofill customization to specify the region the + // of the client's request. + destinationRegion *string + + noSmithyDocumentSerde +} + +type CopyDBClusterSnapshotOutput struct { + + // Contains the details for an Amazon RDS DB cluster snapshot + // + // This data type is used as a response element in the DescribeDBClusterSnapshots + // action. + DBClusterSnapshot *types.DBClusterSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyDBClusterSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCopyDBClusterSnapshotPresignURLMiddleware(stack, options); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCopyDBClusterSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBClusterSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func copyCopyDBClusterSnapshotInputForPresign(params interface{}) (interface{}, error) { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return nil, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func getCopyDBClusterSnapshotPreSignedUrl(params interface{}) (string, bool, error) { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return ``, false, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { + return ``, false, nil + } + return *input.PreSignedUrl, true, nil +} +func getCopyDBClusterSnapshotSourceRegion(params interface{}) (string, bool, error) { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return ``, false, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { + return ``, false, nil + } + return *input.SourceRegion, true, nil +} +func setCopyDBClusterSnapshotPreSignedUrl(params interface{}, value string) error { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + input.PreSignedUrl = &value + return nil +} +func setCopyDBClusterSnapshotdestinationRegion(params interface{}, value string) error { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + input.destinationRegion = &value + return nil +} +func addCopyDBClusterSnapshotPresignURLMiddleware(stack *middleware.Stack, options Options) error { + return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ + Accessor: presignedurlcust.ParameterAccessor{ + GetPresignedURL: getCopyDBClusterSnapshotPreSignedUrl, + + GetSourceRegion: getCopyDBClusterSnapshotSourceRegion, + + CopyInput: copyCopyDBClusterSnapshotInputForPresign, + + SetDestinationRegion: setCopyDBClusterSnapshotdestinationRegion, + + SetPresignedURL: setCopyDBClusterSnapshotPreSignedUrl, + }, + Presigner: &presignAutoFillCopyDBClusterSnapshotClient{client: NewPresignClient(New(options))}, + }) +} + +type presignAutoFillCopyDBClusterSnapshotClient struct { + client *PresignClient +} + +// PresignURL is a middleware accessor that satisfies URLPresigner interface. +func (c *presignAutoFillCopyDBClusterSnapshotClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { + input, ok := params.(*CopyDBClusterSnapshotInput) + if !ok { + return nil, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) + } + optFn := func(o *Options) { + o.Region = srcRegion + o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) + } + presignOptFn := WithPresignClientFromClientOptions(optFn) + return c.client.PresignCopyDBClusterSnapshot(ctx, input, presignOptFn) +} + +func newServiceMetadataMiddleware_opCopyDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopyDBClusterSnapshot", + } +} + +// PresignCopyDBClusterSnapshot is used to generate a presigned HTTP Request which +// contains presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignCopyDBClusterSnapshot(ctx context.Context, params *CopyDBClusterSnapshotInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &CopyDBClusterSnapshotInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "CopyDBClusterSnapshot", params, clientOptFns, + c.client.addOperationCopyDBClusterSnapshotMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBParameterGroup.go new file mode 100644 index 00000000..456b106b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBParameterGroup.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies the specified DB parameter group. +// +// You can't copy a default DB parameter group. Instead, create a new custom DB +// parameter group, which copies the default parameters and values for the +// specified DB parameter group family. +func (c *Client) CopyDBParameterGroup(ctx context.Context, params *CopyDBParameterGroupInput, optFns ...func(*Options)) (*CopyDBParameterGroupOutput, error) { + if params == nil { + params = &CopyDBParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyDBParameterGroup", params, optFns, c.addOperationCopyDBParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyDBParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyDBParameterGroupInput struct { + + // The identifier or ARN for the source DB parameter group. For information about + // creating an ARN, see [Constructing an ARN for Amazon RDS]in the Amazon RDS User Guide. + // + // Constraints: + // + // - Must specify a valid DB parameter group. + // + // [Constructing an ARN for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + SourceDBParameterGroupIdentifier *string + + // A description for the copied DB parameter group. + // + // This member is required. + TargetDBParameterGroupDescription *string + + // The identifier for the copied DB parameter group. + // + // Constraints: + // + // - Can't be null, empty, or blank + // + // - Must contain from 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-db-parameter-group + // + // This member is required. + TargetDBParameterGroupIdentifier *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CopyDBParameterGroupOutput struct { + + // Contains the details of an Amazon RDS DB parameter group. + // + // This data type is used as a response element in the DescribeDBParameterGroups + // action. + DBParameterGroup *types.DBParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyDBParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCopyDBParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCopyDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopyDBParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBSnapshot.go new file mode 100644 index 00000000..09ae2db2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyDBSnapshot.go @@ -0,0 +1,439 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies the specified DB snapshot. The source DB snapshot must be in the +// available state. +// +// You can copy a snapshot from one Amazon Web Services Region to another. In that +// case, the Amazon Web Services Region where you call the CopyDBSnapshot +// operation is the destination Amazon Web Services Region for the DB snapshot +// copy. +// +// This command doesn't apply to RDS Custom. +// +// For more information about copying snapshots, see [Copying a DB Snapshot] in the Amazon RDS User Guide. +// +// [Copying a DB Snapshot]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopyDBSnapshot +func (c *Client) CopyDBSnapshot(ctx context.Context, params *CopyDBSnapshotInput, optFns ...func(*Options)) (*CopyDBSnapshotOutput, error) { + if params == nil { + params = &CopyDBSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyDBSnapshot", params, optFns, c.addOperationCopyDBSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyDBSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyDBSnapshotInput struct { + + // The identifier for the source DB snapshot. + // + // If the source snapshot is in the same Amazon Web Services Region as the copy, + // specify a valid DB snapshot identifier. For example, you might specify + // rds:mysql-instance1-snapshot-20130805 . + // + // If the source snapshot is in a different Amazon Web Services Region than the + // copy, specify a valid DB snapshot ARN. For example, you might specify + // arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805 . + // + // If you are copying from a shared manual DB snapshot, this parameter must be the + // Amazon Resource Name (ARN) of the shared DB snapshot. + // + // If you are copying an encrypted snapshot this parameter must be in the ARN + // format for the source Amazon Web Services Region. + // + // Constraints: + // + // - Must specify a valid system snapshot in the "available" state. + // + // Example: rds:mydb-2012-04-02-00-01 + // + // Example: + // arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805 + // + // This member is required. + SourceDBSnapshotIdentifier *string + + // The identifier for the copy of the snapshot. + // + // Constraints: + // + // - Can't be null, empty, or blank + // + // - Must contain from 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-db-snapshot + // + // This member is required. + TargetDBSnapshotIdentifier *string + + // Specifies whether to copy the DB option group associated with the source DB + // snapshot to the target Amazon Web Services account and associate with the target + // DB snapshot. The associated option group can be copied only with cross-account + // snapshot copy calls. + CopyOptionGroup *bool + + // Specifies whether to copy all tags from the source DB snapshot to the target DB + // snapshot. By default, tags aren't copied. + CopyTags *bool + + // The Amazon Web Services KMS key identifier for an encrypted DB snapshot. The + // Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or + // alias name for the KMS key. + // + // If you copy an encrypted DB snapshot from your Amazon Web Services account, you + // can specify a value for this parameter to encrypt the copy with a new KMS key. + // If you don't specify a value for this parameter, then the copy of the DB + // snapshot is encrypted with the same Amazon Web Services KMS key as the source DB + // snapshot. + // + // If you copy an encrypted DB snapshot that is shared from another Amazon Web + // Services account, then you must specify a value for this parameter. + // + // If you specify this parameter when you copy an unencrypted snapshot, the copy + // is encrypted. + // + // If you copy an encrypted snapshot to a different Amazon Web Services Region, + // then you must specify an Amazon Web Services KMS key identifier for the + // destination Amazon Web Services Region. KMS keys are specific to the Amazon Web + // Services Region that they are created in, and you can't use KMS keys from one + // Amazon Web Services Region in another Amazon Web Services Region. + KmsKeyId *string + + // The name of an option group to associate with the copy of the snapshot. + // + // Specify this option if you are copying a snapshot from one Amazon Web Services + // Region to another, and your DB instance uses a nondefault option group. If your + // source DB instance uses Transparent Data Encryption for Oracle or Microsoft SQL + // Server, you must specify this option when copying across Amazon Web Services + // Regions. For more information, see [Option group considerations]in the Amazon RDS User Guide. + // + // [Option group considerations]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options + OptionGroupName *string + + // When you are copying a snapshot from one Amazon Web Services GovCloud (US) + // Region to another, the URL that contains a Signature Version 4 signed request + // for the CopyDBSnapshot API operation in the source Amazon Web Services Region + // that contains the source DB snapshot to copy. + // + // This setting applies only to Amazon Web Services GovCloud (US) Regions. It's + // ignored in other Amazon Web Services Regions. + // + // You must specify this parameter when you copy an encrypted DB snapshot from + // another Amazon Web Services Region by using the Amazon RDS API. Don't specify + // PreSignedUrl when you are copying an encrypted DB snapshot in the same Amazon + // Web Services Region. + // + // The presigned URL must be a valid request for the CopyDBClusterSnapshot API + // operation that can run in the source Amazon Web Services Region that contains + // the encrypted DB cluster snapshot to copy. The presigned URL request must + // contain the following parameter values: + // + // - DestinationRegion - The Amazon Web Services Region that the encrypted DB + // snapshot is copied to. This Amazon Web Services Region is the same one where the + // CopyDBSnapshot operation is called that contains this presigned URL. + // + // For example, if you copy an encrypted DB snapshot from the us-west-2 Amazon Web + // Services Region to the us-east-1 Amazon Web Services Region, then you call the + // CopyDBSnapshot operation in the us-east-1 Amazon Web Services Region and + // provide a presigned URL that contains a call to the CopyDBSnapshot operation + // in the us-west-2 Amazon Web Services Region. For this example, the + // DestinationRegion in the presigned URL must be set to the us-east-1 Amazon Web + // Services Region. + // + // - KmsKeyId - The KMS key identifier for the KMS key to use to encrypt the copy + // of the DB snapshot in the destination Amazon Web Services Region. This is the + // same identifier for both the CopyDBSnapshot operation that is called in the + // destination Amazon Web Services Region, and the operation contained in the + // presigned URL. + // + // - SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted + // snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) + // format for the source Amazon Web Services Region. For example, if you are + // copying an encrypted DB snapshot from the us-west-2 Amazon Web Services Region, + // then your SourceDBSnapshotIdentifier looks like the following example: + // arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115 . + // + // To learn how to generate a Signature Version 4 signed request, see [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)] and [Signature Version 4 Signing Process]. + // + // If you are using an Amazon Web Services SDK tool or the CLI, you can specify + // SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl + // manually. Specifying SourceRegion autogenerates a presigned URL that is a valid + // request for the operation that can run in the source Amazon Web Services Region. + // + // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + PreSignedUrl *string + + // The AWS region the resource is in. The presigned URL will be created with this + // region, if the PresignURL member is empty set. + SourceRegion *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The external custom Availability Zone (CAZ) identifier for the target CAZ. + // + // Example: rds-caz-aiqhTgQv . + TargetCustomAvailabilityZone *string + + // Used by the SDK's PresignURL autofill customization to specify the region the + // of the client's request. + destinationRegion *string + + noSmithyDocumentSerde +} + +type CopyDBSnapshotOutput struct { + + // Contains the details of an Amazon RDS DB snapshot. + // + // This data type is used as a response element in the DescribeDBSnapshots action. + DBSnapshot *types.DBSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyDBSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyDBSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCopyDBSnapshotPresignURLMiddleware(stack, options); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCopyDBSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func copyCopyDBSnapshotInputForPresign(params interface{}) (interface{}, error) { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return nil, fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func getCopyDBSnapshotPreSignedUrl(params interface{}) (string, bool, error) { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return ``, false, fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { + return ``, false, nil + } + return *input.PreSignedUrl, true, nil +} +func getCopyDBSnapshotSourceRegion(params interface{}) (string, bool, error) { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return ``, false, fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { + return ``, false, nil + } + return *input.SourceRegion, true, nil +} +func setCopyDBSnapshotPreSignedUrl(params interface{}, value string) error { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + input.PreSignedUrl = &value + return nil +} +func setCopyDBSnapshotdestinationRegion(params interface{}, value string) error { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + input.destinationRegion = &value + return nil +} +func addCopyDBSnapshotPresignURLMiddleware(stack *middleware.Stack, options Options) error { + return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ + Accessor: presignedurlcust.ParameterAccessor{ + GetPresignedURL: getCopyDBSnapshotPreSignedUrl, + + GetSourceRegion: getCopyDBSnapshotSourceRegion, + + CopyInput: copyCopyDBSnapshotInputForPresign, + + SetDestinationRegion: setCopyDBSnapshotdestinationRegion, + + SetPresignedURL: setCopyDBSnapshotPreSignedUrl, + }, + Presigner: &presignAutoFillCopyDBSnapshotClient{client: NewPresignClient(New(options))}, + }) +} + +type presignAutoFillCopyDBSnapshotClient struct { + client *PresignClient +} + +// PresignURL is a middleware accessor that satisfies URLPresigner interface. +func (c *presignAutoFillCopyDBSnapshotClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { + input, ok := params.(*CopyDBSnapshotInput) + if !ok { + return nil, fmt.Errorf("expect *CopyDBSnapshotInput type, got %T", params) + } + optFn := func(o *Options) { + o.Region = srcRegion + o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) + } + presignOptFn := WithPresignClientFromClientOptions(optFn) + return c.client.PresignCopyDBSnapshot(ctx, input, presignOptFn) +} + +func newServiceMetadataMiddleware_opCopyDBSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopyDBSnapshot", + } +} + +// PresignCopyDBSnapshot is used to generate a presigned HTTP Request which +// contains presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignCopyDBSnapshot(ctx context.Context, params *CopyDBSnapshotInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &CopyDBSnapshotInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "CopyDBSnapshot", params, clientOptFns, + c.client.addOperationCopyDBSnapshotMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyOptionGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyOptionGroup.go new file mode 100644 index 00000000..b7845d41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CopyOptionGroup.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Copies the specified option group. +func (c *Client) CopyOptionGroup(ctx context.Context, params *CopyOptionGroupInput, optFns ...func(*Options)) (*CopyOptionGroupOutput, error) { + if params == nil { + params = &CopyOptionGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyOptionGroup", params, optFns, c.addOperationCopyOptionGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyOptionGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyOptionGroupInput struct { + + // The identifier for the source option group. + // + // Constraints: + // + // - Must specify a valid option group. + // + // This member is required. + SourceOptionGroupIdentifier *string + + // The description for the copied option group. + // + // This member is required. + TargetOptionGroupDescription *string + + // The identifier for the copied option group. + // + // Constraints: + // + // - Can't be null, empty, or blank + // + // - Must contain from 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-option-group + // + // This member is required. + TargetOptionGroupIdentifier *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CopyOptionGroupOutput struct { + + // + OptionGroup *types.OptionGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyOptionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyOptionGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyOptionGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyOptionGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCopyOptionGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyOptionGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCopyOptionGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CopyOptionGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateBlueGreenDeployment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateBlueGreenDeployment.go new file mode 100644 index 00000000..8b8c8051 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateBlueGreenDeployment.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a blue/green deployment. +// +// A blue/green deployment creates a staging environment that copies the +// production environment. In a blue/green deployment, the blue environment is the +// current production environment. The green environment is the staging +// environment, and it stays in sync with the current production environment. +// +// You can make changes to the databases in the green environment without +// affecting production workloads. For example, you can upgrade the major or minor +// DB engine version, change database parameters, or make schema changes in the +// staging environment. You can thoroughly test changes in the green environment. +// When ready, you can switch over the environments to promote the green +// environment to be the new production environment. The switchover typically takes +// under a minute. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +func (c *Client) CreateBlueGreenDeployment(ctx context.Context, params *CreateBlueGreenDeploymentInput, optFns ...func(*Options)) (*CreateBlueGreenDeploymentOutput, error) { + if params == nil { + params = &CreateBlueGreenDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateBlueGreenDeployment", params, optFns, c.addOperationCreateBlueGreenDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateBlueGreenDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateBlueGreenDeploymentInput struct { + + // The name of the blue/green deployment. + // + // Constraints: + // + // - Can't be the same as an existing blue/green deployment name in the same + // account and Amazon Web Services Region. + // + // This member is required. + BlueGreenDeploymentName *string + + // The Amazon Resource Name (ARN) of the source production database. + // + // Specify the database that you want to clone. The blue/green deployment creates + // this database in the green environment. You can make updates to the database in + // the green environment, such as an engine version upgrade. When you are ready, + // you can switch the database in the green environment to be the production + // database. + // + // This member is required. + Source *string + + // Tags to assign to the blue/green deployment. + Tags []types.Tag + + // The amount of storage in gibibytes (GiB) to allocate for the green DB instance. + // You can choose to increase or decrease the allocated storage on the green DB + // instance. + // + // This setting doesn't apply to Amazon Aurora blue/green deployments. + TargetAllocatedStorage *int32 + + // The DB cluster parameter group associated with the Aurora DB cluster in the + // green environment. + // + // To test parameter changes, specify a DB cluster parameter group that is + // different from the one associated with the source DB cluster. + TargetDBClusterParameterGroupName *string + + // Specify the DB instance class for the databases in the green environment. + // + // This parameter only applies to RDS DB instances, because DB instances within an + // Aurora DB cluster can have multiple different instance classes. If you're + // creating a blue/green deployment from an Aurora DB cluster, don't specify this + // parameter. After the green environment is created, you can individually modify + // the instance classes of the DB instances within the green DB cluster. + TargetDBInstanceClass *string + + // The DB parameter group associated with the DB instance in the green environment. + // + // To test parameter changes, specify a DB parameter group that is different from + // the one associated with the source DB instance. + TargetDBParameterGroupName *string + + // The engine version of the database in the green environment. + // + // Specify the engine version to upgrade to in the green environment. + TargetEngineVersion *string + + // The amount of Provisioned IOPS (input/output operations per second) to allocate + // for the green DB instance. For information about valid IOPS values, see [Amazon RDS DB instance storage]in the + // Amazon RDS User Guide. + // + // This setting doesn't apply to Amazon Aurora blue/green deployments. + // + // [Amazon RDS DB instance storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html + TargetIops *int32 + + // The storage throughput value for the green DB instance. + // + // This setting applies only to the gp3 storage type. + // + // This setting doesn't apply to Amazon Aurora blue/green deployments. + TargetStorageThroughput *int32 + + // The storage type to associate with the green DB instance. + // + // Valid Values: gp2 | gp3 | io1 | io2 + // + // This setting doesn't apply to Amazon Aurora blue/green deployments. + TargetStorageType *string + + // Whether to upgrade the storage file system configuration on the green database. + // This option migrates the green DB instance from the older 32-bit file system to + // the preferred configuration. For more information, see [Upgrading the storage file system for a DB instance]. + // + // [Upgrading the storage file system for a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.UpgradeFileSystem + UpgradeTargetStorageConfig *bool + + noSmithyDocumentSerde +} + +type CreateBlueGreenDeploymentOutput struct { + + // Details about a blue/green deployment. + // + // For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon + // Aurora User Guide. + // + // [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html + BlueGreenDeployment *types.BlueGreenDeployment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateBlueGreenDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateBlueGreenDeployment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateBlueGreenDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBlueGreenDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateBlueGreenDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateBlueGreenDeployment", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateCustomDBEngineVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateCustomDBEngineVersion.go new file mode 100644 index 00000000..48745a66 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateCustomDBEngineVersion.go @@ -0,0 +1,409 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a custom DB engine version (CEV). +func (c *Client) CreateCustomDBEngineVersion(ctx context.Context, params *CreateCustomDBEngineVersionInput, optFns ...func(*Options)) (*CreateCustomDBEngineVersionOutput, error) { + if params == nil { + params = &CreateCustomDBEngineVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCustomDBEngineVersion", params, optFns, c.addOperationCreateCustomDBEngineVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCustomDBEngineVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateCustomDBEngineVersionInput struct { + + // The database engine. RDS Custom for Oracle supports the following values: + // + // - custom-oracle-ee + // + // - custom-oracle-ee-cdb + // + // - custom-oracle-se2 + // + // - custom-oracle-se2-cdb + // + // This member is required. + Engine *string + + // The name of your CEV. The name format is 19.customized_string. For example, a + // valid CEV name is 19.my_cev1 . This setting is required for RDS Custom for + // Oracle, but optional for Amazon RDS. The combination of Engine and EngineVersion + // is unique per customer per Region. + // + // This member is required. + EngineVersion *string + + // The name of an Amazon S3 bucket that contains database installation files for + // your CEV. For example, a valid bucket name is my-custom-installation-files . + DatabaseInstallationFilesS3BucketName *string + + // The Amazon S3 directory that contains the database installation files for your + // CEV. For example, a valid bucket name is 123456789012/cev1 . If this setting + // isn't specified, no prefix is assumed. + DatabaseInstallationFilesS3Prefix *string + + // An optional description of your CEV. + Description *string + + // The ID of the Amazon Machine Image (AMI). For RDS Custom for SQL Server, an AMI + // ID is required to create a CEV. For RDS Custom for Oracle, the default is the + // most recent AMI available, but you can specify an AMI ID that was used in a + // different Oracle CEV. Find the AMIs used by your CEVs by calling the [DescribeDBEngineVersions]operation. + // + // [DescribeDBEngineVersions]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBEngineVersions.html + ImageId *string + + // The Amazon Web Services KMS key identifier for an encrypted CEV. A symmetric + // encryption KMS key is required for RDS Custom, but optional for Amazon RDS. + // + // If you have an existing symmetric encryption KMS key in your account, you can + // use it with RDS Custom. No further action is necessary. If you don't already + // have a symmetric encryption KMS key in your account, follow the instructions in [Creating a symmetric encryption KMS key] + // in the Amazon Web Services Key Management Service Developer Guide. + // + // You can choose the same symmetric encryption key when you create a CEV and a DB + // instance, or choose different keys. + // + // [Creating a symmetric encryption KMS key]: https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html#create-symmetric-cmk + KMSKeyId *string + + // The CEV manifest, which is a JSON document that describes the installation .zip + // files stored in Amazon S3. Specify the name/value pairs in a file or a quoted + // string. RDS Custom applies the patches in the order in which they are listed. + // + // The following JSON fields are valid: + // + // MediaImportTemplateVersion Version of the CEV manifest. The date is in the + // format YYYY-MM-DD . + // + // databaseInstallationFileNames Ordered list of installation files for the CEV. + // + // opatchFileNames Ordered list of OPatch installers used for the Oracle DB engine. + // + // psuRuPatchFileNames The PSU and RU patches for this CEV. + // + // OtherPatchFileNames The patches that are not in the list of PSU and RU patches. + // Amazon RDS applies these patches after applying the PSU and RU patches. + // + // For more information, see [Creating the CEV manifest] in the Amazon RDS User Guide. + // + // [Creating the CEV manifest]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.html#custom-cev.preparing.manifest + Manifest *string + + // The ARN of a CEV to use as a source for creating a new CEV. You can specify a + // different Amazon Machine Imagine (AMI) by using either Source or + // UseAwsProvidedLatestImage . You can't specify a different JSON manifest when you + // specify SourceCustomDbEngineVersionIdentifier . + SourceCustomDbEngineVersionIdentifier *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // Specifies whether to use the latest service-provided Amazon Machine Image (AMI) + // for the CEV. If you specify UseAwsProvidedLatestImage , you can't also specify + // ImageId . + UseAwsProvidedLatestImage *bool + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the action +// DescribeDBEngineVersions . +type CreateCustomDBEngineVersionOutput struct { + + // The creation time of the DB engine version. + CreateTime *time.Time + + // JSON string that lists the installation files and parameters that RDS Custom + // uses to create a custom engine version (CEV). RDS Custom applies the patches in + // the order in which they're listed in the manifest. You can set the Oracle home, + // Oracle base, and UNIX/Linux user and group using the installation parameters. + // For more information, see [JSON fields in the CEV manifest]in the Amazon RDS User Guide. + // + // [JSON fields in the CEV manifest]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.preparing.html#custom-cev.preparing.manifest.fields + CustomDBEngineVersionManifest *string + + // The description of the database engine. + DBEngineDescription *string + + // A value that indicates the source media provider of the AMI based on the usage + // operation. Applicable for RDS Custom for SQL Server. + DBEngineMediaType *string + + // The ARN of the custom engine version. + DBEngineVersionArn *string + + // The description of the database engine version. + DBEngineVersionDescription *string + + // The name of the DB parameter group family for the database engine. + DBParameterGroupFamily *string + + // The name of the Amazon S3 bucket that contains your database installation files. + DatabaseInstallationFilesS3BucketName *string + + // The Amazon S3 directory that contains the database installation files. If not + // specified, then no prefix is assumed. + DatabaseInstallationFilesS3Prefix *string + + // The default character set for new instances of this engine version, if the + // CharacterSetName parameter of the CreateDBInstance API isn't specified. + DefaultCharacterSet *types.CharacterSet + + // The name of the database engine. + Engine *string + + // The version number of the database engine. + EngineVersion *string + + // The types of logs that the database engine has available for export to + // CloudWatch Logs. + ExportableLogTypes []string + + // The EC2 image + Image *types.CustomDBEngineVersionAMI + + // The Amazon Web Services KMS key identifier for an encrypted CEV. This parameter + // is required for RDS Custom, but optional for Amazon RDS. + KMSKeyId *string + + // The major engine version of the CEV. + MajorEngineVersion *string + + // Specifies any Aurora Serverless v2 properties or limits that differ between + // Aurora engine versions. You can test the values of this attribute when deciding + // which Aurora version to use in a new or upgraded DB cluster. You can also + // retrieve the version of an existing DB cluster and check whether that version + // supports certain Aurora Serverless v2 features before you attempt to use those + // features. + ServerlessV2FeaturesSupport *types.ServerlessV2FeaturesSupport + + // The status of the DB engine version, either available or deprecated . + Status *string + + // A list of the supported CA certificate identifiers. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + SupportedCACertificateIdentifiers []string + + // A list of the character sets supported by this engine for the CharacterSetName + // parameter of the CreateDBInstance operation. + SupportedCharacterSets []types.CharacterSet + + // A list of the supported DB engine modes. + SupportedEngineModes []string + + // A list of features supported by the DB engine. + // + // The supported features vary by DB engine and DB engine version. + // + // To determine the supported features for a specific DB engine and DB engine + // version using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine --engine-version + // + // For example, to determine the supported features for RDS for PostgreSQL version + // 13.3 using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine postgres --engine-version 13.3 + // + // The supported features are listed under SupportedFeatureNames in the output. + SupportedFeatureNames []string + + // A list of the character sets supported by the Oracle DB engine for the + // NcharCharacterSetName parameter of the CreateDBInstance operation. + SupportedNcharCharacterSets []types.CharacterSet + + // A list of the time zones supported by this engine for the Timezone parameter of + // the CreateDBInstance action. + SupportedTimezones []types.Timezone + + // Indicates whether the engine version supports Babelfish for Aurora PostgreSQL. + SupportsBabelfish *bool + + // Indicates whether the engine version supports rotating the server certificate + // without rebooting the DB instance. + SupportsCertificateRotationWithoutRestart *bool + + // Indicates whether you can use Aurora global databases with a specific DB engine + // version. + SupportsGlobalDatabases *bool + + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. + SupportsIntegrations *bool + + // Indicates whether the DB engine version supports Aurora Limitless Database. + SupportsLimitlessDatabase *bool + + // Indicates whether the DB engine version supports forwarding write operations + // from reader DB instances to the writer DB instance in the DB cluster. By + // default, write operations aren't allowed on reader DB instances. + // + // Valid for: Aurora DB clusters only + SupportsLocalWriteForwarding *bool + + // Indicates whether the engine version supports exporting the log types specified + // by ExportableLogTypes to CloudWatch Logs. + SupportsLogExportsToCloudwatchLogs *bool + + // Indicates whether you can use Aurora parallel query with a specific DB engine + // version. + SupportsParallelQuery *bool + + // Indicates whether the database engine version supports read replicas. + SupportsReadReplica *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // A list of engine versions that this database engine version can be upgraded to. + ValidUpgradeTarget []types.UpgradeTarget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCustomDBEngineVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCustomDBEngineVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateCustomDBEngineVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomDBEngineVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateCustomDBEngineVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateCustomDBEngineVersion", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBCluster.go new file mode 100644 index 00000000..4c29a25e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBCluster.go @@ -0,0 +1,1097 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new Amazon Aurora DB cluster or Multi-AZ DB cluster. +// +// If you create an Aurora DB cluster, the request creates an empty cluster. You +// must explicitly create the writer instance for your DB cluster using the [CreateDBInstance] +// operation. If you create a Multi-AZ DB cluster, the request creates a writer and +// two reader DB instances for you, each in a different Availability Zone. +// +// You can use the ReplicationSourceIdentifier parameter to create an Amazon +// Aurora DB cluster as a read replica of another DB cluster or Amazon RDS for +// MySQL or PostgreSQL DB instance. For more information about Amazon Aurora, see [What is Amazon Aurora?] +// in the Amazon Aurora User Guide. +// +// You can also use the ReplicationSourceIdentifier parameter to create a Multi-AZ +// DB cluster read replica with an RDS for MySQL or PostgreSQL DB instance as the +// source. For more information about Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments]in the Amazon RDS +// User Guide. +// +// [CreateDBInstance]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) CreateDBCluster(ctx context.Context, params *CreateDBClusterInput, optFns ...func(*Options)) (*CreateDBClusterOutput, error) { + if params == nil { + params = &CreateDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBCluster", params, optFns, c.addOperationCreateDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBClusterInput struct { + + // The identifier for this DB cluster. This parameter is stored as a lowercase + // string. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must contain from 1 to 63 (for Aurora DB clusters) or 1 to 52 (for Multi-AZ + // DB clusters) letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster1 + // + // This member is required. + DBClusterIdentifier *string + + // The database engine to use for this DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: + // + // - aurora-mysql + // + // - aurora-postgresql + // + // - mysql + // + // - postgres + // + // - neptune - For information about using Amazon Neptune, see the [Amazon Neptune User Guide]. + // + // [Amazon Neptune User Guide]: https://docs.aws.amazon.com/neptune/latest/userguide/intro.html + // + // This member is required. + Engine *string + + // The amount of storage in gibibytes (GiB) to allocate to each DB instance in the + // Multi-AZ DB cluster. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // This setting is required to create a Multi-AZ DB cluster. + AllocatedStorage *int32 + + // Specifies whether minor engine upgrades are applied automatically to the DB + // cluster during the maintenance window. By default, minor engine upgrades are + // applied automatically. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB cluster + AutoMinorVersionUpgrade *bool + + // A list of Availability Zones (AZs) where you specifically want to create DB + // instances in the DB cluster. + // + // For information on AZs, see [Availability Zones] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // Constraints: + // + // - Can't specify more than three AZs. + // + // [Availability Zones]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html#Concepts.RegionsAndAvailabilityZones.AvailabilityZones + AvailabilityZones []string + + // The target backtrack window, in seconds. To disable backtracking, set this + // value to 0 . + // + // Valid for Cluster Type: Aurora MySQL DB clusters only + // + // Default: 0 + // + // Constraints: + // + // - If specified, this value must be set to a number from 0 to 259,200 (72 + // hours). + BacktrackWindow *int64 + + // The number of days for which automated backups are retained. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Default: 1 + // + // Constraints: + // + // - Must be a value from 1 to 35. + BackupRetentionPeriod *int32 + + // The CA certificate identifier to use for the DB cluster's server certificate. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Multi-AZ DB clusters + // + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // The name of the character set ( CharacterSet ) to associate the DB cluster with. + // + // Valid for Cluster Type: Aurora DB clusters only + CharacterSetName *string + + // Specifies the scalability mode of the Aurora DB cluster. When set to limitless , + // the cluster operates as an Aurora Limitless Database. When set to standard (the + // default), the cluster uses normal DB instance creation. + // + // Valid for: Aurora DB clusters only + // + // You can't modify this setting after you create the DB cluster. + ClusterScalabilityType types.ClusterScalabilityType + + // Specifies whether to copy all tags from the DB cluster to snapshots of the DB + // cluster. The default is not to copy them. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + CopyTagsToSnapshot *bool + + // The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, + // for example db.m6gd.xlarge . Not all DB instance classes are available in all + // Amazon Web Services Regions, or for all database engines. + // + // For the full list of DB instance classes and availability for your engine, see [DB instance class] + // in the Amazon RDS User Guide. + // + // This setting is required to create a Multi-AZ DB cluster. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // [DB instance class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBClusterInstanceClass *string + + // The name of the DB cluster parameter group to associate with this DB cluster. + // If you don't specify a value, then the default DB cluster parameter group for + // the specified DB engine and version is used. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - If supplied, must match the name of an existing DB cluster parameter group. + DBClusterParameterGroupName *string + + // A DB subnet group to associate with this DB cluster. + // + // This setting is required to create a Multi-AZ DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must match the name of an existing DB subnet group. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // Reserved for future use. + DBSystemId *string + + // The mode of Database Insights to enable for the DB cluster. + // + // If you set this value to advanced , you must also set the + // PerformanceInsightsEnabled parameter to true and the + // PerformanceInsightsRetentionPeriod parameter to 465. + // + // Valid for Cluster Type: Aurora DB clusters only + DatabaseInsightsMode types.DatabaseInsightsMode + + // The name for your database of up to 64 alphanumeric characters. A database + // named postgres is always created. If this parameter is specified, an additional + // database with this name is created. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + DatabaseName *string + + // Specifies whether the DB cluster has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + DeletionProtection *bool + + // The Active Directory directory ID to create the DB cluster in. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos authentication to + // authenticate users that connect to the DB cluster. + // + // For more information, see [Kerberos authentication] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Kerberos authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html + Domain *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // Valid for Cluster Type: Aurora DB clusters only + DomainIAMRoleName *string + + // The list of log types that need to be enabled for exporting to CloudWatch Logs. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // The following values are valid for each DB engine: + // + // - Aurora MySQL - audit | error | general | slowquery + // + // - Aurora PostgreSQL - postgresql + // + // - RDS for MySQL - error | general | slowquery + // + // - RDS for PostgreSQL - postgresql | upgrade + // + // For more information about exporting CloudWatch Logs for Amazon RDS, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon RDS User Guide. + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable this DB cluster to forward write operations to the + // primary cluster of a global cluster (Aurora global database). By default, write + // operations are not allowed on Aurora DB clusters that are secondary clusters in + // an Aurora global database. + // + // You can set this value only on Aurora DB clusters that are members of an Aurora + // global database. With this parameter enabled, a secondary cluster can forward + // writes to the current primary cluster, and the resulting changes are replicated + // back to this cluster. For the primary DB cluster of an Aurora global database, + // this value is used immediately if the primary is demoted by a global cluster API + // operation, but it does nothing until then. + // + // Valid for Cluster Type: Aurora DB clusters only + EnableGlobalWriteForwarding *bool + + // Specifies whether to enable the HTTP endpoint for the DB cluster. By default, + // the HTTP endpoint isn't enabled. + // + // When enabled, the HTTP endpoint provides a connectionless web service API (RDS + // Data API) for running SQL queries on the DB cluster. You can also query your + // database from inside the RDS console with the RDS query editor. + // + // RDS Data API is supported with the following DB clusters: + // + // - Aurora PostgreSQL Serverless v2 and provisioned + // + // - Aurora PostgreSQL and Aurora MySQL Serverless v1 + // + // For more information, see [Using RDS Data API] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Using RDS Data API]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html + EnableHttpEndpoint *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication] in the Amazon Aurora User Guide or [IAM database authentication for MariaDB, MySQL, and PostgreSQL] in the Amazon + // RDS User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [IAM Database Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html + // [IAM database authentication for MariaDB, MySQL, and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Aurora Limitless Database. You must enable Aurora + // Limitless Database to create a DB shard group. + // + // Valid for: Aurora DB clusters only + // + // This setting is no longer used. Instead use the ClusterScalabilityType setting. + EnableLimitlessDatabase *bool + + // Specifies whether read replicas can forward write operations to the writer DB + // instance in the DB cluster. By default, write operations aren't allowed on + // reader DB instances. + // + // Valid for: Aurora DB clusters only + EnableLocalWriteForwarding *bool + + // Specifies whether to turn on Performance Insights for the DB cluster. + // + // For more information, see [Using Amazon Performance Insights] in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The life cycle type for this DB cluster. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard + // support, you can avoid charges for Extended Support by setting the value to + // open-source-rds-extended-support-disabled . In this case, creating the DB + // cluster will fail if the DB major version is past its end of standard support + // date. + // + // You can use this setting to enroll your DB cluster into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB cluster past the end of standard support for that engine + // version. For more information, see the following sections: + // + // - Amazon Aurora - [Using Amazon RDS Extended Support]in the Amazon Aurora User Guide + // + // - Amazon RDS - [Using Amazon RDS Extended Support]in the Amazon RDS User Guide + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The DB engine mode of the DB cluster, either provisioned or serverless . + // + // The serverless engine mode only applies for Aurora Serverless v1 DB clusters. + // Aurora Serverless v2 DB clusters use the provisioned engine mode. + // + // For information about limitations and requirements for Serverless DB clusters, + // see the following sections in the Amazon Aurora User Guide: + // + // [Limitations of Aurora Serverless v1] + // + // [Requirements for Aurora Serverless v2] + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Limitations of Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations + // [Requirements for Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.requirements.html + EngineMode *string + + // The version number of the database engine to use. + // + // To list all of the available engine versions for Aurora MySQL version 2 + // (5.7-compatible) and version 3 (MySQL 8.0-compatible), use the following + // command: + // + // aws rds describe-db-engine-versions --engine aurora-mysql --query + // "DBEngineVersions[].EngineVersion" + // + // You can supply either 5.7 or 8.0 to use the default engine version for Aurora + // MySQL version 2 or version 3, respectively. + // + // To list all of the available engine versions for Aurora PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine aurora-postgresql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for MySQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine mysql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine postgres --query + // "DBEngineVersions[].EngineVersion" + // + // For information about a specific engine, see the following topics: + // + // - Aurora MySQL - see [Database engine updates for Amazon Aurora MySQL]in the Amazon Aurora User Guide. + // + // - Aurora PostgreSQL - see [Amazon Aurora PostgreSQL releases and engine versions]in the Amazon Aurora User Guide. + // + // - RDS for MySQL - see [Amazon RDS for MySQL]in the Amazon RDS User Guide. + // + // - RDS for PostgreSQL - see [Amazon RDS for PostgreSQL]in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [Database engine updates for Amazon Aurora MySQL]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html + // [Amazon RDS for PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts + // [Amazon RDS for MySQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt + // [Amazon Aurora PostgreSQL releases and engine versions]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.20180305.html + EngineVersion *string + + // The global cluster ID of an Aurora cluster that becomes the primary cluster in + // the new global database cluster. + // + // Valid for Cluster Type: Aurora DB clusters only + GlobalClusterIdentifier *string + + // The amount of Provisioned IOPS (input/output operations per second) to be + // initially allocated for each DB instance in the Multi-AZ DB cluster. + // + // For information about valid IOPS values, see [Provisioned IOPS storage] in the Amazon RDS User Guide. + // + // This setting is required to create a Multi-AZ DB cluster. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // Constraints: + // + // - Must be a multiple between .5 and 50 of the storage amount for the DB + // cluster. + // + // [Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // The Amazon Web Services KMS key identifier for an encrypted DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // When a KMS key isn't specified in KmsKeyId : + // + // - If ReplicationSourceIdentifier identifies an encrypted source, then Amazon + // RDS uses the KMS key used to encrypt the source. Otherwise, Amazon RDS uses your + // default KMS key. + // + // - If the StorageEncrypted parameter is enabled and ReplicationSourceIdentifier + // isn't specified, then Amazon RDS uses your default KMS key. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + // + // If you create a read replica of an encrypted DB cluster in another Amazon Web + // Services Region, make sure to set KmsKeyId to a KMS key identifier that is + // valid in the destination Amazon Web Services Region. This KMS key is used to + // encrypt the read replica in that Amazon Web Services Region. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + KmsKeyId *string + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon + // Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Can't manage the master user password with Amazon Web Services Secrets + // Manager if MasterUserPassword is specified. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The password for the master database user. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must contain from 8 to 41 characters. + // + // - Can contain any printable ASCII character except "/", """, or "@". + // + // - Can't be specified if ManageMasterUserPassword is turned on. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If you don't specify MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS + // key is used to encrypt the secret. If the secret is in a different Amazon Web + // Services account, then you can't use the aws/secretsmanager KMS key to encrypt + // the secret, and you must use a customer managed KMS key. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + MasterUserSecretKmsKeyId *string + + // The name of the master user for the DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must be 1 to 16 letters or numbers. + // + // - First character must be a letter. + // + // - Can't be a reserved word for the chosen database engine. + MasterUsername *string + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB cluster. To turn off collecting Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, also set MonitoringInterval to a value other + // than 0 . + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + // Enhanced Monitoring metrics to Amazon CloudWatch Logs. An example is + // arn:aws:iam:123456789012:role/emaccess . For information on creating a + // monitoring role, see [Setting up and enabling Enhanced Monitoring]in the Amazon RDS User Guide. + // + // If MonitoringInterval is set to a value other than 0 , supply a + // MonitoringRoleArn value. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [Setting up and enabling Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS.Enabling + MonitoringRoleArn *string + + // The network type of the DB cluster. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The option group to associate the DB cluster with. + // + // DB clusters are associated with a default option group that can't be modified. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // issues an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the instances in the DB cluster accept connections. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: 1150-65535 + // + // Default: + // + // - RDS for MySQL and Aurora MySQL - 3306 + // + // - RDS for PostgreSQL and Aurora PostgreSQL - 5432 + Port *int32 + + // When you are replicating a DB cluster from one Amazon Web Services GovCloud + // (US) Region to another, an URL that contains a Signature Version 4 signed + // request for the CreateDBCluster operation to be called in the source Amazon Web + // Services Region where the DB cluster is replicated from. Specify PreSignedUrl + // only when you are performing cross-Region replication from an encrypted DB + // cluster. + // + // The presigned URL must be a valid request for the CreateDBCluster API operation + // that can run in the source Amazon Web Services Region that contains the + // encrypted DB cluster to copy. + // + // The presigned URL request must contain the following parameter values: + // + // - KmsKeyId - The KMS key identifier for the KMS key to use to encrypt the copy + // of the DB cluster in the destination Amazon Web Services Region. This should + // refer to the same KMS key for both the CreateDBCluster operation that is + // called in the destination Amazon Web Services Region, and the operation + // contained in the presigned URL. + // + // - DestinationRegion - The name of the Amazon Web Services Region that Aurora + // read replica will be created in. + // + // - ReplicationSourceIdentifier - The DB cluster identifier for the encrypted DB + // cluster to be copied. This identifier must be in the Amazon Resource Name (ARN) + // format for the source Amazon Web Services Region. For example, if you are + // copying an encrypted DB cluster from the us-west-2 Amazon Web Services Region, + // then your ReplicationSourceIdentifier would look like Example: + // arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1 . + // + // To learn how to generate a Signature Version 4 signed request, see [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)] and [Signature Version 4 Signing Process]. + // + // If you are using an Amazon Web Services SDK tool or the CLI, you can specify + // SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl + // manually. Specifying SourceRegion autogenerates a presigned URL that is a valid + // request for the operation that can run in the source Amazon Web Services Region. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + PreSignedUrl *string + + // The daily time range during which automated backups are created if automated + // backups are enabled using the BackupRetentionPeriod parameter. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region. To view the time blocks available, see + // [Backup window]in the Amazon Aurora User Guide. + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.Backups.BackupWindow + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region, occurring on a random day of the week. + // To see the time blocks available, see [Adjusting the Preferred DB Cluster Maintenance Window]in the Amazon Aurora User Guide. + // + // Constraints: + // + // - Must be in the format ddd:hh24:mi-ddd:hh24:mi . + // + // - Days must be one of Mon | Tue | Wed | Thu | Fri | Sat | Sun . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must be at least 30 minutes. + // + // [Adjusting the Preferred DB Cluster Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora + PreferredMaintenanceWindow *string + + // Specifies whether the DB cluster is publicly accessible. + // + // When the DB cluster is publicly accessible and you connect from outside of the + // DB cluster's virtual private cloud (VPC), its Domain Name System (DNS) endpoint + // resolves to the public IP address. When you connect from within the same VPC as + // the DB cluster, the endpoint resolves to the private IP address. Access to the + // DB cluster is ultimately controlled by the security group it uses. That public + // access isn't permitted if the security group assigned to the DB cluster doesn't + // permit it. + // + // When the DB cluster isn't publicly accessible, it is an internal DB cluster + // with a DNS name that resolves to a private IP address. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // Default: The default behavior varies depending on whether DBSubnetGroupName is + // specified. + // + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, + // the following applies: + // + // - If the default VPC in the target Region doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the default VPC in the target Region has an internet gateway attached to + // it, the DB cluster is public. + // + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the + // following applies: + // + // - If the subnets are part of a VPC that doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the subnets are part of a VPC that has an internet gateway attached to + // it, the DB cluster is public. + PubliclyAccessible *bool + + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + + // The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this + // DB cluster is created as a read replica. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + ReplicationSourceIdentifier *string + + // For DB clusters in serverless DB engine mode, the scaling properties of the DB + // cluster. + // + // Valid for Cluster Type: Aurora DB clusters only + ScalingConfiguration *types.ScalingConfiguration + + // Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration + + // The AWS region the resource is in. The presigned URL will be created with this + // region, if the PresignURL member is empty set. + SourceRegion *string + + // Specifies whether the DB cluster is encrypted. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + StorageEncrypted *bool + + // The storage type to associate with the DB cluster. + // + // For information on storage types for Aurora DB clusters, see [Storage configurations for Amazon Aurora DB clusters]. For information + // on storage types for Multi-AZ DB clusters, see [Settings for creating Multi-AZ DB clusters]. + // + // This setting is required to create a Multi-AZ DB cluster. + // + // When specified for a Multi-AZ DB cluster, a value for the Iops parameter is + // required. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: + // + // - Aurora DB clusters - aurora | aurora-iopt1 + // + // - Multi-AZ DB clusters - io1 | io2 | gp3 + // + // Default: + // + // - Aurora DB clusters - aurora + // + // - Multi-AZ DB clusters - io1 + // + // When you create an Aurora DB cluster with the storage type set to aurora-iopt1 , + // the storage type is returned in the response. The storage type isn't returned + // when you set it to aurora . + // + // [Storage configurations for Amazon Aurora DB clusters]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Overview.StorageReliability.html#aurora-storage-type + // [Settings for creating Multi-AZ DB clusters]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/create-multi-az-db-cluster.html#create-multi-az-db-cluster-settings + StorageType *string + + // Tags to assign to the DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + Tags []types.Tag + + // A list of EC2 VPC security groups to associate with this DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + VpcSecurityGroupIds []string + + // Used by the SDK's PresignURL autofill customization to specify the region the + // of the client's request. + destinationRegion *string + + noSmithyDocumentSerde +} + +type CreateDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateDBClusterPresignURLMiddleware(stack, options); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func copyCreateDBClusterInputForPresign(params interface{}) (interface{}, error) { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return nil, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func getCreateDBClusterPreSignedUrl(params interface{}) (string, bool, error) { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return ``, false, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { + return ``, false, nil + } + return *input.PreSignedUrl, true, nil +} +func getCreateDBClusterSourceRegion(params interface{}) (string, bool, error) { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return ``, false, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { + return ``, false, nil + } + return *input.SourceRegion, true, nil +} +func setCreateDBClusterPreSignedUrl(params interface{}, value string) error { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + input.PreSignedUrl = &value + return nil +} +func setCreateDBClusterdestinationRegion(params interface{}, value string) error { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + input.destinationRegion = &value + return nil +} +func addCreateDBClusterPresignURLMiddleware(stack *middleware.Stack, options Options) error { + return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ + Accessor: presignedurlcust.ParameterAccessor{ + GetPresignedURL: getCreateDBClusterPreSignedUrl, + + GetSourceRegion: getCreateDBClusterSourceRegion, + + CopyInput: copyCreateDBClusterInputForPresign, + + SetDestinationRegion: setCreateDBClusterdestinationRegion, + + SetPresignedURL: setCreateDBClusterPreSignedUrl, + }, + Presigner: &presignAutoFillCreateDBClusterClient{client: NewPresignClient(New(options))}, + }) +} + +type presignAutoFillCreateDBClusterClient struct { + client *PresignClient +} + +// PresignURL is a middleware accessor that satisfies URLPresigner interface. +func (c *presignAutoFillCreateDBClusterClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { + input, ok := params.(*CreateDBClusterInput) + if !ok { + return nil, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) + } + optFn := func(o *Options) { + o.Region = srcRegion + o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) + } + presignOptFn := WithPresignClientFromClientOptions(optFn) + return c.client.PresignCreateDBCluster(ctx, input, presignOptFn) +} + +func newServiceMetadataMiddleware_opCreateDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBCluster", + } +} + +// PresignCreateDBCluster is used to generate a presigned HTTP Request which +// contains presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignCreateDBCluster(ctx context.Context, params *CreateDBClusterInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &CreateDBClusterInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "CreateDBCluster", params, clientOptFns, + c.client.addOperationCreateDBClusterMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterEndpoint.go new file mode 100644 index 00000000..e67221b6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterEndpoint.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new custom endpoint and associates it with an Amazon Aurora DB +// cluster. +// +// This action applies only to Aurora DB clusters. +func (c *Client) CreateDBClusterEndpoint(ctx context.Context, params *CreateDBClusterEndpointInput, optFns ...func(*Options)) (*CreateDBClusterEndpointOutput, error) { + if params == nil { + params = &CreateDBClusterEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterEndpoint", params, optFns, c.addOperationCreateDBClusterEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBClusterEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBClusterEndpointInput struct { + + // The identifier to use for the new endpoint. This parameter is stored as a + // lowercase string. + // + // This member is required. + DBClusterEndpointIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + // + // This member is required. + DBClusterIdentifier *string + + // The type of the endpoint, one of: READER , WRITER , ANY . + // + // This member is required. + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. This + // parameter is relevant only if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + // The tags to be assigned to the Amazon RDS resource. + Tags []types.Tag + + noSmithyDocumentSerde +} + +// This data type represents the information you need to connect to an Amazon +// Aurora DB cluster. This data type is used as a response element in the following +// actions: +// +// - CreateDBClusterEndpoint +// +// - DescribeDBClusterEndpoints +// +// - ModifyDBClusterEndpoint +// +// - DeleteDBClusterEndpoint +// +// For the data structure that represents Amazon RDS DB instance endpoints, see +// Endpoint . +type CreateDBClusterEndpointOutput struct { + + // The type associated with a custom endpoint. One of: READER , WRITER , ANY . + CustomEndpointType *string + + // The Amazon Resource Name (ARN) for the endpoint. + DBClusterEndpointArn *string + + // The identifier associated with the endpoint. This parameter is stored as a + // lowercase string. + DBClusterEndpointIdentifier *string + + // A unique system-generated identifier for an endpoint. It remains the same for + // the whole life of the endpoint. + DBClusterEndpointResourceIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + DBClusterIdentifier *string + + // The DNS address of the endpoint. + Endpoint *string + + // The type of the endpoint. One of: READER , WRITER , CUSTOM . + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. Only + // relevant if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + // The current status of the endpoint. One of: creating , available , deleting , + // inactive , modifying . The inactive state applies to an endpoint that can't be + // used for a certain kind of cluster, such as a writer endpoint for a read-only + // secondary cluster in a global database. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBClusterEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBClusterEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBClusterEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBClusterEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBClusterEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterParameterGroup.go new file mode 100644 index 00000000..0b5f7f8f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterParameterGroup.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB cluster parameter group. +// +// Parameters in a DB cluster parameter group apply to all of the instances in a +// DB cluster. +// +// A DB cluster parameter group is initially created with the default parameters +// for the database engine used by instances in the DB cluster. To provide custom +// values for any of the parameters, you must modify the group after creating it +// using ModifyDBClusterParameterGroup . Once you've created a DB cluster parameter +// group, you need to associate it with your DB cluster using ModifyDBCluster . +// +// When you associate a new DB cluster parameter group with a running Aurora DB +// cluster, reboot the DB instances in the DB cluster without failover for the new +// DB cluster parameter group and associated settings to take effect. +// +// When you associate a new DB cluster parameter group with a running Multi-AZ DB +// cluster, reboot the DB cluster without failover for the new DB cluster parameter +// group and associated settings to take effect. +// +// After you create a DB cluster parameter group, you should wait at least 5 +// minutes before creating your first DB cluster that uses that DB cluster +// parameter group as the default parameter group. This allows Amazon RDS to fully +// complete the create action before the DB cluster parameter group is used as the +// default for a new DB cluster. This is especially important for parameters that +// are critical when creating the default database for a DB cluster, such as the +// character set for the default database defined by the character_set_database +// parameter. You can use the Parameter Groups option of the [Amazon RDS console]or the +// DescribeDBClusterParameters operation to verify that your DB cluster parameter +// group has been created or modified. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [Amazon RDS console]: https://console.aws.amazon.com/rds/ +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) CreateDBClusterParameterGroup(ctx context.Context, params *CreateDBClusterParameterGroupInput, optFns ...func(*Options)) (*CreateDBClusterParameterGroupOutput, error) { + if params == nil { + params = &CreateDBClusterParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterParameterGroup", params, optFns, c.addOperationCreateDBClusterParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBClusterParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBClusterParameterGroupInput struct { + + // The name of the DB cluster parameter group. + // + // Constraints: + // + // - Must not match the name of an existing DB cluster parameter group. + // + // This value is stored as a lowercase string. + // + // This member is required. + DBClusterParameterGroupName *string + + // The DB cluster parameter group family name. A DB cluster parameter group can be + // associated with one and only one DB cluster parameter group family, and can be + // applied only to a DB cluster running a database engine and engine version + // compatible with that DB cluster parameter group family. + // + // Aurora MySQL + // + // Example: aurora-mysql5.7 , aurora-mysql8.0 + // + // Aurora PostgreSQL + // + // Example: aurora-postgresql14 + // + // RDS for MySQL + // + // Example: mysql8.0 + // + // RDS for PostgreSQL + // + // Example: postgres13 + // + // To list all of the available parameter group families for a DB engine, use the + // following command: + // + // aws rds describe-db-engine-versions --query + // "DBEngineVersions[].DBParameterGroupFamily" --engine + // + // For example, to list all of the available parameter group families for the + // Aurora PostgreSQL DB engine, use the following command: + // + // aws rds describe-db-engine-versions --query + // "DBEngineVersions[].DBParameterGroupFamily" --engine aurora-postgresql + // + // The output contains duplicates. + // + // The following are the valid DB engine values: + // + // - aurora-mysql + // + // - aurora-postgresql + // + // - mysql + // + // - postgres + // + // This member is required. + DBParameterGroupFamily *string + + // The description for the DB cluster parameter group. + // + // This member is required. + Description *string + + // Tags to assign to the DB cluster parameter group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBClusterParameterGroupOutput struct { + + // Contains the details of an Amazon RDS DB cluster parameter group. + // + // This data type is used as a response element in the + // DescribeDBClusterParameterGroups action. + DBClusterParameterGroup *types.DBClusterParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBClusterParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBClusterParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBClusterParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterSnapshot.go new file mode 100644 index 00000000..b477d203 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBClusterSnapshot.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a snapshot of a DB cluster. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) CreateDBClusterSnapshot(ctx context.Context, params *CreateDBClusterSnapshotInput, optFns ...func(*Options)) (*CreateDBClusterSnapshotOutput, error) { + if params == nil { + params = &CreateDBClusterSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterSnapshot", params, optFns, c.addOperationCreateDBClusterSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBClusterSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBClusterSnapshotInput struct { + + // The identifier of the DB cluster to create a snapshot for. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing DBCluster. + // + // Example: my-cluster1 + // + // This member is required. + DBClusterIdentifier *string + + // The identifier of the DB cluster snapshot. This parameter is stored as a + // lowercase string. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster1-snapshot1 + // + // This member is required. + DBClusterSnapshotIdentifier *string + + // The tags to be assigned to the DB cluster snapshot. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBClusterSnapshotOutput struct { + + // Contains the details for an Amazon RDS DB cluster snapshot + // + // This data type is used as a response element in the DescribeDBClusterSnapshots + // action. + DBClusterSnapshot *types.DBClusterSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBClusterSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBClusterSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBClusterSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstance.go new file mode 100644 index 00000000..41303c87 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstance.go @@ -0,0 +1,1281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB instance. +// +// The new DB instance can be an RDS DB instance, or it can be a DB instance in an +// Aurora DB cluster. For an Aurora DB cluster, you can call this operation +// multiple times to add more than one DB instance to the cluster. +// +// For more information about creating an RDS DB instance, see [Creating an Amazon RDS DB instance] in the Amazon RDS +// User Guide. +// +// For more information about creating a DB instance in an Aurora DB cluster, see [Creating an Amazon Aurora DB cluster] +// in the Amazon Aurora User Guide. +// +// [Creating an Amazon Aurora DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.CreateInstance.html +// [Creating an Amazon RDS DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html +func (c *Client) CreateDBInstance(ctx context.Context, params *CreateDBInstanceInput, optFns ...func(*Options)) (*CreateDBInstanceOutput, error) { + if params == nil { + params = &CreateDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBInstance", params, optFns, c.addOperationCreateDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBInstanceInput struct { + + // The compute and memory capacity of the DB instance, for example db.m5.large . + // Not all DB instance classes are available in all Amazon Web Services Regions, or + // for all database engines. For the full list of DB instance classes, and + // availability for your engine, see [DB instance classes]in the Amazon RDS User Guide or [Aurora DB instance classes] in the + // Amazon Aurora User Guide. + // + // [Aurora DB instance classes]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html + // [DB instance classes]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + // + // This member is required. + DBInstanceClass *string + + // The identifier for this DB instance. This parameter is stored as a lowercase + // string. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: mydbinstance + // + // This member is required. + DBInstanceIdentifier *string + + // The database engine to use for this DB instance. + // + // Not every database engine is available in every Amazon Web Services Region. + // + // Valid Values: + // + // - aurora-mysql (for Aurora MySQL DB instances) + // + // - aurora-postgresql (for Aurora PostgreSQL DB instances) + // + // - custom-oracle-ee (for RDS Custom for Oracle DB instances) + // + // - custom-oracle-ee-cdb (for RDS Custom for Oracle DB instances) + // + // - custom-oracle-se2 (for RDS Custom for Oracle DB instances) + // + // - custom-oracle-se2-cdb (for RDS Custom for Oracle DB instances) + // + // - custom-sqlserver-ee (for RDS Custom for SQL Server DB instances) + // + // - custom-sqlserver-se (for RDS Custom for SQL Server DB instances) + // + // - custom-sqlserver-web (for RDS Custom for SQL Server DB instances) + // + // - custom-sqlserver-dev (for RDS Custom for SQL Server DB instances) + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // This member is required. + Engine *string + + // The amount of storage in gibibytes (GiB) to allocate for the DB instance. + // + // This setting doesn't apply to Amazon Aurora DB instances. Aurora cluster + // volumes automatically grow as the amount of data in your database increases, + // though you are only charged for the space that you use in an Aurora cluster + // volume. + // + // Amazon RDS Custom Constraints to the amount of storage for each storage type + // are the following: + // + // - General Purpose (SSD) storage (gp2, gp3): Must be an integer from 40 to + // 65536 for RDS Custom for Oracle, 16384 for RDS Custom for SQL Server. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 40 to 65536 + // for RDS Custom for Oracle, 16384 for RDS Custom for SQL Server. + // + // RDS for Db2 Constraints to the amount of storage for each storage type are the + // following: + // + // - General Purpose (SSD) storage (gp3): Must be an integer from 20 to 65536. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 100 to 65536. + // + // RDS for MariaDB Constraints to the amount of storage for each storage type are + // the following: + // + // - General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to + // 65536. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 100 to 65536. + // + // - Magnetic storage (standard): Must be an integer from 5 to 3072. + // + // RDS for MySQL Constraints to the amount of storage for each storage type are + // the following: + // + // - General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to + // 65536. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 100 to 65536. + // + // - Magnetic storage (standard): Must be an integer from 5 to 3072. + // + // RDS for Oracle Constraints to the amount of storage for each storage type are + // the following: + // + // - General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to + // 65536. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 100 to 65536. + // + // - Magnetic storage (standard): Must be an integer from 10 to 3072. + // + // RDS for PostgreSQL Constraints to the amount of storage for each storage type + // are the following: + // + // - General Purpose (SSD) storage (gp2, gp3): Must be an integer from 20 to + // 65536. + // + // - Provisioned IOPS storage (io1, io2): Must be an integer from 100 to 65536. + // + // - Magnetic storage (standard): Must be an integer from 5 to 3072. + // + // RDS for SQL Server Constraints to the amount of storage for each storage type + // are the following: + // + // - General Purpose (SSD) storage (gp2, gp3): + // + // - Enterprise and Standard editions: Must be an integer from 20 to 16384. + // + // - Web and Express editions: Must be an integer from 20 to 16384. + // + // - Provisioned IOPS storage (io1, io2): + // + // - Enterprise and Standard editions: Must be an integer from 100 to 16384. + // + // - Web and Express editions: Must be an integer from 100 to 16384. + // + // - Magnetic storage (standard): + // + // - Enterprise and Standard editions: Must be an integer from 20 to 1024. + // + // - Web and Express editions: Must be an integer from 20 to 1024. + AllocatedStorage *int32 + + // Specifies whether minor engine upgrades are applied automatically to the DB + // instance during the maintenance window. By default, minor engine upgrades are + // applied automatically. + // + // If you create an RDS Custom DB instance, you must set AutoMinorVersionUpgrade + // to false . + AutoMinorVersionUpgrade *bool + + // The Availability Zone (AZ) where the database will be created. For information + // on Amazon Web Services Regions and Availability Zones, see [Regions and Availability Zones]. + // + // For Amazon Aurora, each Aurora DB cluster hosts copies of its storage in three + // separate Availability Zones. Specify one of these Availability Zones. Aurora + // automatically chooses an appropriate Availability Zone if you don't specify one. + // + // Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web + // Services Region. + // + // Constraints: + // + // - The AvailabilityZone parameter can't be specified if the DB instance is a + // Multi-AZ deployment. + // + // - The specified Availability Zone must be in the same Amazon Web Services + // Region as the current endpoint. + // + // Example: us-east-1d + // + // [Regions and Availability Zones]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html + AvailabilityZone *string + + // The number of days for which automated backups are retained. Setting this + // parameter to a positive number enables backups. Setting this parameter to 0 + // disables automated backups. + // + // This setting doesn't apply to Amazon Aurora DB instances. The retention period + // for automated backups is managed by the DB cluster. + // + // Default: 1 + // + // Constraints: + // + // - Must be a value from 0 to 35. + // + // - Can't be set to 0 if the DB instance is a source to read replicas. + // + // - Can't be set to 0 for an RDS Custom for Oracle DB instance. + BackupRetentionPeriod *int32 + + // The location for storing automated backups and manual snapshots. + // + // Valid Values: + // + // - outposts (Amazon Web Services Outposts) + // + // - region (Amazon Web Services Region) + // + // Default: region + // + // For more information, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + BackupTarget *string + + // The CA certificate identifier to use for the DB instance's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // For supported engines, the character set ( CharacterSet ) to associate the DB + // instance with. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora - The character set is managed by the DB cluster. For more + // information, see CreateDBCluster . + // + // - RDS Custom - However, if you need to change the character set, you can + // change it on the database itself. + CharacterSetName *string + + // Specifies whether to copy tags from the DB instance to snapshots of the DB + // instance. By default, tags are not copied. + // + // This setting doesn't apply to Amazon Aurora DB instances. Copying tags to + // snapshots is managed by the DB cluster. Setting this value for an Aurora DB + // instance has no effect on the DB cluster setting. + CopyTagsToSnapshot *bool + + // The instance profile associated with the underlying Amazon EC2 instance of an + // RDS Custom DB instance. + // + // This setting is required for RDS Custom. + // + // Constraints: + // + // - The profile must exist in your account. + // + // - The profile must have an IAM role that Amazon EC2 has permissions to assume. + // + // - The instance profile name and the associated IAM role name must start with + // the prefix AWSRDSCustom . + // + // For the list of permissions required for the IAM role, see [Configure IAM and your VPC] in the Amazon RDS + // User Guide. + // + // [Configure IAM and your VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc + CustomIamInstanceProfile *string + + // The identifier of the DB cluster that this DB instance will belong to. + // + // This setting doesn't apply to RDS Custom DB instances. + DBClusterIdentifier *string + + // The meaning of this parameter differs according to the database engine you use. + // + // Amazon Aurora MySQL The name of the database to create when the primary DB + // instance of the Aurora MySQL DB cluster is created. If this parameter isn't + // specified for an Aurora MySQL DB cluster, no database is created in the DB + // cluster. + // + // Constraints: + // + // - Must contain 1 to 64 alphanumeric characters. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0-9). + // + // - Can't be a word reserved by the database engine. + // + // Amazon Aurora PostgreSQL The name of the database to create when the primary DB + // instance of the Aurora PostgreSQL DB cluster is created. A database named + // postgres is always created. If this parameter is specified, an additional + // database with this name is created. + // + // Constraints: + // + // - It must contain 1 to 63 alphanumeric characters. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0 to 9). + // + // - Can't be a word reserved by the database engine. + // + // Amazon RDS Custom for Oracle The Oracle System ID (SID) of the created RDS + // Custom DB instance. If you don't specify a value, the default value is ORCL for + // non-CDBs and RDSCDB for CDBs. + // + // Default: ORCL + // + // Constraints: + // + // - Must contain 1 to 8 alphanumeric characters. + // + // - Must contain a letter. + // + // - Can't be a word reserved by the database engine. + // + // Amazon RDS Custom for SQL Server Not applicable. Must be null. + // + // RDS for Db2 The name of the database to create when the DB instance is created. + // If this parameter isn't specified, no database is created in the DB instance. In + // some cases, we recommend that you don't add a database name. For more + // information, see [Additional considerations]in the Amazon RDS User Guide. + // + // Constraints: + // + // - Must contain 1 to 64 letters or numbers. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0-9). + // + // - Can't be a word reserved by the specified database engine. + // + // RDS for MariaDB The name of the database to create when the DB instance is + // created. If this parameter isn't specified, no database is created in the DB + // instance. + // + // Constraints: + // + // - Must contain 1 to 64 letters or numbers. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0-9). + // + // - Can't be a word reserved by the specified database engine. + // + // RDS for MySQL The name of the database to create when the DB instance is + // created. If this parameter isn't specified, no database is created in the DB + // instance. + // + // Constraints: + // + // - Must contain 1 to 64 letters or numbers. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0-9). + // + // - Can't be a word reserved by the specified database engine. + // + // RDS for Oracle The Oracle System ID (SID) of the created DB instance. If you + // don't specify a value, the default value is ORCL . You can't specify the string + // null , or any other reserved word, for DBName . + // + // Default: ORCL + // + // Constraints: + // + // - Can't be longer than 8 characters. + // + // RDS for PostgreSQL The name of the database to create when the DB instance is + // created. A database named postgres is always created. If this parameter is + // specified, an additional database with this name is created. + // + // Constraints: + // + // - Must contain 1 to 63 letters, numbers, or underscores. + // + // - Must begin with a letter. Subsequent characters can be letters, + // underscores, or digits (0-9). + // + // - Can't be a word reserved by the specified database engine. + // + // RDS for SQL Server Not applicable. Must be null. + // + // [Additional considerations]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-db-instance-prereqs.html#db2-prereqs-additional-considerations + DBName *string + + // The name of the DB parameter group to associate with this DB instance. If you + // don't specify a value, then Amazon RDS uses the default DB parameter group for + // the specified DB engine and version. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - The first character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + DBParameterGroupName *string + + // A list of DB security groups to associate with this DB instance. + // + // This setting applies to the legacy EC2-Classic platform, which is no longer + // used to create new DB instances. Use the VpcSecurityGroupIds setting instead. + DBSecurityGroups []string + + // A DB subnet group to associate with this DB instance. + // + // Constraints: + // + // - Must match the name of an existing DB subnet group. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // The Oracle system identifier (SID), which is the name of the Oracle database + // instance that manages your database files. In this context, the term "Oracle + // database instance" refers exclusively to the system global area (SGA) and Oracle + // background processes. If you don't specify a SID, the value defaults to RDSCDB . + // The Oracle SID is also the name of your CDB. + DBSystemId *string + + // The mode of Database Insights to enable for the DB instance. + // + // This setting only applies to Amazon Aurora DB instances. + // + // Currently, this value is inherited from the DB cluster and can't be changed. + DatabaseInsightsMode types.DatabaseInsightsMode + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Specifies whether the DB instance has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // This setting doesn't apply to Amazon Aurora DB instances. You can enable or + // disable deletion protection for the DB cluster. For more information, see + // CreateDBCluster . DB instances in a DB cluster can be deleted even when deletion + // protection is enabled for the DB cluster. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The Active Directory directory ID to create the DB instance in. Currently, you + // can create only Db2, MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB + // instances in an Active Directory Domain. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (The domain is managed by the DB cluster.) + // + // - RDS Custom + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The ARN for the Secrets Manager secret with the credentials for the user + // joining the domain. + // + // Example: + // arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 + DomainAuthSecretArn *string + + // The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + // controllers. + // + // Constraints: + // + // - Two IP addresses must be provided. If there isn't a secondary domain + // controller, use the IP address of the primary domain controller for both entries + // in the list. + // + // Example: 123.124.125.126,234.235.236.237 + DomainDnsIps []string + + // The fully qualified domain name (FQDN) of an Active Directory domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: mymanagedADtest.mymanagedAD.mydomain + DomainFqdn *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (The domain is managed by the DB cluster.) + // + // - RDS Custom + DomainIAMRoleName *string + + // The Active Directory organizational unit for your DB instance to join. + // + // Constraints: + // + // - Must be in the distinguished name format. + // + // - Can't be longer than 64 characters. + // + // Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain + DomainOu *string + + // The list of log types to enable for exporting to CloudWatch Logs. For more + // information, see [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon RDS User Guide. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (CloudWatch Logs exports are managed by the DB cluster.) + // + // - RDS Custom + // + // The following values are valid for each DB engine: + // + // - RDS for Db2 - diag.log | notify.log + // + // - RDS for MariaDB - audit | error | general | slowquery + // + // - RDS for Microsoft SQL Server - agent | error + // + // - RDS for MySQL - audit | error | general | slowquery + // + // - RDS for Oracle - alert | audit | listener | trace | oemagent + // + // - RDS for PostgreSQL - postgresql | upgrade + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts DB instance. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the DB instance from outside of its virtual + // private cloud (VPC) on your local network. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + EnableCustomerOwnedIp *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS User Guide. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (Mapping Amazon Web Services IAM accounts to database + // accounts is managed by the DB cluster.) + // + // - RDS Custom + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Performance Insights for the DB instance. For more + // information, see [Using Amazon Performance Insights]in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The life cycle type for this DB instance. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB instance into Amazon RDS Extended Support. At the end of + // standard support, you can avoid charges for Extended Support by setting the + // value to open-source-rds-extended-support-disabled . In this case, creating the + // DB instance will fail if the DB major version is past its end of standard + // support date. + // + // This setting applies only to RDS for MySQL and RDS for PostgreSQL. For Amazon + // Aurora DB instances, the life cycle type is managed by the DB cluster. + // + // You can use this setting to enroll your DB instance into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB instance past the end of standard support for that engine + // version. For more information, see [Using Amazon RDS Extended Support]in the Amazon RDS User Guide. + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The version number of the database engine to use. + // + // This setting doesn't apply to Amazon Aurora DB instances. The version number of + // the database engine the DB instance uses is managed by the DB cluster. + // + // For a list of valid engine versions, use the DescribeDBEngineVersions operation. + // + // The following are the database engines and links to information about the major + // and minor versions that are available with Amazon RDS. Not every database engine + // is available for every Amazon Web Services Region. + // + // Amazon RDS Custom for Oracle A custom engine version (CEV) that you have + // previously created. This setting is required for RDS Custom for Oracle. The CEV + // name has the following format: 19.customized_string. A valid CEV name is + // 19.my_cev1 . For more information, see [Creating an RDS Custom for Oracle DB instance] in the Amazon RDS User Guide. + // + // Amazon RDS Custom for SQL Server See [RDS Custom for SQL Server general requirements] in the Amazon RDS User Guide. + // + // RDS for Db2 For information, see [Db2 on Amazon RDS versions] in the Amazon RDS User Guide. + // + // RDS for MariaDB For information, see [MariaDB on Amazon RDS versions] in the Amazon RDS User Guide. + // + // RDS for Microsoft SQL Server For information, see [Microsoft SQL Server versions on Amazon RDS] in the Amazon RDS User Guide. + // + // RDS for MySQL For information, see [MySQL on Amazon RDS versions] in the Amazon RDS User Guide. + // + // RDS for Oracle For information, see [Oracle Database Engine release notes] in the Amazon RDS User Guide. + // + // RDS for PostgreSQL For information, see [Amazon RDS for PostgreSQL versions and extensions] in the Amazon RDS User Guide. + // + // [RDS Custom for SQL Server general requirements]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-reqs-limits-MS.html + // [MariaDB on Amazon RDS versions]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MariaDB.html#MariaDB.Concepts.VersionMgmt + // [Amazon RDS for PostgreSQL versions and extensions]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts + // [Oracle Database Engine release notes]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html + // [Creating an RDS Custom for Oracle DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-creating.html#custom-creating.create + // [Db2 on Amazon RDS versions]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Db2.html#Db2.Concepts.VersionMgmt + // [Microsoft SQL Server versions on Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.VersionSupport + // [MySQL on Amazon RDS versions]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt + EngineVersion *string + + // The amount of Provisioned IOPS (input/output operations per second) to + // initially allocate for the DB instance. For information about valid IOPS values, + // see [Amazon RDS DB instance storage]in the Amazon RDS User Guide. + // + // This setting doesn't apply to Amazon Aurora DB instances. Storage is managed by + // the DB cluster. + // + // Constraints: + // + // - For RDS for Db2, MariaDB, MySQL, Oracle, and PostgreSQL - Must be a + // multiple between .5 and 50 of the storage amount for the DB instance. + // + // - For RDS for SQL Server - Must be a multiple between 1 and 50 of the storage + // amount for the DB instance. + // + // [Amazon RDS DB instance storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html + Iops *int32 + + // The Amazon Web Services KMS key identifier for an encrypted DB instance. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // This setting doesn't apply to Amazon Aurora DB instances. The Amazon Web + // Services KMS key identifier is managed by the DB cluster. For more information, + // see CreateDBCluster . + // + // If StorageEncrypted is enabled, and you do not specify a value for the KmsKeyId + // parameter, then Amazon RDS uses your default KMS key. There is a default KMS key + // for your Amazon Web Services account. Your Amazon Web Services account has a + // different default KMS key for each Amazon Web Services Region. + // + // For Amazon RDS Custom, a KMS key is required for DB instances. For most RDS + // engines, if you leave this parameter empty while enabling StorageEncrypted , the + // engine uses the default KMS key. However, RDS Custom doesn't use the default key + // when this parameter is empty. You must explicitly specify a key. + KmsKeyId *string + + // The license model information for this DB instance. + // + // License models for RDS for Db2 require additional configuration. The Bring Your + // Own License (BYOL) model requires a custom parameter group and an Amazon Web + // Services License Manager self-managed license. The Db2 license through Amazon + // Web Services Marketplace model requires an Amazon Web Services Marketplace + // subscription. For more information, see [Amazon RDS for Db2 licensing options]in the Amazon RDS User Guide. + // + // The default for RDS for Db2 is bring-your-own-license . + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + // + // Valid Values: + // + // - RDS for Db2 - bring-your-own-license | marketplace-license + // + // - RDS for MariaDB - general-public-license + // + // - RDS for Microsoft SQL Server - license-included + // + // - RDS for MySQL - general-public-license + // + // - RDS for Oracle - bring-your-own-license | license-included + // + // - RDS for PostgreSQL - postgresql-license + // + // [Amazon RDS for Db2 licensing options]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html + LicenseModel *string + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide. + // + // Constraints: + // + // - Can't manage the master user password with Amazon Web Services Secrets + // Manager if MasterUserPassword is specified. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The password for the master user. + // + // This setting doesn't apply to Amazon Aurora DB instances. The password for the + // master user is managed by the DB cluster. + // + // Constraints: + // + // - Can't be specified if ManageMasterUserPassword is turned on. + // + // - Can include any printable ASCII character except "/", """, or "@". For RDS + // for Oracle, can't include the "&" (ampersand) or the "'" (single quotes) + // character. + // + // Length Constraints: + // + // - RDS for Db2 - Must contain from 8 to 255 characters. + // + // - RDS for MariaDB - Must contain from 8 to 41 characters. + // + // - RDS for Microsoft SQL Server - Must contain from 8 to 128 characters. + // + // - RDS for MySQL - Must contain from 8 to 41 characters. + // + // - RDS for Oracle - Must contain from 8 to 30 characters. + // + // - RDS for PostgreSQL - Must contain from 8 to 128 characters. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB instance. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If you don't specify MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS + // key is used to encrypt the secret. If the secret is in a different Amazon Web + // Services account, then you can't use the aws/secretsmanager KMS key to encrypt + // the secret, and you must use a customer managed KMS key. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + MasterUserSecretKmsKeyId *string + + // The name for the master user. + // + // This setting doesn't apply to Amazon Aurora DB instances. The name for the + // master user is managed by the DB cluster. + // + // This setting is required for RDS DB instances. + // + // Constraints: + // + // - Must be 1 to 16 letters, numbers, or underscores. + // + // - First character must be a letter. + // + // - Can't be a reserved word for the chosen database engine. + MasterUsername *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + // + // For more information about this setting, including limitations that apply to + // it, see [Managing capacity automatically with Amazon RDS storage autoscaling]in the Amazon RDS User Guide. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (Storage is managed by the DB cluster.) + // + // - RDS Custom + // + // [Managing capacity automatically with Amazon RDS storage autoscaling]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling + MaxAllocatedStorage *int32 + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB instance. To disable collection of Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, then you must set MonitoringInterval to a + // value other than 0 . + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + // to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess . + // For information on creating a monitoring role, see [Setting Up and Enabling Enhanced Monitoring]in the Amazon RDS User Guide. + // + // If MonitoringInterval is set to a value other than 0 , then you must supply a + // MonitoringRoleArn value. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Setting Up and Enabling Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS.Enabling + MonitoringRoleArn *string + + // Specifies whether the DB instance is a Multi-AZ deployment. You can't set the + // AvailabilityZone parameter if the DB instance is a Multi-AZ deployment. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (DB instance Availability Zones (AZs) are managed by the DB + // cluster.) + // + // - RDS Custom + MultiAZ *bool + + // Specifies whether to use the multi-tenant configuration or the single-tenant + // configuration (default). This parameter only applies to RDS for Oracle container + // database (CDB) engines. + // + // Note the following restrictions: + // + // - The DB engine that you specify in the request must support the multi-tenant + // configuration. If you attempt to enable the multi-tenant configuration on a DB + // engine that doesn't support it, the request fails. + // + // - If you specify the multi-tenant configuration when you create your DB + // instance, you can't later modify this DB instance to use the single-tenant + // configuration. + MultiTenant *bool + + // The name of the NCHAR character set for the Oracle DB instance. + // + // This setting doesn't apply to RDS Custom DB instances. + NcharCharacterSetName *string + + // The network type of the DB instance. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The option group to associate the DB instance with. + // + // Permanent options, such as the TDE option for Oracle Advanced Security TDE, + // can't be removed from an option group. Also, that option group can't be removed + // from a DB instance after it is associated with a DB instance. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + // + // This setting doesn't apply to RDS Custom DB instances. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // returns an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the database accepts connections. + // + // This setting doesn't apply to Aurora DB instances. The port number is managed + // by the cluster. + // + // Valid Values: 1150-65535 + // + // Default: + // + // - RDS for Db2 - 50000 + // + // - RDS for MariaDB - 3306 + // + // - RDS for Microsoft SQL Server - 1433 + // + // - RDS for MySQL - 3306 + // + // - RDS for Oracle - 1521 + // + // - RDS for PostgreSQL - 5432 + // + // Constraints: + // + // - For RDS for Microsoft SQL Server, the value can't be 1234 , 1434 , 3260 , + // 3343 , 3389 , 47001 , or 49152-49156 . + Port *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, using the BackupRetentionPeriod parameter. The default is + // a 30-minute window selected at random from an 8-hour block of time for each + // Amazon Web Services Region. For more information, see [Backup window]in the Amazon RDS User + // Guide. + // + // This setting doesn't apply to Amazon Aurora DB instances. The daily time range + // for creating automated backups is managed by the DB cluster. + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow + PreferredBackupWindow *string + + // The time range each week during which system maintenance can occur. For more + // information, see [Amazon RDS Maintenance Window]in the Amazon RDS User Guide. + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region, occurring on a random day of the week. + // + // Constraints: + // + // - Must be in the format ddd:hh24:mi-ddd:hh24:mi . + // + // - The day values must be mon | tue | wed | thu | fri | sat | sun . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred backup window. + // + // - Must be at least 30 minutes. + // + // [Amazon RDS Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance + PreferredMaintenanceWindow *string + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + ProcessorFeatures []types.ProcessorFeature + + // The order of priority in which an Aurora Replica is promoted to the primary + // instance after a failure of the existing primary instance. For more information, + // see [Fault Tolerance for an Aurora DB Cluster]in the Amazon Aurora User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Default: 1 + // + // Valid Values: 0 - 15 + // + // [Fault Tolerance for an Aurora DB Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora.Managing.FaultTolerance + PromotionTier *int32 + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB instance is publicly accessible and you connect from outside of the + // DB instance's virtual private cloud (VPC), its Domain Name System (DNS) endpoint + // resolves to the public IP address. When you connect from within the same VPC as + // the DB instance, the endpoint resolves to the private IP address. Access to the + // DB instance is ultimately controlled by the security group it uses. That public + // access is not permitted if the security group assigned to the DB instance + // doesn't permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // Default: The default behavior varies depending on whether DBSubnetGroupName is + // specified. + // + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, + // the following applies: + // + // - If the default VPC in the target Region doesn’t have an internet gateway + // attached to it, the DB instance is private. + // + // - If the default VPC in the target Region has an internet gateway attached to + // it, the DB instance is public. + // + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the + // following applies: + // + // - If the subnets are part of a VPC that doesn’t have an internet gateway + // attached to it, the DB instance is private. + // + // - If the subnets are part of a VPC that has an internet gateway attached to + // it, the DB instance is public. + PubliclyAccessible *bool + + // Specifes whether the DB instance is encrypted. By default, it isn't encrypted. + // + // For RDS Custom DB instances, either enable this setting or leave it unset. + // Otherwise, Amazon RDS reports an error. + // + // This setting doesn't apply to Amazon Aurora DB instances. The encryption for DB + // instances is managed by the DB cluster. + StorageEncrypted *bool + + // The storage throughput value for the DB instance. + // + // This setting applies only to the gp3 storage type. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + StorageThroughput *int32 + + // The storage type to associate with the DB instance. + // + // If you specify io1 , io2 , or gp3 , you must also include a value for the Iops + // parameter. + // + // This setting doesn't apply to Amazon Aurora DB instances. Storage is managed by + // the DB cluster. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // Default: io1 , if the Iops parameter is specified. Otherwise, gp2 . + StorageType *string + + // Tags to assign to the DB instance. + Tags []types.Tag + + // The ARN from the key store with which to associate the instance for TDE + // encryption. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + TdeCredentialArn *string + + // The password for the given ARN from the key store in order to access the device. + // + // This setting doesn't apply to RDS Custom DB instances. + TdeCredentialPassword *string + + // The time zone of the DB instance. The time zone parameter is currently + // supported only by [RDS for Db2]and [RDS for SQL Server]. + // + // [RDS for Db2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-time-zone + // [RDS for SQL Server]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.TimeZone + Timezone *string + + // A list of Amazon EC2 VPC security groups to associate with this DB instance. + // + // This setting doesn't apply to Amazon Aurora DB instances. The associated list + // of EC2 VPC security groups is managed by the DB cluster. + // + // Default: The default EC2 VPC security group for the DB subnet group's VPC. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type CreateDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstanceReadReplica.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstanceReadReplica.go new file mode 100644 index 00000000..80d24bf7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBInstanceReadReplica.go @@ -0,0 +1,870 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB instance that acts as a read replica for an existing source DB +// instance or Multi-AZ DB cluster. You can create a read replica for a DB instance +// running Db2, MariaDB, MySQL, Oracle, PostgreSQL, or SQL Server. You can create a +// read replica for a Multi-AZ DB cluster running MySQL or PostgreSQL. For more +// information, see [Working with read replicas]and [Migrating from a Multi-AZ DB cluster to a DB instance using a read replica] in the Amazon RDS User Guide. +// +// Amazon Aurora doesn't support this operation. To create a DB instance for an +// Aurora DB cluster, use the CreateDBInstance operation. +// +// All read replica DB instances are created with backups disabled. All other +// attributes (including DB security groups and DB parameter groups) are inherited +// from the source DB instance or cluster, except as specified. +// +// Your source DB instance or cluster must have backup retention enabled. +// +// [Working with read replicas]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html +// [Migrating from a Multi-AZ DB cluster to a DB instance using a read replica]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html#multi-az-db-clusters-migrating-to-instance-with-read-replica +func (c *Client) CreateDBInstanceReadReplica(ctx context.Context, params *CreateDBInstanceReadReplicaInput, optFns ...func(*Options)) (*CreateDBInstanceReadReplicaOutput, error) { + if params == nil { + params = &CreateDBInstanceReadReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBInstanceReadReplica", params, optFns, c.addOperationCreateDBInstanceReadReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBInstanceReadReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBInstanceReadReplicaInput struct { + + // The DB instance identifier of the read replica. This identifier is the unique + // key that identifies a DB instance. This parameter is stored as a lowercase + // string. + // + // This member is required. + DBInstanceIdentifier *string + + // The amount of storage (in gibibytes) to allocate initially for the read + // replica. Follow the allocation rules specified in CreateDBInstance . + // + // This setting isn't valid for RDS for SQL Server. + // + // Be sure to allocate enough storage for your read replica so that the create + // operation can succeed. You can also allocate additional storage for future + // growth. + AllocatedStorage *int32 + + // Specifies whether to automatically apply minor engine upgrades to the read + // replica during the maintenance window. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Default: Inherits the value from the source DB instance. + AutoMinorVersionUpgrade *bool + + // The Availability Zone (AZ) where the read replica will be created. + // + // Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web + // Services Region. + // + // Example: us-east-1d + AvailabilityZone *string + + // The CA certificate identifier to use for the read replica's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // Specifies whether to copy all tags from the read replica to snapshots of the + // read replica. By default, tags aren't copied. + CopyTagsToSnapshot *bool + + // The instance profile associated with the underlying Amazon EC2 instance of an + // RDS Custom DB instance. The instance profile must meet the following + // requirements: + // + // - The profile must exist in your account. + // + // - The profile must have an IAM role that Amazon EC2 has permissions to assume. + // + // - The instance profile name and the associated IAM role name must start with + // the prefix AWSRDSCustom . + // + // For the list of permissions required for the IAM role, see [Configure IAM and your VPC] in the Amazon RDS + // User Guide. + // + // This setting is required for RDS Custom DB instances. + // + // [Configure IAM and your VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc + CustomIamInstanceProfile *string + + // The compute and memory capacity of the read replica, for example db.m4.large. + // Not all DB instance classes are available in all Amazon Web Services Regions, or + // for all database engines. For the full list of DB instance classes, and + // availability for your engine, see [DB Instance Class]in the Amazon RDS User Guide. + // + // Default: Inherits the value from the source DB instance. + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBInstanceClass *string + + // The name of the DB parameter group to associate with this read replica DB + // instance. + // + // For Single-AZ or Multi-AZ DB instance read replica instances, if you don't + // specify a value for DBParameterGroupName , then Amazon RDS uses the + // DBParameterGroup of the source DB instance for a same Region read replica, or + // the default DBParameterGroup for the specified DB engine for a cross-Region + // read replica. + // + // For Multi-AZ DB cluster same Region read replica instances, if you don't + // specify a value for DBParameterGroupName , then Amazon RDS uses the default + // DBParameterGroup . + // + // Specifying a parameter group for this operation is only supported for MySQL DB + // instances for cross-Region read replicas, for Multi-AZ DB cluster read replica + // instances, and for Oracle DB instances. It isn't supported for MySQL DB + // instances for same Region read replicas or for RDS Custom. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + DBParameterGroupName *string + + // A DB subnet group for the DB instance. The new DB instance is created in the + // VPC associated with the DB subnet group. If no DB subnet group is specified, + // then the new DB instance isn't created in a VPC. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB subnet group. + // + // - The specified DB subnet group must be in the same Amazon Web Services + // Region in which the operation is running. + // + // - All read replicas in one Amazon Web Services Region that are created from + // the same source DB instance must either: + // + // - Specify DB subnet groups from the same VPC. All these read replicas are + // created in the same VPC. + // + // - Not specify a DB subnet group. All these read replicas are created outside + // of any VPC. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // The mode of Database Insights to enable for the read replica. + // + // Currently, this setting is not supported. + DatabaseInsightsMode types.DatabaseInsightsMode + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Specifies whether to enable deletion protection for the DB instance. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The Active Directory directory ID to create the DB instance in. Currently, only + // MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created + // in an Active Directory Domain. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The ARN for the Secrets Manager secret with the credentials for the user + // joining the domain. + // + // Example: + // arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 + DomainAuthSecretArn *string + + // The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + // controllers. + // + // Constraints: + // + // - Two IP addresses must be provided. If there isn't a secondary domain + // controller, use the IP address of the primary domain controller for both entries + // in the list. + // + // Example: 123.124.125.126,234.235.236.237 + DomainDnsIps []string + + // The fully qualified domain name (FQDN) of an Active Directory domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: mymanagedADtest.mymanagedAD.mydomain + DomainFqdn *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // This setting doesn't apply to RDS Custom DB instances. + DomainIAMRoleName *string + + // The Active Directory organizational unit for your DB instance to join. + // + // Constraints: + // + // - Must be in the distinguished name format. + // + // - Can't be longer than 64 characters. + // + // Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain + DomainOu *string + + // The list of logs that the new DB instance is to export to CloudWatch Logs. The + // values in the list depend on the DB engine being used. For more information, see + // [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts read replica. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the read replica from outside of its virtual + // private cloud (VPC) on your local network. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + EnableCustomerOwnedIp *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information about IAM database authentication, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS + // User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Performance Insights for the read replica. + // + // For more information, see [Using Amazon Performance Insights] in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The amount of Provisioned IOPS (input/output operations per second) to + // initially allocate for the DB instance. + Iops *int32 + + // The Amazon Web Services KMS key identifier for an encrypted read replica. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you create an encrypted read replica in the same Amazon Web Services Region + // as the source DB instance or Multi-AZ DB cluster, don't specify a value for this + // parameter. A read replica in the same Amazon Web Services Region is always + // encrypted with the same KMS key as the source DB instance or cluster. + // + // If you create an encrypted read replica in a different Amazon Web Services + // Region, then you must specify a KMS key identifier for the destination Amazon + // Web Services Region. KMS keys are specific to the Amazon Web Services Region + // that they are created in, and you can't use KMS keys from one Amazon Web + // Services Region in another Amazon Web Services Region. + // + // You can't create an encrypted read replica from an unencrypted DB instance or + // Multi-AZ DB cluster. + // + // This setting doesn't apply to RDS Custom, which uses the same KMS key as the + // primary replica. + KmsKeyId *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + // + // For more information about this setting, including limitations that apply to + // it, see [Managing capacity automatically with Amazon RDS storage autoscaling]in the Amazon RDS User Guide. + // + // [Managing capacity automatically with Amazon RDS storage autoscaling]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling + MaxAllocatedStorage *int32 + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the read replica. To disable collection of Enhanced Monitoring + // metrics, specify 0 . The default is 0 . + // + // If MonitoringRoleArn is specified, then you must set MonitoringInterval to a + // value other than 0 . + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: 0, 1, 5, 10, 15, 30, 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + // to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess . + // For information on creating a monitoring role, go to [To create an IAM role for Amazon RDS Enhanced Monitoring]in the Amazon RDS User + // Guide. + // + // If MonitoringInterval is set to a value other than 0, then you must supply a + // MonitoringRoleArn value. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [To create an IAM role for Amazon RDS Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole + MonitoringRoleArn *string + + // Specifies whether the read replica is in a Multi-AZ deployment. + // + // You can create a read replica as a Multi-AZ DB instance. RDS creates a standby + // of your replica in another Availability Zone for failover support for the + // replica. Creating your read replica as a Multi-AZ DB instance is independent of + // whether the source is a Multi-AZ DB instance or a Multi-AZ DB cluster. + // + // This setting doesn't apply to RDS Custom DB instances. + MultiAZ *bool + + // The network type of the DB instance. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for read replica. + // A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 + // protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The option group to associate the DB instance with. If not specified, RDS uses + // the option group associated with the source DB instance or cluster. + // + // For SQL Server, you must use the option group associated with the source. + // + // This setting doesn't apply to RDS Custom DB instances. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you do not specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + // + // This setting doesn't apply to RDS Custom DB instances. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // returns an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number that the DB instance uses for connections. + // + // Valid Values: 1150-65535 + // + // Default: Inherits the value from the source DB instance. + Port *int32 + + // When you are creating a read replica from one Amazon Web Services GovCloud (US) + // Region to another or from one China Amazon Web Services Region to another, the + // URL that contains a Signature Version 4 signed request for the + // CreateDBInstanceReadReplica API operation in the source Amazon Web Services + // Region that contains the source DB instance. + // + // This setting applies only to Amazon Web Services GovCloud (US) Regions and + // China Amazon Web Services Regions. It's ignored in other Amazon Web Services + // Regions. + // + // This setting applies only when replicating from a source DB instance. Source DB + // clusters aren't supported in Amazon Web Services GovCloud (US) Regions and China + // Amazon Web Services Regions. + // + // You must specify this parameter when you create an encrypted read replica from + // another Amazon Web Services Region by using the Amazon RDS API. Don't specify + // PreSignedUrl when you are creating an encrypted read replica in the same Amazon + // Web Services Region. + // + // The presigned URL must be a valid request for the CreateDBInstanceReadReplica + // API operation that can run in the source Amazon Web Services Region that + // contains the encrypted source DB instance. The presigned URL request must + // contain the following parameter values: + // + // - DestinationRegion - The Amazon Web Services Region that the encrypted read + // replica is created in. This Amazon Web Services Region is the same one where the + // CreateDBInstanceReadReplica operation is called that contains this presigned + // URL. + // + // For example, if you create an encrypted DB instance in the us-west-1 Amazon Web + // Services Region, from a source DB instance in the us-east-2 Amazon Web Services + // Region, then you call the CreateDBInstanceReadReplica operation in the + // us-east-1 Amazon Web Services Region and provide a presigned URL that contains a + // call to the CreateDBInstanceReadReplica operation in the us-west-2 Amazon Web + // Services Region. For this example, the DestinationRegion in the presigned URL + // must be set to the us-east-1 Amazon Web Services Region. + // + // - KmsKeyId - The KMS key identifier for the key to use to encrypt the read + // replica in the destination Amazon Web Services Region. This is the same + // identifier for both the CreateDBInstanceReadReplica operation that is called + // in the destination Amazon Web Services Region, and the operation contained in + // the presigned URL. + // + // - SourceDBInstanceIdentifier - The DB instance identifier for the encrypted DB + // instance to be replicated. This identifier must be in the Amazon Resource Name + // (ARN) format for the source Amazon Web Services Region. For example, if you are + // creating an encrypted read replica from a DB instance in the us-west-2 Amazon + // Web Services Region, then your SourceDBInstanceIdentifier looks like the + // following example: + // arn:aws:rds:us-west-2:123456789012:instance:mysql-instance1-20161115 . + // + // To learn how to generate a Signature Version 4 signed request, see [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)] and [Signature Version 4 Signing Process]. + // + // If you are using an Amazon Web Services SDK tool or the CLI, you can specify + // SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl + // manually. Specifying SourceRegion autogenerates a presigned URL that is a valid + // request for the operation that can run in the source Amazon Web Services Region. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + PreSignedUrl *string + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + // + // This setting doesn't apply to RDS Custom DB instances. + ProcessorFeatures []types.ProcessorFeature + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB cluster is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB cluster's virtual + // private cloud (VPC). It resolves to the public IP address from outside of the DB + // cluster's VPC. Access to the DB cluster is ultimately controlled by the security + // group it uses. That public access isn't permitted if the security group assigned + // to the DB cluster doesn't permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBInstance. + PubliclyAccessible *bool + + // The open mode of the replica database: mounted or read-only. + // + // This parameter is only supported for Oracle DB instances. + // + // Mounted DB replicas are included in Oracle Database Enterprise Edition. The + // main use case for mounted replicas is cross-Region disaster recovery. The + // primary database doesn't use Active Data Guard to transmit information to the + // mounted replica. Because it doesn't accept user connections, a mounted replica + // can't serve a read-only workload. + // + // You can create a combination of mounted and read-only DB replicas for the same + // primary DB instance. For more information, see [Working with Oracle Read Replicas for Amazon RDS]in the Amazon RDS User Guide. + // + // For RDS Custom, you must specify this parameter and set it to mounted . The + // value won't be set by default. After replica creation, you can manage the open + // mode manually. + // + // [Working with Oracle Read Replicas for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html + ReplicaMode types.ReplicaMode + + // The identifier of the Multi-AZ DB cluster that will act as the source for the + // read replica. Each DB cluster can have up to 15 read replicas. + // + // Constraints: + // + // - Must be the identifier of an existing Multi-AZ DB cluster. + // + // - Can't be specified if the SourceDBInstanceIdentifier parameter is also + // specified. + // + // - The specified DB cluster must have automatic backups enabled, that is, its + // backup retention period must be greater than 0. + // + // - The source DB cluster must be in the same Amazon Web Services Region as the + // read replica. Cross-Region replication isn't supported. + SourceDBClusterIdentifier *string + + // The identifier of the DB instance that will act as the source for the read + // replica. Each DB instance can have up to 15 read replicas, with the exception of + // Oracle and SQL Server, which can have up to five. + // + // Constraints: + // + // - Must be the identifier of an existing Db2, MariaDB, MySQL, Oracle, + // PostgreSQL, or SQL Server DB instance. + // + // - Can't be specified if the SourceDBClusterIdentifier parameter is also + // specified. + // + // - For the limitations of Oracle read replicas, see [Version and licensing considerations for RDS for Oracle replicas]in the Amazon RDS User + // Guide. + // + // - For the limitations of SQL Server read replicas, see [Read replica limitations with SQL Server]in the Amazon RDS User + // Guide. + // + // - The specified DB instance must have automatic backups enabled, that is, its + // backup retention period must be greater than 0. + // + // - If the source DB instance is in the same Amazon Web Services Region as the + // read replica, specify a valid DB instance identifier. + // + // - If the source DB instance is in a different Amazon Web Services Region from + // the read replica, specify a valid DB instance ARN. For more information, see [Constructing an ARN for Amazon RDS] + // in the Amazon RDS User Guide. This doesn't apply to SQL Server or RDS Custom, + // which don't support cross-Region replicas. + // + // [Constructing an ARN for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // [Read replica limitations with SQL Server]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.ReadReplicas.html#SQLServer.ReadReplicas.Limitations + // [Version and licensing considerations for RDS for Oracle replicas]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.limitations.html#oracle-read-replicas.limitations.versions-and-licenses + SourceDBInstanceIdentifier *string + + // The AWS region the resource is in. The presigned URL will be created with this + // region, if the PresignURL member is empty set. + SourceRegion *string + + // Specifies the storage throughput value for the read replica. + // + // This setting doesn't apply to RDS Custom or Amazon Aurora DB instances. + StorageThroughput *int32 + + // The storage type to associate with the read replica. + // + // If you specify io1 , io2 , or gp3 , you must also include a value for the Iops + // parameter. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // Default: io1 if the Iops parameter is specified. Otherwise, gp2 . + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // Whether to upgrade the storage file system configuration on the read replica. + // This option migrates the read replica from the old storage file system layout to + // the preferred layout. + UpgradeStorageConfig *bool + + // Specifies whether the DB instance class of the DB instance uses its default + // processor features. + // + // This setting doesn't apply to RDS Custom DB instances. + UseDefaultProcessorFeatures *bool + + // A list of Amazon EC2 VPC security groups to associate with the read replica. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Default: The default EC2 VPC security group for the DB subnet group's VPC. + VpcSecurityGroupIds []string + + // Used by the SDK's PresignURL autofill customization to specify the region the + // of the client's request. + destinationRegion *string + + noSmithyDocumentSerde +} + +type CreateDBInstanceReadReplicaOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBInstanceReadReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBInstanceReadReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBInstanceReadReplica{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBInstanceReadReplica"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addCreateDBInstanceReadReplicaPresignURLMiddleware(stack, options); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBInstanceReadReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBInstanceReadReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func copyCreateDBInstanceReadReplicaInputForPresign(params interface{}) (interface{}, error) { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return nil, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + cpy := *input + return &cpy, nil +} +func getCreateDBInstanceReadReplicaPreSignedUrl(params interface{}) (string, bool, error) { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return ``, false, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { + return ``, false, nil + } + return *input.PreSignedUrl, true, nil +} +func getCreateDBInstanceReadReplicaSourceRegion(params interface{}) (string, bool, error) { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return ``, false, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { + return ``, false, nil + } + return *input.SourceRegion, true, nil +} +func setCreateDBInstanceReadReplicaPreSignedUrl(params interface{}, value string) error { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + input.PreSignedUrl = &value + return nil +} +func setCreateDBInstanceReadReplicadestinationRegion(params interface{}, value string) error { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + input.destinationRegion = &value + return nil +} +func addCreateDBInstanceReadReplicaPresignURLMiddleware(stack *middleware.Stack, options Options) error { + return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ + Accessor: presignedurlcust.ParameterAccessor{ + GetPresignedURL: getCreateDBInstanceReadReplicaPreSignedUrl, + + GetSourceRegion: getCreateDBInstanceReadReplicaSourceRegion, + + CopyInput: copyCreateDBInstanceReadReplicaInputForPresign, + + SetDestinationRegion: setCreateDBInstanceReadReplicadestinationRegion, + + SetPresignedURL: setCreateDBInstanceReadReplicaPreSignedUrl, + }, + Presigner: &presignAutoFillCreateDBInstanceReadReplicaClient{client: NewPresignClient(New(options))}, + }) +} + +type presignAutoFillCreateDBInstanceReadReplicaClient struct { + client *PresignClient +} + +// PresignURL is a middleware accessor that satisfies URLPresigner interface. +func (c *presignAutoFillCreateDBInstanceReadReplicaClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { + input, ok := params.(*CreateDBInstanceReadReplicaInput) + if !ok { + return nil, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params) + } + optFn := func(o *Options) { + o.Region = srcRegion + o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) + } + presignOptFn := WithPresignClientFromClientOptions(optFn) + return c.client.PresignCreateDBInstanceReadReplica(ctx, input, presignOptFn) +} + +func newServiceMetadataMiddleware_opCreateDBInstanceReadReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBInstanceReadReplica", + } +} + +// PresignCreateDBInstanceReadReplica is used to generate a presigned HTTP Request +// which contains presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignCreateDBInstanceReadReplica(ctx context.Context, params *CreateDBInstanceReadReplicaInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &CreateDBInstanceReadReplicaInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "CreateDBInstanceReadReplica", params, clientOptFns, + c.client.addOperationCreateDBInstanceReadReplicaMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBParameterGroup.go new file mode 100644 index 00000000..7df56a8f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBParameterGroup.go @@ -0,0 +1,253 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB parameter group. +// +// A DB parameter group is initially created with the default parameters for the +// database engine used by the DB instance. To provide custom values for any of the +// parameters, you must modify the group after creating it using +// ModifyDBParameterGroup . Once you've created a DB parameter group, you need to +// associate it with your DB instance using ModifyDBInstance . When you associate a +// new DB parameter group with a running DB instance, you need to reboot the DB +// instance without failover for the new DB parameter group and associated settings +// to take effect. +// +// This command doesn't apply to RDS Custom. +// +// After you create a DB parameter group, you should wait at least 5 minutes +// before creating your first DB instance that uses that DB parameter group as the +// default parameter group. This allows Amazon RDS to fully complete the create +// action before the parameter group is used as the default for a new DB instance. +// This is especially important for parameters that are critical when creating the +// default database for a DB instance, such as the character set for the default +// database defined by the character_set_database parameter. You can use the +// Parameter Groups option of the [Amazon RDS console]or the DescribeDBParameters command to verify +// that your DB parameter group has been created or modified. +// +// [Amazon RDS console]: https://console.aws.amazon.com/rds/ +func (c *Client) CreateDBParameterGroup(ctx context.Context, params *CreateDBParameterGroupInput, optFns ...func(*Options)) (*CreateDBParameterGroupOutput, error) { + if params == nil { + params = &CreateDBParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBParameterGroup", params, optFns, c.addOperationCreateDBParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBParameterGroupInput struct { + + // The DB parameter group family name. A DB parameter group can be associated with + // one and only one DB parameter group family, and can be applied only to a DB + // instance running a database engine and engine version compatible with that DB + // parameter group family. + // + // To list all of the available parameter group families for a DB engine, use the + // following command: + // + // aws rds describe-db-engine-versions --query + // "DBEngineVersions[].DBParameterGroupFamily" --engine + // + // For example, to list all of the available parameter group families for the + // MySQL DB engine, use the following command: + // + // aws rds describe-db-engine-versions --query + // "DBEngineVersions[].DBParameterGroupFamily" --engine mysql + // + // The output contains duplicates. + // + // The following are the valid DB engine values: + // + // - aurora-mysql + // + // - aurora-postgresql + // + // - db2-ae + // + // - db2-se + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // This member is required. + DBParameterGroupFamily *string + + // The name of the DB parameter group. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // This value is stored as a lowercase string. + // + // This member is required. + DBParameterGroupName *string + + // The description for the DB parameter group. + // + // This member is required. + Description *string + + // Tags to assign to the DB parameter group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBParameterGroupOutput struct { + + // Contains the details of an Amazon RDS DB parameter group. + // + // This data type is used as a response element in the DescribeDBParameterGroups + // action. + DBParameterGroup *types.DBParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxy.go new file mode 100644 index 00000000..36be8b63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxy.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB proxy. +func (c *Client) CreateDBProxy(ctx context.Context, params *CreateDBProxyInput, optFns ...func(*Options)) (*CreateDBProxyOutput, error) { + if params == nil { + params = &CreateDBProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBProxy", params, optFns, c.addOperationCreateDBProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBProxyInput struct { + + // The authorization mechanism that the proxy uses. + // + // This member is required. + Auth []types.UserAuthConfig + + // The identifier for the proxy. This name must be unique for all proxies owned by + // your Amazon Web Services account in the specified Amazon Web Services Region. An + // identifier must begin with a letter and must contain only ASCII letters, digits, + // and hyphens; it can't end with a hyphen or contain two consecutive hyphens. + // + // This member is required. + DBProxyName *string + + // The kinds of databases that the proxy can connect to. This value determines + // which database network protocol the proxy recognizes when it interprets network + // traffic to and from the database. For Aurora MySQL, RDS for MariaDB, and RDS for + // MySQL databases, specify MYSQL . For Aurora PostgreSQL and RDS for PostgreSQL + // databases, specify POSTGRESQL . For RDS for Microsoft SQL Server, specify + // SQLSERVER . + // + // This member is required. + EngineFamily types.EngineFamily + + // The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access + // secrets in Amazon Web Services Secrets Manager. + // + // This member is required. + RoleArn *string + + // One or more VPC subnet IDs to associate with the new proxy. + // + // This member is required. + VpcSubnetIds []string + + // Specifies whether the proxy includes detailed information about SQL statements + // in its logs. This information helps you to debug issues involving SQL behavior + // or the performance and scalability of the proxy connections. The debug + // information includes the text of SQL statements that you submit through the + // proxy. Thus, only enable this setting when needed for debugging, and only when + // you have security measures in place to safeguard any sensitive information that + // appears in the logs. + DebugLogging *bool + + // The number of seconds that a connection to the proxy can be inactive before the + // proxy disconnects it. You can set this value higher or lower than the connection + // timeout limit for the associated database. + IdleClientTimeout *int32 + + // Specifies whether Transport Layer Security (TLS) encryption is required for + // connections to the proxy. By enabling this setting, you can enforce encrypted + // TLS connections to the proxy. + RequireTLS *bool + + // An optional set of key-value pairs to associate arbitrary data of your choosing + // with the proxy. + Tags []types.Tag + + // One or more VPC security group IDs to associate with the new proxy. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type CreateDBProxyOutput struct { + + // The DBProxy structure corresponding to the new proxy. + DBProxy *types.DBProxy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBProxy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBProxy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBProxy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxyEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxyEndpoint.go new file mode 100644 index 00000000..58faa547 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBProxyEndpoint.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a DBProxyEndpoint . Only applies to proxies that are associated with +// Aurora DB clusters. You can use DB proxy endpoints to specify read/write or +// read-only access to the DB cluster. You can also use DB proxy endpoints to +// access a DB proxy through a different VPC than the proxy's default VPC. +func (c *Client) CreateDBProxyEndpoint(ctx context.Context, params *CreateDBProxyEndpointInput, optFns ...func(*Options)) (*CreateDBProxyEndpointOutput, error) { + if params == nil { + params = &CreateDBProxyEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBProxyEndpoint", params, optFns, c.addOperationCreateDBProxyEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBProxyEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBProxyEndpointInput struct { + + // The name of the DB proxy endpoint to create. + // + // This member is required. + DBProxyEndpointName *string + + // The name of the DB proxy associated with the DB proxy endpoint that you create. + // + // This member is required. + DBProxyName *string + + // The VPC subnet IDs for the DB proxy endpoint that you create. You can specify a + // different set of subnet IDs than for the original DB proxy. + // + // This member is required. + VpcSubnetIds []string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The role of the DB proxy endpoint. The role determines whether the endpoint can + // be used for read/write or only read operations. The default is READ_WRITE . The + // only role that proxies for RDS for Microsoft SQL Server support is READ_WRITE . + TargetRole types.DBProxyEndpointTargetRole + + // The VPC security group IDs for the DB proxy endpoint that you create. You can + // specify a different set of security group IDs than for the original DB proxy. + // The default is the default security group for the VPC. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type CreateDBProxyEndpointOutput struct { + + // The DBProxyEndpoint object that is created by the API operation. The DB proxy + // endpoint that you create might provide capabilities such as read/write or + // read-only operations, or using a different VPC than the proxy's default VPC. + DBProxyEndpoint *types.DBProxyEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBProxyEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBProxyEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBProxyEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBProxyEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBProxyEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBProxyEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSecurityGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSecurityGroup.go new file mode 100644 index 00000000..a09cc5e3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSecurityGroup.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB security group. DB security groups control access to a DB +// instance. +// +// A DB security group controls access to EC2-Classic DB instances that are not in +// a VPC. +// +// EC2-Classic was retired on August 15, 2022. If you haven't migrated from +// EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For +// more information, see [Migrate from EC2-Classic to a VPC]in the Amazon EC2 User Guide, the blog [EC2-Classic Networking is Retiring – Here’s How to Prepare], and [Moving a DB instance not in a VPC into a VPC] in the +// Amazon RDS User Guide. +// +// [Migrate from EC2-Classic to a VPC]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html +// [EC2-Classic Networking is Retiring – Here’s How to Prepare]: http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/ +// [Moving a DB instance not in a VPC into a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html +func (c *Client) CreateDBSecurityGroup(ctx context.Context, params *CreateDBSecurityGroupInput, optFns ...func(*Options)) (*CreateDBSecurityGroupOutput, error) { + if params == nil { + params = &CreateDBSecurityGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBSecurityGroup", params, optFns, c.addOperationCreateDBSecurityGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBSecurityGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBSecurityGroupInput struct { + + // The description for the DB security group. + // + // This member is required. + DBSecurityGroupDescription *string + + // The name for the DB security group. This value is stored as a lowercase string. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // - Must not be "Default" + // + // Example: mysecuritygroup + // + // This member is required. + DBSecurityGroupName *string + + // Tags to assign to the DB security group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBSecurityGroupOutput struct { + + // Contains the details for an Amazon RDS DB security group. + // + // This data type is used as a response element in the DescribeDBSecurityGroups + // action. + DBSecurityGroup *types.DBSecurityGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBSecurityGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBSecurityGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBSecurityGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBSecurityGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBSecurityGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBSecurityGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBSecurityGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBSecurityGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBShardGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBShardGroup.go new file mode 100644 index 00000000..6b461803 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBShardGroup.go @@ -0,0 +1,291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB shard group for Aurora Limitless Database. You must enable +// Aurora Limitless Database to create a DB shard group. +// +// Valid for: Aurora DB clusters only +func (c *Client) CreateDBShardGroup(ctx context.Context, params *CreateDBShardGroupInput, optFns ...func(*Options)) (*CreateDBShardGroupOutput, error) { + if params == nil { + params = &CreateDBShardGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBShardGroup", params, optFns, c.addOperationCreateDBShardGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBShardGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBShardGroupInput struct { + + // The name of the primary DB cluster for the DB shard group. + // + // This member is required. + DBClusterIdentifier *string + + // The name of the DB shard group. + // + // This member is required. + DBShardGroupIdentifier *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + // + // This member is required. + MaxACU *float64 + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Specifies whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access is not permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // Default: The default behavior varies depending on whether DBSubnetGroupName is + // specified. + // + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, + // the following applies: + // + // - If the default VPC in the target Region doesn’t have an internet gateway + // attached to it, the DB shard group is private. + // + // - If the default VPC in the target Region has an internet gateway attached to + // it, the DB shard group is public. + // + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the + // following applies: + // + // - If the subnets are part of a VPC that doesn’t have an internet gateway + // attached to it, the DB shard group is private. + // + // - If the subnets are part of a VPC that has an internet gateway attached to + // it, the DB shard group is public. + PubliclyAccessible *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB shard group. +type CreateDBShardGroupOutput struct { + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The name of the primary DB cluster for the DB shard group. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB shard group. + DBShardGroupArn *string + + // The name of the DB shard group. + DBShardGroupIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB shard + // group. + DBShardGroupResourceId *string + + // The connection endpoint for the DB shard group. + Endpoint *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Indicates whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access isn't permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBShardGroup. + // + // This setting is only for Aurora Limitless Database. + PubliclyAccessible *bool + + // The status of the DB shard group. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBShardGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBShardGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBShardGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBShardGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBShardGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBShardGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBShardGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBShardGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSnapshot.go new file mode 100644 index 00000000..b5e387c9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSnapshot.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a snapshot of a DB instance. The source DB instance must be in the +// available or storage-optimization state. +func (c *Client) CreateDBSnapshot(ctx context.Context, params *CreateDBSnapshotInput, optFns ...func(*Options)) (*CreateDBSnapshotOutput, error) { + if params == nil { + params = &CreateDBSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBSnapshot", params, optFns, c.addOperationCreateDBSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBSnapshotInput struct { + + // The identifier of the DB instance that you want to create the snapshot of. + // + // Constraints: + // + // - Must match the identifier of an existing DBInstance. + // + // This member is required. + DBInstanceIdentifier *string + + // The identifier for the DB snapshot. + // + // Constraints: + // + // - Can't be null, empty, or blank + // + // - Must contain from 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-snapshot-id + // + // This member is required. + DBSnapshotIdentifier *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBSnapshotOutput struct { + + // Contains the details of an Amazon RDS DB snapshot. + // + // This data type is used as a response element in the DescribeDBSnapshots action. + DBSnapshot *types.DBSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSubnetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSubnetGroup.go new file mode 100644 index 00000000..615ef65b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateDBSubnetGroup.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB subnet group. DB subnet groups must contain at least one +// subnet in at least two AZs in the Amazon Web Services Region. +func (c *Client) CreateDBSubnetGroup(ctx context.Context, params *CreateDBSubnetGroupInput, optFns ...func(*Options)) (*CreateDBSubnetGroupOutput, error) { + if params == nil { + params = &CreateDBSubnetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDBSubnetGroup", params, optFns, c.addOperationCreateDBSubnetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDBSubnetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDBSubnetGroupInput struct { + + // The description for the DB subnet group. + // + // This member is required. + DBSubnetGroupDescription *string + + // The name for the DB subnet group. This value is stored as a lowercase string. + // + // Constraints: + // + // - Must contain no more than 255 letters, numbers, periods, underscores, + // spaces, or hyphens. + // + // - Must not be default. + // + // - First character must be a letter. + // + // Example: mydbsubnetgroup + // + // This member is required. + DBSubnetGroupName *string + + // The EC2 Subnet IDs for the DB subnet group. + // + // This member is required. + SubnetIds []string + + // Tags to assign to the DB subnet group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDBSubnetGroupOutput struct { + + // Contains the details of an Amazon RDS DB subnet group. + // + // This data type is used as a response element in the DescribeDBSubnetGroups + // action. + DBSubnetGroup *types.DBSubnetGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDBSubnetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDBSubnetGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDBSubnetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBSubnetGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDBSubnetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDBSubnetGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateEventSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateEventSubscription.go new file mode 100644 index 00000000..0b9a7e64 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateEventSubscription.go @@ -0,0 +1,259 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an RDS event notification subscription. This operation requires a topic +// Amazon Resource Name (ARN) created by either the RDS console, the SNS console, +// or the SNS API. To obtain an ARN with SNS, you must create a topic in Amazon SNS +// and subscribe to the topic. The ARN is displayed in the SNS console. +// +// You can specify the type of source ( SourceType ) that you want to be notified +// of and provide a list of RDS sources ( SourceIds ) that triggers the events. You +// can also provide a list of event categories ( EventCategories ) for events that +// you want to be notified of. For example, you can specify SourceType = +// db-instance , SourceIds = mydbinstance1 , mydbinstance2 and EventCategories = +// Availability , Backup . +// +// If you specify both the SourceType and SourceIds , such as SourceType = +// db-instance and SourceIds = myDBInstance1 , you are notified of all the +// db-instance events for the specified source. If you specify a SourceType but do +// not specify SourceIds , you receive notice of the events for that source type +// for all your RDS sources. If you don't specify either the SourceType or the +// SourceIds , you are notified of events generated from all RDS sources belonging +// to your customer account. +// +// For more information about subscribing to an event for RDS DB engines, see [Subscribing to Amazon RDS event notification] in +// the Amazon RDS User Guide. +// +// For more information about subscribing to an event for Aurora DB engines, see [Subscribing to Amazon RDS event notification] +// in the Amazon Aurora User Guide. +// +// [Subscribing to Amazon RDS event notification]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Subscribing.html +func (c *Client) CreateEventSubscription(ctx context.Context, params *CreateEventSubscriptionInput, optFns ...func(*Options)) (*CreateEventSubscriptionOutput, error) { + if params == nil { + params = &CreateEventSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEventSubscription", params, optFns, c.addOperationCreateEventSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEventSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEventSubscriptionInput struct { + + // The Amazon Resource Name (ARN) of the SNS topic created for event notification. + // SNS automatically creates the ARN when you create a topic and subscribe to it. + // + // RDS doesn't support FIFO (first in, first out) topics. For more information, + // see [Message ordering and deduplication (FIFO topics)]in the Amazon Simple Notification Service Developer Guide. + // + // [Message ordering and deduplication (FIFO topics)]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html + // + // This member is required. + SnsTopicArn *string + + // The name of the subscription. + // + // Constraints: The name must be less than 255 characters. + // + // This member is required. + SubscriptionName *string + + // Specifies whether to activate the subscription. If the event notification + // subscription isn't activated, the subscription is created but not active. + Enabled *bool + + // A list of event categories for a particular source type ( SourceType ) that you + // want to subscribe to. You can see a list of the categories for a given source + // type in the "Amazon RDS event categories and event messages" section of the [Amazon RDS User Guide]or + // the [Amazon Aurora User Guide]. You can also see this list by using the DescribeEventCategories operation. + // + // [Amazon RDS User Guide]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html + // [Amazon Aurora User Guide]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html + EventCategories []string + + // The list of identifiers of the event sources for which events are returned. If + // not specified, then all sources are included in the response. An identifier must + // begin with a letter and must contain only ASCII letters, digits, and hyphens. It + // can't end with a hyphen or contain two consecutive hyphens. + // + // Constraints: + // + // - If SourceIds are supplied, SourceType must also be provided. + // + // - If the source type is a DB instance, a DBInstanceIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster, a DBClusterIdentifier value must be + // supplied. + // + // - If the source type is a DB parameter group, a DBParameterGroupName value + // must be supplied. + // + // - If the source type is a DB security group, a DBSecurityGroupName value must + // be supplied. + // + // - If the source type is a DB snapshot, a DBSnapshotIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier + // value must be supplied. + // + // - If the source type is an RDS Proxy, a DBProxyName value must be supplied. + SourceIds []string + + // The type of source that is generating the events. For example, if you want to + // be notified of events generated by a DB instance, you set this parameter to + // db-instance . For RDS Proxy events, specify db-proxy . If this value isn't + // specified, all events are returned. + // + // Valid Values: db-instance | db-cluster | db-parameter-group | db-security-group + // | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | + // custom-engine-version | blue-green-deployment + SourceType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateEventSubscriptionOutput struct { + + // Contains the results of a successful invocation of the + // DescribeEventSubscriptions action. + EventSubscription *types.EventSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEventSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateEventSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateEventSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEventSubscription"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateEventSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEventSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateEventSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateEventSubscription", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateGlobalCluster.go new file mode 100644 index 00000000..924f2002 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateGlobalCluster.go @@ -0,0 +1,249 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Aurora global database spread across multiple Amazon Web Services +// Regions. The global database contains a single primary cluster with read-write +// capability, and a read-only secondary cluster that receives data from the +// primary cluster through high-speed replication performed by the Aurora storage +// subsystem. +// +// You can create a global database that is initially empty, and then create the +// primary and secondary DB clusters in the global database. Or you can specify an +// existing Aurora cluster during the create operation, and this cluster becomes +// the primary cluster of the global database. +// +// This operation applies only to Aurora DB clusters. +func (c *Client) CreateGlobalCluster(ctx context.Context, params *CreateGlobalClusterInput, optFns ...func(*Options)) (*CreateGlobalClusterOutput, error) { + if params == nil { + params = &CreateGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateGlobalCluster", params, optFns, c.addOperationCreateGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateGlobalClusterInput struct { + + // The name for your database of up to 64 alphanumeric characters. If you don't + // specify a name, Amazon Aurora doesn't create a database in the global database + // cluster. + // + // Constraints: + // + // - Can't be specified if SourceDBClusterIdentifier is specified. In this case, + // Amazon Aurora uses the database name from the source DB cluster. + DatabaseName *string + + // Specifies whether to enable deletion protection for the new global database + // cluster. The global database can't be deleted when deletion protection is + // enabled. + DeletionProtection *bool + + // The database engine to use for this global database cluster. + // + // Valid Values: aurora-mysql | aurora-postgresql + // + // Constraints: + // + // - Can't be specified if SourceDBClusterIdentifier is specified. In this case, + // Amazon Aurora uses the engine of the source DB cluster. + Engine *string + + // The life cycle type for this global database cluster. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your global cluster into Amazon RDS Extended Support. At the end of + // standard support, you can avoid charges for Extended Support by setting the + // value to open-source-rds-extended-support-disabled . In this case, creating the + // global cluster will fail if the DB major version is past its end of standard + // support date. + // + // This setting only applies to Aurora PostgreSQL-based global databases. + // + // You can use this setting to enroll your global cluster into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your global cluster past the end of standard support for that engine + // version. For more information, see [Using Amazon RDS Extended Support]in the Amazon Aurora User Guide. + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/extended-support.html + EngineLifecycleSupport *string + + // The engine version to use for this global database cluster. + // + // Constraints: + // + // - Can't be specified if SourceDBClusterIdentifier is specified. In this case, + // Amazon Aurora uses the engine version of the source DB cluster. + EngineVersion *string + + // The cluster identifier for this global database cluster. This parameter is + // stored as a lowercase string. + GlobalClusterIdentifier *string + + // The Amazon Resource Name (ARN) to use as the primary cluster of the global + // database. + // + // If you provide a value for this parameter, don't specify values for the + // following settings because Amazon Aurora uses the values from the specified + // source DB cluster: + // + // - DatabaseName + // + // - Engine + // + // - EngineVersion + // + // - StorageEncrypted + SourceDBClusterIdentifier *string + + // Specifies whether to enable storage encryption for the new global database + // cluster. + // + // Constraints: + // + // - Can't be specified if SourceDBClusterIdentifier is specified. In this case, + // Amazon Aurora uses the setting from the source DB cluster. + StorageEncrypted *bool + + // Tags to assign to the global cluster. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateIntegration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateIntegration.go new file mode 100644 index 00000000..9d5e3146 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateIntegration.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a zero-ETL integration with Amazon Redshift. +func (c *Client) CreateIntegration(ctx context.Context, params *CreateIntegrationInput, optFns ...func(*Options)) (*CreateIntegrationOutput, error) { + if params == nil { + params = &CreateIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateIntegration", params, optFns, c.addOperationCreateIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateIntegrationInput struct { + + // The name of the integration. + // + // This member is required. + IntegrationName *string + + // The Amazon Resource Name (ARN) of the database to use as the source for + // replication. + // + // This member is required. + SourceArn *string + + // The ARN of the Redshift data warehouse to use as the target for replication. + // + // This member is required. + TargetArn *string + + // An optional set of non-secret key–value pairs that contains additional + // contextual information about the data. For more information, see [Encryption context]in the Amazon + // Web Services Key Management Service Developer Guide. + // + // You can only include this parameter if you specify the KMSKeyId parameter. + // + // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + AdditionalEncryptionContext map[string]string + + // Data filtering options for the integration. For more information, see [Data filtering for Aurora zero-ETL integrations with Amazon Redshift]. + // + // Valid for: Integrations with Aurora MySQL source DB clusters only + // + // [Data filtering for Aurora zero-ETL integrations with Amazon Redshift]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/zero-etl.filtering.html + DataFilter *string + + // A description of the integration. + Description *string + + // The Amazon Web Services Key Management System (Amazon Web Services KMS) key + // identifier for the key to use to encrypt the integration. If you don't specify + // an encryption key, RDS uses a default Amazon Web Services owned key. + KMSKeyId *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +// A zero-ETL integration with Amazon Redshift. +type CreateIntegrationOutput struct { + + // The encryption context for the integration. For more information, see [Encryption context] in the + // Amazon Web Services Key Management Service Developer Guide. + // + // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + AdditionalEncryptionContext map[string]string + + // The time when the integration was created, in Universal Coordinated Time (UTC). + CreateTime *time.Time + + // Data filters for the integration. These filters determine which tables from the + // source database are sent to the target Amazon Redshift data warehouse. + DataFilter *string + + // A description of the integration. + Description *string + + // Any errors associated with the integration. + Errors []types.IntegrationError + + // The ARN of the integration. + IntegrationArn *string + + // The name of the integration. + IntegrationName *string + + // The Amazon Web Services Key Management System (Amazon Web Services KMS) key + // identifier for the key used to to encrypt the integration. + KMSKeyId *string + + // The Amazon Resource Name (ARN) of the database used as the source for + // replication. + SourceArn *string + + // The current status of the integration. + Status types.IntegrationStatus + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The ARN of the Redshift data warehouse used as the target for replication. + TargetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateIntegration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateIntegration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateIntegration", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateOptionGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateOptionGroup.go new file mode 100644 index 00000000..890e4db2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateOptionGroup.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new option group. You can create up to 20 option groups. +// +// This command doesn't apply to RDS Custom. +func (c *Client) CreateOptionGroup(ctx context.Context, params *CreateOptionGroupInput, optFns ...func(*Options)) (*CreateOptionGroupOutput, error) { + if params == nil { + params = &CreateOptionGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateOptionGroup", params, optFns, c.addOperationCreateOptionGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateOptionGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateOptionGroupInput struct { + + // The name of the engine to associate this option group with. + // + // Valid Values: + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // This member is required. + EngineName *string + + // Specifies the major version of the engine that this option group should be + // associated with. + // + // This member is required. + MajorEngineVersion *string + + // The description of the option group. + // + // This member is required. + OptionGroupDescription *string + + // Specifies the name of the option group to be created. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: myoptiongroup + // + // This member is required. + OptionGroupName *string + + // Tags to assign to the option group. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateOptionGroupOutput struct { + + // + OptionGroup *types.OptionGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateOptionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateOptionGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateOptionGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOptionGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateOptionGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOptionGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateOptionGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateOptionGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateTenantDatabase.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateTenantDatabase.go new file mode 100644 index 00000000..74e70801 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_CreateTenantDatabase.go @@ -0,0 +1,211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a tenant database in a DB instance that uses the multi-tenant +// configuration. Only RDS for Oracle container database (CDB) instances are +// supported. +func (c *Client) CreateTenantDatabase(ctx context.Context, params *CreateTenantDatabaseInput, optFns ...func(*Options)) (*CreateTenantDatabaseOutput, error) { + if params == nil { + params = &CreateTenantDatabaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTenantDatabase", params, optFns, c.addOperationCreateTenantDatabaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTenantDatabaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTenantDatabaseInput struct { + + // The user-supplied DB instance identifier. RDS creates your tenant database in + // this DB instance. This parameter isn't case-sensitive. + // + // This member is required. + DBInstanceIdentifier *string + + // The password for the master user in your tenant database. + // + // Constraints: + // + // - Must be 8 to 30 characters. + // + // - Can include any printable ASCII character except forward slash ( / ), double + // quote ( " ), at symbol ( @ ), ampersand ( & ), or single quote ( ' ). + // + // This member is required. + MasterUserPassword *string + + // The name for the master user account in your tenant database. RDS creates this + // user account in the tenant database and grants privileges to the master user. + // This parameter is case-sensitive. + // + // Constraints: + // + // - Must be 1 to 16 letters, numbers, or underscores. + // + // - First character must be a letter. + // + // - Can't be a reserved word for the chosen database engine. + // + // This member is required. + MasterUsername *string + + // The user-supplied name of the tenant database that you want to create in your + // DB instance. This parameter has the same constraints as DBName in + // CreateDBInstance . + // + // This member is required. + TenantDBName *string + + // The character set for your tenant database. If you don't specify a value, the + // character set name defaults to AL32UTF8 . + CharacterSetName *string + + // The NCHAR value for the tenant database. + NcharCharacterSetName *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateTenantDatabaseOutput struct { + + // A tenant database in the DB instance. This data type is an element in the + // response to the DescribeTenantDatabases action. + TenantDatabase *types.TenantDatabase + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTenantDatabaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateTenantDatabase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateTenantDatabase{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTenantDatabase"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateTenantDatabaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTenantDatabase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTenantDatabase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTenantDatabase", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteBlueGreenDeployment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteBlueGreenDeployment.go new file mode 100644 index 00000000..aaff5528 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteBlueGreenDeployment.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a blue/green deployment. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +func (c *Client) DeleteBlueGreenDeployment(ctx context.Context, params *DeleteBlueGreenDeploymentInput, optFns ...func(*Options)) (*DeleteBlueGreenDeploymentOutput, error) { + if params == nil { + params = &DeleteBlueGreenDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteBlueGreenDeployment", params, optFns, c.addOperationDeleteBlueGreenDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteBlueGreenDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteBlueGreenDeploymentInput struct { + + // The unique identifier of the blue/green deployment to delete. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must match an existing blue/green deployment identifier. + // + // This member is required. + BlueGreenDeploymentIdentifier *string + + // Specifies whether to delete the resources in the green environment. You can't + // specify this option if the blue/green deployment [status]is SWITCHOVER_COMPLETED . + // + // [status]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_BlueGreenDeployment.html + DeleteTarget *bool + + noSmithyDocumentSerde +} + +type DeleteBlueGreenDeploymentOutput struct { + + // Details about a blue/green deployment. + // + // For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon + // Aurora User Guide. + // + // [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html + BlueGreenDeployment *types.BlueGreenDeployment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteBlueGreenDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBlueGreenDeployment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteBlueGreenDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBlueGreenDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteBlueGreenDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteBlueGreenDeployment", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteCustomDBEngineVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteCustomDBEngineVersion.go new file mode 100644 index 00000000..d2184399 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteCustomDBEngineVersion.go @@ -0,0 +1,351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Deletes a custom engine version. To run this command, make sure you meet the +// following prerequisites: +// +// - The CEV must not be the default for RDS Custom. If it is, change the +// default before running this command. +// +// - The CEV must not be associated with an RDS Custom DB instance, RDS Custom +// instance snapshot, or automated backup of your RDS Custom instance. +// +// Typically, deletion takes a few minutes. +// +// The MediaImport service that imports files from Amazon S3 to create CEVs isn't +// integrated with Amazon Web Services CloudTrail. If you turn on data logging for +// Amazon RDS in CloudTrail, calls to the DeleteCustomDbEngineVersion event aren't +// logged. However, you might see calls from the API gateway that accesses your +// Amazon S3 bucket. These calls originate from the MediaImport service for the +// DeleteCustomDbEngineVersion event. +// +// For more information, see [Deleting a CEV] in the Amazon RDS User Guide. +// +// [Deleting a CEV]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.html#custom-cev.delete +func (c *Client) DeleteCustomDBEngineVersion(ctx context.Context, params *DeleteCustomDBEngineVersionInput, optFns ...func(*Options)) (*DeleteCustomDBEngineVersionOutput, error) { + if params == nil { + params = &DeleteCustomDBEngineVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCustomDBEngineVersion", params, optFns, c.addOperationDeleteCustomDBEngineVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCustomDBEngineVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCustomDBEngineVersionInput struct { + + // The database engine. RDS Custom for Oracle supports the following values: + // + // - custom-oracle-ee + // + // - custom-oracle-ee-cdb + // + // - custom-oracle-se2 + // + // - custom-oracle-se2-cdb + // + // This member is required. + Engine *string + + // The custom engine version (CEV) for your DB instance. This option is required + // for RDS Custom, but optional for Amazon RDS. The combination of Engine and + // EngineVersion is unique per customer per Amazon Web Services Region. + // + // This member is required. + EngineVersion *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the action +// DescribeDBEngineVersions . +type DeleteCustomDBEngineVersionOutput struct { + + // The creation time of the DB engine version. + CreateTime *time.Time + + // JSON string that lists the installation files and parameters that RDS Custom + // uses to create a custom engine version (CEV). RDS Custom applies the patches in + // the order in which they're listed in the manifest. You can set the Oracle home, + // Oracle base, and UNIX/Linux user and group using the installation parameters. + // For more information, see [JSON fields in the CEV manifest]in the Amazon RDS User Guide. + // + // [JSON fields in the CEV manifest]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.preparing.html#custom-cev.preparing.manifest.fields + CustomDBEngineVersionManifest *string + + // The description of the database engine. + DBEngineDescription *string + + // A value that indicates the source media provider of the AMI based on the usage + // operation. Applicable for RDS Custom for SQL Server. + DBEngineMediaType *string + + // The ARN of the custom engine version. + DBEngineVersionArn *string + + // The description of the database engine version. + DBEngineVersionDescription *string + + // The name of the DB parameter group family for the database engine. + DBParameterGroupFamily *string + + // The name of the Amazon S3 bucket that contains your database installation files. + DatabaseInstallationFilesS3BucketName *string + + // The Amazon S3 directory that contains the database installation files. If not + // specified, then no prefix is assumed. + DatabaseInstallationFilesS3Prefix *string + + // The default character set for new instances of this engine version, if the + // CharacterSetName parameter of the CreateDBInstance API isn't specified. + DefaultCharacterSet *types.CharacterSet + + // The name of the database engine. + Engine *string + + // The version number of the database engine. + EngineVersion *string + + // The types of logs that the database engine has available for export to + // CloudWatch Logs. + ExportableLogTypes []string + + // The EC2 image + Image *types.CustomDBEngineVersionAMI + + // The Amazon Web Services KMS key identifier for an encrypted CEV. This parameter + // is required for RDS Custom, but optional for Amazon RDS. + KMSKeyId *string + + // The major engine version of the CEV. + MajorEngineVersion *string + + // Specifies any Aurora Serverless v2 properties or limits that differ between + // Aurora engine versions. You can test the values of this attribute when deciding + // which Aurora version to use in a new or upgraded DB cluster. You can also + // retrieve the version of an existing DB cluster and check whether that version + // supports certain Aurora Serverless v2 features before you attempt to use those + // features. + ServerlessV2FeaturesSupport *types.ServerlessV2FeaturesSupport + + // The status of the DB engine version, either available or deprecated . + Status *string + + // A list of the supported CA certificate identifiers. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + SupportedCACertificateIdentifiers []string + + // A list of the character sets supported by this engine for the CharacterSetName + // parameter of the CreateDBInstance operation. + SupportedCharacterSets []types.CharacterSet + + // A list of the supported DB engine modes. + SupportedEngineModes []string + + // A list of features supported by the DB engine. + // + // The supported features vary by DB engine and DB engine version. + // + // To determine the supported features for a specific DB engine and DB engine + // version using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine --engine-version + // + // For example, to determine the supported features for RDS for PostgreSQL version + // 13.3 using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine postgres --engine-version 13.3 + // + // The supported features are listed under SupportedFeatureNames in the output. + SupportedFeatureNames []string + + // A list of the character sets supported by the Oracle DB engine for the + // NcharCharacterSetName parameter of the CreateDBInstance operation. + SupportedNcharCharacterSets []types.CharacterSet + + // A list of the time zones supported by this engine for the Timezone parameter of + // the CreateDBInstance action. + SupportedTimezones []types.Timezone + + // Indicates whether the engine version supports Babelfish for Aurora PostgreSQL. + SupportsBabelfish *bool + + // Indicates whether the engine version supports rotating the server certificate + // without rebooting the DB instance. + SupportsCertificateRotationWithoutRestart *bool + + // Indicates whether you can use Aurora global databases with a specific DB engine + // version. + SupportsGlobalDatabases *bool + + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. + SupportsIntegrations *bool + + // Indicates whether the DB engine version supports Aurora Limitless Database. + SupportsLimitlessDatabase *bool + + // Indicates whether the DB engine version supports forwarding write operations + // from reader DB instances to the writer DB instance in the DB cluster. By + // default, write operations aren't allowed on reader DB instances. + // + // Valid for: Aurora DB clusters only + SupportsLocalWriteForwarding *bool + + // Indicates whether the engine version supports exporting the log types specified + // by ExportableLogTypes to CloudWatch Logs. + SupportsLogExportsToCloudwatchLogs *bool + + // Indicates whether you can use Aurora parallel query with a specific DB engine + // version. + SupportsParallelQuery *bool + + // Indicates whether the database engine version supports read replicas. + SupportsReadReplica *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // A list of engine versions that this database engine version can be upgraded to. + ValidUpgradeTarget []types.UpgradeTarget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCustomDBEngineVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCustomDBEngineVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCustomDBEngineVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomDBEngineVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCustomDBEngineVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCustomDBEngineVersion", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBCluster.go new file mode 100644 index 00000000..5941811c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBCluster.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// The DeleteDBCluster action deletes a previously provisioned DB cluster. When +// you delete a DB cluster, all automated backups for that DB cluster are deleted +// and can't be recovered. Manual DB cluster snapshots of the specified DB cluster +// are not deleted. +// +// If you're deleting a Multi-AZ DB cluster with read replicas, all cluster +// members are terminated and read replicas are promoted to standalone instances. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DeleteDBCluster(ctx context.Context, params *DeleteDBClusterInput, optFns ...func(*Options)) (*DeleteDBClusterOutput, error) { + if params == nil { + params = &DeleteDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBCluster", params, optFns, c.addOperationDeleteDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBClusterInput struct { + + // The DB cluster identifier for the DB cluster to be deleted. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must match an existing DBClusterIdentifier. + // + // This member is required. + DBClusterIdentifier *string + + // Specifies whether to remove automated backups immediately after the DB cluster + // is deleted. This parameter isn't case-sensitive. The default is to remove + // automated backups immediately after the DB cluster is deleted. + DeleteAutomatedBackups *bool + + // The DB cluster snapshot identifier of the new DB cluster snapshot created when + // SkipFinalSnapshot is disabled. + // + // If you specify this parameter and also skip the creation of a final DB cluster + // snapshot with the SkipFinalShapshot parameter, the request results in an error. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + FinalDBSnapshotIdentifier *string + + // Specifies whether to skip the creation of a final DB cluster snapshot before + // RDS deletes the DB cluster. If you set this value to true , RDS doesn't create a + // final DB cluster snapshot. If you set this value to false or don't specify it, + // RDS creates a DB cluster snapshot before it deletes the DB cluster. By default, + // this parameter is disabled, so RDS creates a final DB cluster snapshot. + // + // If SkipFinalSnapshot is disabled, you must specify a value for the + // FinalDBSnapshotIdentifier parameter. + SkipFinalSnapshot *bool + + noSmithyDocumentSerde +} + +type DeleteDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterAutomatedBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterAutomatedBackup.go new file mode 100644 index 00000000..a20a778e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterAutomatedBackup.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes automated backups using the DbClusterResourceId value of the source DB +// cluster or the Amazon Resource Name (ARN) of the automated backups. +func (c *Client) DeleteDBClusterAutomatedBackup(ctx context.Context, params *DeleteDBClusterAutomatedBackupInput, optFns ...func(*Options)) (*DeleteDBClusterAutomatedBackupOutput, error) { + if params == nil { + params = &DeleteDBClusterAutomatedBackupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterAutomatedBackup", params, optFns, c.addOperationDeleteDBClusterAutomatedBackupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBClusterAutomatedBackupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBClusterAutomatedBackupInput struct { + + // The identifier for the source DB cluster, which can't be changed and which is + // unique to an Amazon Web Services Region. + // + // This member is required. + DbClusterResourceId *string + + noSmithyDocumentSerde +} + +type DeleteDBClusterAutomatedBackupOutput struct { + + // An automated backup of a DB cluster. It consists of system backups, transaction + // logs, and the database cluster properties that existed at the time you deleted + // the source cluster. + DBClusterAutomatedBackup *types.DBClusterAutomatedBackup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBClusterAutomatedBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterAutomatedBackup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterAutomatedBackup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBClusterAutomatedBackup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBClusterAutomatedBackupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterAutomatedBackup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBClusterAutomatedBackup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBClusterAutomatedBackup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterEndpoint.go new file mode 100644 index 00000000..56079aaf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterEndpoint.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a custom endpoint and removes it from an Amazon Aurora DB cluster. +// +// This action only applies to Aurora DB clusters. +func (c *Client) DeleteDBClusterEndpoint(ctx context.Context, params *DeleteDBClusterEndpointInput, optFns ...func(*Options)) (*DeleteDBClusterEndpointOutput, error) { + if params == nil { + params = &DeleteDBClusterEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterEndpoint", params, optFns, c.addOperationDeleteDBClusterEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBClusterEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBClusterEndpointInput struct { + + // The identifier associated with the custom endpoint. This parameter is stored as + // a lowercase string. + // + // This member is required. + DBClusterEndpointIdentifier *string + + noSmithyDocumentSerde +} + +// This data type represents the information you need to connect to an Amazon +// Aurora DB cluster. This data type is used as a response element in the following +// actions: +// +// - CreateDBClusterEndpoint +// +// - DescribeDBClusterEndpoints +// +// - ModifyDBClusterEndpoint +// +// - DeleteDBClusterEndpoint +// +// For the data structure that represents Amazon RDS DB instance endpoints, see +// Endpoint . +type DeleteDBClusterEndpointOutput struct { + + // The type associated with a custom endpoint. One of: READER , WRITER , ANY . + CustomEndpointType *string + + // The Amazon Resource Name (ARN) for the endpoint. + DBClusterEndpointArn *string + + // The identifier associated with the endpoint. This parameter is stored as a + // lowercase string. + DBClusterEndpointIdentifier *string + + // A unique system-generated identifier for an endpoint. It remains the same for + // the whole life of the endpoint. + DBClusterEndpointResourceIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + DBClusterIdentifier *string + + // The DNS address of the endpoint. + Endpoint *string + + // The type of the endpoint. One of: READER , WRITER , CUSTOM . + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. Only + // relevant if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + // The current status of the endpoint. One of: creating , available , deleting , + // inactive , modifying . The inactive state applies to an endpoint that can't be + // used for a certain kind of cluster, such as a writer endpoint for a read-only + // secondary cluster in a global database. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBClusterEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBClusterEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBClusterEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBClusterEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBClusterEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterParameterGroup.go new file mode 100644 index 00000000..6be02e69 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterParameterGroup.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a specified DB cluster parameter group. The DB cluster parameter group +// to be deleted can't be associated with any DB clusters. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DeleteDBClusterParameterGroup(ctx context.Context, params *DeleteDBClusterParameterGroupInput, optFns ...func(*Options)) (*DeleteDBClusterParameterGroupOutput, error) { + if params == nil { + params = &DeleteDBClusterParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterParameterGroup", params, optFns, c.addOperationDeleteDBClusterParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBClusterParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBClusterParameterGroupInput struct { + + // The name of the DB cluster parameter group. + // + // Constraints: + // + // - Must be the name of an existing DB cluster parameter group. + // + // - You can't delete a default DB cluster parameter group. + // + // - Can't be associated with any DB clusters. + // + // This member is required. + DBClusterParameterGroupName *string + + noSmithyDocumentSerde +} + +type DeleteDBClusterParameterGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBClusterParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBClusterParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBClusterParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterSnapshot.go new file mode 100644 index 00000000..3f7fde12 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBClusterSnapshot.go @@ -0,0 +1,173 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a DB cluster snapshot. If the snapshot is being copied, the copy +// operation is terminated. +// +// The DB cluster snapshot must be in the available state to be deleted. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DeleteDBClusterSnapshot(ctx context.Context, params *DeleteDBClusterSnapshotInput, optFns ...func(*Options)) (*DeleteDBClusterSnapshotOutput, error) { + if params == nil { + params = &DeleteDBClusterSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterSnapshot", params, optFns, c.addOperationDeleteDBClusterSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBClusterSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBClusterSnapshotInput struct { + + // The identifier of the DB cluster snapshot to delete. + // + // Constraints: Must be the name of an existing DB cluster snapshot in the + // available state. + // + // This member is required. + DBClusterSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteDBClusterSnapshotOutput struct { + + // Contains the details for an Amazon RDS DB cluster snapshot + // + // This data type is used as a response element in the DescribeDBClusterSnapshots + // action. + DBClusterSnapshot *types.DBClusterSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBClusterSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBClusterSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBClusterSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstance.go new file mode 100644 index 00000000..e2686378 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstance.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a previously provisioned DB instance. When you delete a DB instance, +// all automated backups for that instance are deleted and can't be recovered. +// However, manual DB snapshots of the DB instance aren't deleted. +// +// If you request a final DB snapshot, the status of the Amazon RDS DB instance is +// deleting until the DB snapshot is created. This operation can't be canceled or +// reverted after it begins. To monitor the status of this operation, use +// DescribeDBInstance . +// +// When a DB instance is in a failure state and has a status of failed , +// incompatible-restore , or incompatible-network , you can only delete it when you +// skip creation of the final snapshot with the SkipFinalSnapshot parameter. +// +// If the specified DB instance is part of an Amazon Aurora DB cluster, you can't +// delete the DB instance if both of the following conditions are true: +// +// - The DB cluster is a read replica of another Amazon Aurora DB cluster. +// +// - The DB instance is the only instance in the DB cluster. +// +// To delete a DB instance in this case, first use the PromoteReadReplicaDBCluster +// operation to promote the DB cluster so that it's no longer a read replica. After +// the promotion completes, use the DeleteDBInstance operation to delete the final +// instance in the DB cluster. +// +// For RDS Custom DB instances, deleting the DB instance permanently deletes the +// EC2 instance and the associated EBS volumes. Make sure that you don't terminate +// or delete these resources before you delete the DB instance. Otherwise, deleting +// the DB instance and creation of the final snapshot might fail. +func (c *Client) DeleteDBInstance(ctx context.Context, params *DeleteDBInstanceInput, optFns ...func(*Options)) (*DeleteDBInstanceOutput, error) { + if params == nil { + params = &DeleteDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBInstance", params, optFns, c.addOperationDeleteDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBInstanceInput struct { + + // The DB instance identifier for the DB instance to be deleted. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must match the name of an existing DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + // Specifies whether to remove automated backups immediately after the DB instance + // is deleted. This parameter isn't case-sensitive. The default is to remove + // automated backups immediately after the DB instance is deleted. + DeleteAutomatedBackups *bool + + // The DBSnapshotIdentifier of the new DBSnapshot created when the + // SkipFinalSnapshot parameter is disabled. + // + // If you enable this parameter and also enable SkipFinalShapshot, the command + // results in an error. + // + // This setting doesn't apply to RDS Custom. + // + // Constraints: + // + // - Must be 1 to 255 letters or numbers. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // - Can't be specified when deleting a read replica. + FinalDBSnapshotIdentifier *string + + // Specifies whether to skip the creation of a final DB snapshot before deleting + // the instance. If you enable this parameter, RDS doesn't create a DB snapshot. If + // you don't enable this parameter, RDS creates a DB snapshot before the DB + // instance is deleted. By default, skip isn't enabled, and the DB snapshot is + // created. + // + // If you don't enable this parameter, you must specify the + // FinalDBSnapshotIdentifier parameter. + // + // When a DB instance is in a failure state and has a status of failed , + // incompatible-restore , or incompatible-network , RDS can delete the instance + // only if you enable this parameter. + // + // If you delete a read replica or an RDS Custom instance, you must enable this + // setting. + // + // This setting is required for RDS Custom. + SkipFinalSnapshot *bool + + noSmithyDocumentSerde +} + +type DeleteDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstanceAutomatedBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstanceAutomatedBackup.go new file mode 100644 index 00000000..26071a41 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBInstanceAutomatedBackup.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes automated backups using the DbiResourceId value of the source DB +// instance or the Amazon Resource Name (ARN) of the automated backups. +func (c *Client) DeleteDBInstanceAutomatedBackup(ctx context.Context, params *DeleteDBInstanceAutomatedBackupInput, optFns ...func(*Options)) (*DeleteDBInstanceAutomatedBackupOutput, error) { + if params == nil { + params = &DeleteDBInstanceAutomatedBackupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBInstanceAutomatedBackup", params, optFns, c.addOperationDeleteDBInstanceAutomatedBackupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBInstanceAutomatedBackupOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Parameter input for the DeleteDBInstanceAutomatedBackup operation. +type DeleteDBInstanceAutomatedBackupInput struct { + + // The Amazon Resource Name (ARN) of the automated backups to delete, for example, + // arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE . + // + // This setting doesn't apply to RDS Custom. + DBInstanceAutomatedBackupsArn *string + + // The identifier for the source DB instance, which can't be changed and which is + // unique to an Amazon Web Services Region. + DbiResourceId *string + + noSmithyDocumentSerde +} + +type DeleteDBInstanceAutomatedBackupOutput struct { + + // An automated backup of a DB instance. It consists of system backups, + // transaction logs, and the database instance properties that existed at the time + // you deleted the source instance. + DBInstanceAutomatedBackup *types.DBInstanceAutomatedBackup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBInstanceAutomatedBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBInstanceAutomatedBackup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBInstanceAutomatedBackup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBInstanceAutomatedBackup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBInstanceAutomatedBackup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBInstanceAutomatedBackup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBInstanceAutomatedBackup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBParameterGroup.go new file mode 100644 index 00000000..b5330fba --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBParameterGroup.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a specified DB parameter group. The DB parameter group to be deleted +// can't be associated with any DB instances. +func (c *Client) DeleteDBParameterGroup(ctx context.Context, params *DeleteDBParameterGroupInput, optFns ...func(*Options)) (*DeleteDBParameterGroupOutput, error) { + if params == nil { + params = &DeleteDBParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBParameterGroup", params, optFns, c.addOperationDeleteDBParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBParameterGroupInput struct { + + // The name of the DB parameter group. + // + // Constraints: + // + // - Must be the name of an existing DB parameter group + // + // - You can't delete a default DB parameter group + // + // - Can't be associated with any DB instances + // + // This member is required. + DBParameterGroupName *string + + noSmithyDocumentSerde +} + +type DeleteDBParameterGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxy.go new file mode 100644 index 00000000..28d09303 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxy.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an existing DB proxy. +func (c *Client) DeleteDBProxy(ctx context.Context, params *DeleteDBProxyInput, optFns ...func(*Options)) (*DeleteDBProxyOutput, error) { + if params == nil { + params = &DeleteDBProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBProxy", params, optFns, c.addOperationDeleteDBProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBProxyInput struct { + + // The name of the DB proxy to delete. + // + // This member is required. + DBProxyName *string + + noSmithyDocumentSerde +} + +type DeleteDBProxyOutput struct { + + // The data structure representing the details of the DB proxy that you delete. + DBProxy *types.DBProxy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBProxy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBProxy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBProxy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxyEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxyEndpoint.go new file mode 100644 index 00000000..04ef02e3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBProxyEndpoint.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a DBProxyEndpoint . Doing so removes the ability to access the DB proxy +// using the endpoint that you defined. The endpoint that you delete might have +// provided capabilities such as read/write or read-only operations, or using a +// different VPC than the DB proxy's default VPC. +func (c *Client) DeleteDBProxyEndpoint(ctx context.Context, params *DeleteDBProxyEndpointInput, optFns ...func(*Options)) (*DeleteDBProxyEndpointOutput, error) { + if params == nil { + params = &DeleteDBProxyEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBProxyEndpoint", params, optFns, c.addOperationDeleteDBProxyEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBProxyEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBProxyEndpointInput struct { + + // The name of the DB proxy endpoint to delete. + // + // This member is required. + DBProxyEndpointName *string + + noSmithyDocumentSerde +} + +type DeleteDBProxyEndpointOutput struct { + + // The data structure representing the details of the DB proxy endpoint that you + // delete. + DBProxyEndpoint *types.DBProxyEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBProxyEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBProxyEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBProxyEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBProxyEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBProxyEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBProxyEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSecurityGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSecurityGroup.go new file mode 100644 index 00000000..03c119cb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSecurityGroup.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a DB security group. +// +// The specified DB security group must not be associated with any DB instances. +// +// EC2-Classic was retired on August 15, 2022. If you haven't migrated from +// EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For +// more information, see [Migrate from EC2-Classic to a VPC]in the Amazon EC2 User Guide, the blog [EC2-Classic Networking is Retiring – Here’s How to Prepare], and [Moving a DB instance not in a VPC into a VPC] in the +// Amazon RDS User Guide. +// +// [Migrate from EC2-Classic to a VPC]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html +// [EC2-Classic Networking is Retiring – Here’s How to Prepare]: http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/ +// [Moving a DB instance not in a VPC into a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html +func (c *Client) DeleteDBSecurityGroup(ctx context.Context, params *DeleteDBSecurityGroupInput, optFns ...func(*Options)) (*DeleteDBSecurityGroupOutput, error) { + if params == nil { + params = &DeleteDBSecurityGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBSecurityGroup", params, optFns, c.addOperationDeleteDBSecurityGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBSecurityGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBSecurityGroupInput struct { + + // The name of the DB security group to delete. + // + // You can't delete the default DB security group. + // + // Constraints: + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // - Must not be "Default" + // + // This member is required. + DBSecurityGroupName *string + + noSmithyDocumentSerde +} + +type DeleteDBSecurityGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBSecurityGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBSecurityGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBSecurityGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBSecurityGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBSecurityGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBSecurityGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBSecurityGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBSecurityGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBShardGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBShardGroup.go new file mode 100644 index 00000000..7ecab912 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBShardGroup.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Aurora Limitless Database DB shard group. +func (c *Client) DeleteDBShardGroup(ctx context.Context, params *DeleteDBShardGroupInput, optFns ...func(*Options)) (*DeleteDBShardGroupOutput, error) { + if params == nil { + params = &DeleteDBShardGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBShardGroup", params, optFns, c.addOperationDeleteDBShardGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBShardGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBShardGroupInput struct { + + // The name of the DB shard group to delete. + // + // This member is required. + DBShardGroupIdentifier *string + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB shard group. +type DeleteDBShardGroupOutput struct { + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The name of the primary DB cluster for the DB shard group. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB shard group. + DBShardGroupArn *string + + // The name of the DB shard group. + DBShardGroupIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB shard + // group. + DBShardGroupResourceId *string + + // The connection endpoint for the DB shard group. + Endpoint *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Indicates whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access isn't permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBShardGroup. + // + // This setting is only for Aurora Limitless Database. + PubliclyAccessible *bool + + // The status of the DB shard group. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBShardGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBShardGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBShardGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBShardGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBShardGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBShardGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBShardGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBShardGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSnapshot.go new file mode 100644 index 00000000..9a957921 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSnapshot.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a DB snapshot. If the snapshot is being copied, the copy operation is +// terminated. +// +// The DB snapshot must be in the available state to be deleted. +func (c *Client) DeleteDBSnapshot(ctx context.Context, params *DeleteDBSnapshotInput, optFns ...func(*Options)) (*DeleteDBSnapshotOutput, error) { + if params == nil { + params = &DeleteDBSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBSnapshot", params, optFns, c.addOperationDeleteDBSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBSnapshotInput struct { + + // The DB snapshot identifier. + // + // Constraints: Must be the name of an existing DB snapshot in the available state. + // + // This member is required. + DBSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteDBSnapshotOutput struct { + + // Contains the details of an Amazon RDS DB snapshot. + // + // This data type is used as a response element in the DescribeDBSnapshots action. + DBSnapshot *types.DBSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSubnetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSubnetGroup.go new file mode 100644 index 00000000..9b07cc06 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteDBSubnetGroup.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a DB subnet group. +// +// The specified database subnet group must not be associated with any DB +// instances. +func (c *Client) DeleteDBSubnetGroup(ctx context.Context, params *DeleteDBSubnetGroupInput, optFns ...func(*Options)) (*DeleteDBSubnetGroupOutput, error) { + if params == nil { + params = &DeleteDBSubnetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDBSubnetGroup", params, optFns, c.addOperationDeleteDBSubnetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDBSubnetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDBSubnetGroupInput struct { + + // The name of the database subnet group to delete. + // + // You can't delete the default subnet group. + // + // Constraints: Must match the name of an existing DBSubnetGroup. Must not be + // default. + // + // Example: mydbsubnetgroup + // + // This member is required. + DBSubnetGroupName *string + + noSmithyDocumentSerde +} + +type DeleteDBSubnetGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDBSubnetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDBSubnetGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDBSubnetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBSubnetGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDBSubnetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDBSubnetGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteEventSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteEventSubscription.go new file mode 100644 index 00000000..f29bad65 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteEventSubscription.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an RDS event notification subscription. +func (c *Client) DeleteEventSubscription(ctx context.Context, params *DeleteEventSubscriptionInput, optFns ...func(*Options)) (*DeleteEventSubscriptionOutput, error) { + if params == nil { + params = &DeleteEventSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEventSubscription", params, optFns, c.addOperationDeleteEventSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEventSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEventSubscriptionInput struct { + + // The name of the RDS event notification subscription you want to delete. + // + // This member is required. + SubscriptionName *string + + noSmithyDocumentSerde +} + +type DeleteEventSubscriptionOutput struct { + + // Contains the results of a successful invocation of the + // DescribeEventSubscriptions action. + EventSubscription *types.EventSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEventSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteEventSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteEventSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEventSubscription"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteEventSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEventSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteEventSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteEventSubscription", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteGlobalCluster.go new file mode 100644 index 00000000..b8914232 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteGlobalCluster.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a global database cluster. The primary and secondary clusters must +// already be detached or destroyed first. +// +// This action only applies to Aurora DB clusters. +func (c *Client) DeleteGlobalCluster(ctx context.Context, params *DeleteGlobalClusterInput, optFns ...func(*Options)) (*DeleteGlobalClusterOutput, error) { + if params == nil { + params = &DeleteGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteGlobalCluster", params, optFns, c.addOperationDeleteGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteGlobalClusterInput struct { + + // The cluster identifier of the global database cluster being deleted. + // + // This member is required. + GlobalClusterIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteGlobalClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteIntegration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteIntegration.go new file mode 100644 index 00000000..6c618d17 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteIntegration.go @@ -0,0 +1,204 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Deletes a zero-ETL integration with Amazon Redshift. +func (c *Client) DeleteIntegration(ctx context.Context, params *DeleteIntegrationInput, optFns ...func(*Options)) (*DeleteIntegrationOutput, error) { + if params == nil { + params = &DeleteIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIntegration", params, optFns, c.addOperationDeleteIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIntegrationInput struct { + + // The unique identifier of the integration. + // + // This member is required. + IntegrationIdentifier *string + + noSmithyDocumentSerde +} + +// A zero-ETL integration with Amazon Redshift. +type DeleteIntegrationOutput struct { + + // The encryption context for the integration. For more information, see [Encryption context] in the + // Amazon Web Services Key Management Service Developer Guide. + // + // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + AdditionalEncryptionContext map[string]string + + // The time when the integration was created, in Universal Coordinated Time (UTC). + CreateTime *time.Time + + // Data filters for the integration. These filters determine which tables from the + // source database are sent to the target Amazon Redshift data warehouse. + DataFilter *string + + // A description of the integration. + Description *string + + // Any errors associated with the integration. + Errors []types.IntegrationError + + // The ARN of the integration. + IntegrationArn *string + + // The name of the integration. + IntegrationName *string + + // The Amazon Web Services Key Management System (Amazon Web Services KMS) key + // identifier for the key used to to encrypt the integration. + KMSKeyId *string + + // The Amazon Resource Name (ARN) of the database used as the source for + // replication. + SourceArn *string + + // The current status of the integration. + Status types.IntegrationStatus + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The ARN of the Redshift data warehouse used as the target for replication. + TargetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteIntegration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIntegration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIntegration", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteOptionGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteOptionGroup.go new file mode 100644 index 00000000..68718400 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteOptionGroup.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an existing option group. +func (c *Client) DeleteOptionGroup(ctx context.Context, params *DeleteOptionGroupInput, optFns ...func(*Options)) (*DeleteOptionGroupOutput, error) { + if params == nil { + params = &DeleteOptionGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteOptionGroup", params, optFns, c.addOperationDeleteOptionGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteOptionGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteOptionGroupInput struct { + + // The name of the option group to be deleted. + // + // You can't delete default option groups. + // + // This member is required. + OptionGroupName *string + + noSmithyDocumentSerde +} + +type DeleteOptionGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteOptionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteOptionGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteOptionGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteOptionGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteOptionGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOptionGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteOptionGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteOptionGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteTenantDatabase.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteTenantDatabase.go new file mode 100644 index 00000000..2d31839f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeleteTenantDatabase.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a tenant database from your DB instance. This command only applies to +// RDS for Oracle container database (CDB) instances. +// +// You can't delete a tenant database when it is the only tenant in the DB +// instance. +func (c *Client) DeleteTenantDatabase(ctx context.Context, params *DeleteTenantDatabaseInput, optFns ...func(*Options)) (*DeleteTenantDatabaseOutput, error) { + if params == nil { + params = &DeleteTenantDatabaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTenantDatabase", params, optFns, c.addOperationDeleteTenantDatabaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTenantDatabaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTenantDatabaseInput struct { + + // The user-supplied identifier for the DB instance that contains the tenant + // database that you want to delete. + // + // This member is required. + DBInstanceIdentifier *string + + // The user-supplied name of the tenant database that you want to remove from your + // DB instance. Amazon RDS deletes the tenant database with this name. This + // parameter isn’t case-sensitive. + // + // This member is required. + TenantDBName *string + + // The DBSnapshotIdentifier of the new DBSnapshot created when the + // SkipFinalSnapshot parameter is disabled. + // + // If you enable this parameter and also enable SkipFinalShapshot , the command + // results in an error. + FinalDBSnapshotIdentifier *string + + // Specifies whether to skip the creation of a final DB snapshot before removing + // the tenant database from your DB instance. If you enable this parameter, RDS + // doesn't create a DB snapshot. If you don't enable this parameter, RDS creates a + // DB snapshot before it deletes the tenant database. By default, RDS doesn't skip + // the final snapshot. If you don't enable this parameter, you must specify the + // FinalDBSnapshotIdentifier parameter. + SkipFinalSnapshot *bool + + noSmithyDocumentSerde +} + +type DeleteTenantDatabaseOutput struct { + + // A tenant database in the DB instance. This data type is an element in the + // response to the DescribeTenantDatabases action. + TenantDatabase *types.TenantDatabase + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTenantDatabaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteTenantDatabase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteTenantDatabase{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTenantDatabase"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteTenantDatabaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTenantDatabase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteTenantDatabase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteTenantDatabase", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeregisterDBProxyTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeregisterDBProxyTargets.go new file mode 100644 index 00000000..34f688c7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DeregisterDBProxyTargets.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Remove the association between one or more DBProxyTarget data structures and a +// DBProxyTargetGroup . +func (c *Client) DeregisterDBProxyTargets(ctx context.Context, params *DeregisterDBProxyTargetsInput, optFns ...func(*Options)) (*DeregisterDBProxyTargetsOutput, error) { + if params == nil { + params = &DeregisterDBProxyTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterDBProxyTargets", params, optFns, c.addOperationDeregisterDBProxyTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterDBProxyTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterDBProxyTargetsInput struct { + + // The identifier of the DBProxy that is associated with the DBProxyTargetGroup . + // + // This member is required. + DBProxyName *string + + // One or more DB cluster identifiers. + DBClusterIdentifiers []string + + // One or more DB instance identifiers. + DBInstanceIdentifiers []string + + // The identifier of the DBProxyTargetGroup . + TargetGroupName *string + + noSmithyDocumentSerde +} + +type DeregisterDBProxyTargetsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterDBProxyTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDeregisterDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeregisterDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterDBProxyTargets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeregisterDBProxyTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterDBProxyTargets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeregisterDBProxyTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterDBProxyTargets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeAccountAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeAccountAttributes.go new file mode 100644 index 00000000..42f437a0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeAccountAttributes.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the attributes for a customer account. The attributes include +// Amazon RDS quotas for the account, such as the number of DB instances allowed. +// The description for a quota includes the quota name, current usage toward that +// quota, and the quota's maximum value. +// +// This command doesn't take any parameters. +func (c *Client) DescribeAccountAttributes(ctx context.Context, params *DescribeAccountAttributesInput, optFns ...func(*Options)) (*DescribeAccountAttributesOutput, error) { + if params == nil { + params = &DescribeAccountAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeAccountAttributes", params, optFns, c.addOperationDescribeAccountAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeAccountAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeAccountAttributesInput struct { + noSmithyDocumentSerde +} + +// Data returned by the DescribeAccountAttributes action. +type DescribeAccountAttributesOutput struct { + + // A list of AccountQuota objects. Within this list, each quota has a name, a + // count of usage toward the quota maximum, and a maximum value for the quota. + AccountQuotas []types.AccountQuota + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeAccountAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeAccountAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeAccountAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAccountAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccountAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeAccountAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeAccountAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeBlueGreenDeployments.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeBlueGreenDeployments.go new file mode 100644 index 00000000..f427457c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeBlueGreenDeployments.go @@ -0,0 +1,316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes one or more blue/green deployments. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +func (c *Client) DescribeBlueGreenDeployments(ctx context.Context, params *DescribeBlueGreenDeploymentsInput, optFns ...func(*Options)) (*DescribeBlueGreenDeploymentsOutput, error) { + if params == nil { + params = &DescribeBlueGreenDeploymentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeBlueGreenDeployments", params, optFns, c.addOperationDescribeBlueGreenDeploymentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeBlueGreenDeploymentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeBlueGreenDeploymentsInput struct { + + // The blue/green deployment identifier. If you specify this parameter, the + // response only includes information about the specific blue/green deployment. + // This parameter isn't case-sensitive. + // + // Constraints: + // + // - Must match an existing blue/green deployment identifier. + BlueGreenDeploymentIdentifier *string + + // A filter that specifies one or more blue/green deployments to describe. + // + // Valid Values: + // + // - blue-green-deployment-identifier - Accepts system-generated identifiers for + // blue/green deployments. The results list only includes information about the + // blue/green deployments with the specified identifiers. + // + // - blue-green-deployment-name - Accepts user-supplied names for blue/green + // deployments. The results list only includes information about the blue/green + // deployments with the specified names. + // + // - source - Accepts source databases for a blue/green deployment. The results + // list only includes information about the blue/green deployments with the + // specified source databases. + // + // - target - Accepts target databases for a blue/green deployment. The results + // list only includes information about the blue/green deployments with the + // specified target databases. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeBlueGreenDeployments + // request. If you specify this parameter, the response only includes records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: + // + // - Must be a minimum of 20. + // + // - Can't exceed 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeBlueGreenDeploymentsOutput struct { + + // A list of blue/green deployments in the current account and Amazon Web Services + // Region. + BlueGreenDeployments []types.BlueGreenDeployment + + // A pagination token that can be used in a later DescribeBlueGreenDeployments + // request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeBlueGreenDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeBlueGreenDeployments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeBlueGreenDeployments{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeBlueGreenDeployments"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeBlueGreenDeploymentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBlueGreenDeployments(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeBlueGreenDeploymentsPaginatorOptions is the paginator options for +// DescribeBlueGreenDeployments +type DescribeBlueGreenDeploymentsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: + // + // - Must be a minimum of 20. + // + // - Can't exceed 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeBlueGreenDeploymentsPaginator is a paginator for +// DescribeBlueGreenDeployments +type DescribeBlueGreenDeploymentsPaginator struct { + options DescribeBlueGreenDeploymentsPaginatorOptions + client DescribeBlueGreenDeploymentsAPIClient + params *DescribeBlueGreenDeploymentsInput + nextToken *string + firstPage bool +} + +// NewDescribeBlueGreenDeploymentsPaginator returns a new +// DescribeBlueGreenDeploymentsPaginator +func NewDescribeBlueGreenDeploymentsPaginator(client DescribeBlueGreenDeploymentsAPIClient, params *DescribeBlueGreenDeploymentsInput, optFns ...func(*DescribeBlueGreenDeploymentsPaginatorOptions)) *DescribeBlueGreenDeploymentsPaginator { + if params == nil { + params = &DescribeBlueGreenDeploymentsInput{} + } + + options := DescribeBlueGreenDeploymentsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeBlueGreenDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBlueGreenDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeBlueGreenDeployments page. +func (p *DescribeBlueGreenDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBlueGreenDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeBlueGreenDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeBlueGreenDeploymentsAPIClient is a client that implements the +// DescribeBlueGreenDeployments operation. +type DescribeBlueGreenDeploymentsAPIClient interface { + DescribeBlueGreenDeployments(context.Context, *DescribeBlueGreenDeploymentsInput, ...func(*Options)) (*DescribeBlueGreenDeploymentsOutput, error) +} + +var _ DescribeBlueGreenDeploymentsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeBlueGreenDeployments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeBlueGreenDeployments", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeCertificates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeCertificates.go new file mode 100644 index 00000000..e0481321 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeCertificates.go @@ -0,0 +1,297 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the set of certificate authority (CA) certificates provided by Amazon RDS +// for this Amazon Web Services account. +// +// For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon +// Aurora User Guide. +// +// [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html +// [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html +func (c *Client) DescribeCertificates(ctx context.Context, params *DescribeCertificatesInput, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if params == nil { + params = &DescribeCertificatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCertificates", params, optFns, c.addOperationDescribeCertificatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeCertificatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeCertificatesInput struct { + + // The user-supplied certificate identifier. If this parameter is specified, + // information for only the identified certificate is returned. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must match an existing CertificateIdentifier. + CertificateIdentifier *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeCertificates + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Data returned by the DescribeCertificates action. +type DescribeCertificatesOutput struct { + + // The list of Certificate objects for the Amazon Web Services account. + Certificates []types.Certificate + + // The default root CA for new databases created by your Amazon Web Services + // account. This is either the root CA override set on your Amazon Web Services + // account or the system default CA for the Region if no override exists. To + // override the default CA, use the ModifyCertificates operation. + DefaultCertificateForNewLaunches *string + + // An optional pagination token provided by a previous DescribeCertificates + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeCertificates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeCertificates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCertificates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeCertificatesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCertificates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeCertificatesPaginator is a paginator for DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + if params == nil { + params = &DescribeCertificatesInput{} + } + + options := DescribeCertificatesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeCertificates", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterAutomatedBackups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterAutomatedBackups.go new file mode 100644 index 00000000..80bb0e20 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterAutomatedBackups.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays backups for both current and deleted DB clusters. For example, use +// this operation to find details about automated backups for previously deleted +// clusters. Current clusters are returned for both the +// DescribeDBClusterAutomatedBackups and DescribeDBClusters operations. +// +// All parameters are optional. +func (c *Client) DescribeDBClusterAutomatedBackups(ctx context.Context, params *DescribeDBClusterAutomatedBackupsInput, optFns ...func(*Options)) (*DescribeDBClusterAutomatedBackupsOutput, error) { + if params == nil { + params = &DescribeDBClusterAutomatedBackupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterAutomatedBackups", params, optFns, c.addOperationDescribeDBClusterAutomatedBackupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterAutomatedBackupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterAutomatedBackupsInput struct { + + // (Optional) The user-supplied DB cluster identifier. If this parameter is + // specified, it must match the identifier of an existing DB cluster. It returns + // information from the specific DB cluster's automated backup. This parameter + // isn't case-sensitive. + DBClusterIdentifier *string + + // The resource ID of the DB cluster that is the source of the automated backup. + // This parameter isn't case-sensitive. + DbClusterResourceId *string + + // A filter that specifies which resources to return based on status. + // + // Supported filters are the following: + // + // - status + // + // - retained - Automated backups for deleted clusters and after backup + // replication is stopped. + // + // - db-cluster-id - Accepts DB cluster identifiers and Amazon Resource Names + // (ARNs). The results list includes only information about the DB cluster + // automated backups identified by these ARNs. + // + // - db-cluster-resource-id - Accepts DB resource identifiers and Amazon Resource + // Names (ARNs). The results list includes only information about the DB cluster + // resources identified by these ARNs. + // + // Returns all resources by default. The status for each resource is specified in + // the response. + Filters []types.Filter + + // The pagination token provided in the previous request. If this parameter is + // specified the response includes only records beyond the marker, up to MaxRecords + // . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBClusterAutomatedBackupsOutput struct { + + // A list of DBClusterAutomatedBackup backups. + DBClusterAutomatedBackups []types.DBClusterAutomatedBackup + + // The pagination token provided in the previous request. If this parameter is + // specified the response includes only records beyond the marker, up to MaxRecords + // . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterAutomatedBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterAutomatedBackups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterAutomatedBackups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterAutomatedBackups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterAutomatedBackupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterAutomatedBackups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBClusterAutomatedBackupsPaginatorOptions is the paginator options for +// DescribeDBClusterAutomatedBackups +type DescribeDBClusterAutomatedBackupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterAutomatedBackupsPaginator is a paginator for +// DescribeDBClusterAutomatedBackups +type DescribeDBClusterAutomatedBackupsPaginator struct { + options DescribeDBClusterAutomatedBackupsPaginatorOptions + client DescribeDBClusterAutomatedBackupsAPIClient + params *DescribeDBClusterAutomatedBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterAutomatedBackupsPaginator returns a new +// DescribeDBClusterAutomatedBackupsPaginator +func NewDescribeDBClusterAutomatedBackupsPaginator(client DescribeDBClusterAutomatedBackupsAPIClient, params *DescribeDBClusterAutomatedBackupsInput, optFns ...func(*DescribeDBClusterAutomatedBackupsPaginatorOptions)) *DescribeDBClusterAutomatedBackupsPaginator { + if params == nil { + params = &DescribeDBClusterAutomatedBackupsInput{} + } + + options := DescribeDBClusterAutomatedBackupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterAutomatedBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterAutomatedBackupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterAutomatedBackups page. +func (p *DescribeDBClusterAutomatedBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterAutomatedBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterAutomatedBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterAutomatedBackupsAPIClient is a client that implements the +// DescribeDBClusterAutomatedBackups operation. +type DescribeDBClusterAutomatedBackupsAPIClient interface { + DescribeDBClusterAutomatedBackups(context.Context, *DescribeDBClusterAutomatedBackupsInput, ...func(*Options)) (*DescribeDBClusterAutomatedBackupsOutput, error) +} + +var _ DescribeDBClusterAutomatedBackupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterAutomatedBackups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterAutomatedBackups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterBacktracks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterBacktracks.go new file mode 100644 index 00000000..f2ea96ee --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterBacktracks.go @@ -0,0 +1,330 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about backtracks for a DB cluster. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// This action only applies to Aurora MySQL DB clusters. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +func (c *Client) DescribeDBClusterBacktracks(ctx context.Context, params *DescribeDBClusterBacktracksInput, optFns ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) { + if params == nil { + params = &DescribeDBClusterBacktracksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterBacktracks", params, optFns, c.addOperationDescribeDBClusterBacktracksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterBacktracksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterBacktracksInput struct { + + // The DB cluster identifier of the DB cluster to be described. This parameter is + // stored as a lowercase string. + // + // Constraints: + // + // - Must contain from 1 to 63 alphanumeric characters or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster1 + // + // This member is required. + DBClusterIdentifier *string + + // If specified, this value is the backtrack identifier of the backtrack to be + // described. + // + // Constraints: + // + // - Must contain a valid universally unique identifier (UUID). For more + // information about UUIDs, see [Universally unique identifier]. + // + // Example: 123e4567-e89b-12d3-a456-426655440000 + // + // [Universally unique identifier]: https://en.wikipedia.org/wiki/Universally_unique_identifier + BacktrackIdentifier *string + + // A filter that specifies one or more DB clusters to describe. Supported filters + // include the following: + // + // - db-cluster-backtrack-id - Accepts backtrack identifiers. The results list + // includes information about only the backtracks identified by these identifiers. + // + // - db-cluster-backtrack-status - Accepts any of the following backtrack status + // values: + // + // - applying + // + // - completed + // + // - failed + // + // - pending + // + // The results list includes information about only the backtracks identified by + // these values. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBClusterBacktracks + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeDBClusterBacktracks action. +type DescribeDBClusterBacktracksOutput struct { + + // Contains a list of backtracks for the user. + DBClusterBacktracks []types.DBClusterBacktrack + + // A pagination token that can be used in a later DescribeDBClusterBacktracks + // request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterBacktracksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterBacktracks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterBacktracks{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterBacktracks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterBacktracksValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterBacktracks(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBClusterBacktracksPaginatorOptions is the paginator options for +// DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterBacktracksPaginator is a paginator for +// DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginator struct { + options DescribeDBClusterBacktracksPaginatorOptions + client DescribeDBClusterBacktracksAPIClient + params *DescribeDBClusterBacktracksInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterBacktracksPaginator returns a new +// DescribeDBClusterBacktracksPaginator +func NewDescribeDBClusterBacktracksPaginator(client DescribeDBClusterBacktracksAPIClient, params *DescribeDBClusterBacktracksInput, optFns ...func(*DescribeDBClusterBacktracksPaginatorOptions)) *DescribeDBClusterBacktracksPaginator { + if params == nil { + params = &DescribeDBClusterBacktracksInput{} + } + + options := DescribeDBClusterBacktracksPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterBacktracksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterBacktracksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterBacktracks page. +func (p *DescribeDBClusterBacktracksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterBacktracks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterBacktracksAPIClient is a client that implements the +// DescribeDBClusterBacktracks operation. +type DescribeDBClusterBacktracksAPIClient interface { + DescribeDBClusterBacktracks(context.Context, *DescribeDBClusterBacktracksInput, ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) +} + +var _ DescribeDBClusterBacktracksAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterBacktracks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterBacktracks", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterEndpoints.go new file mode 100644 index 00000000..ace8c36a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterEndpoints.go @@ -0,0 +1,295 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about endpoints for an Amazon Aurora DB cluster. +// +// This action only applies to Aurora DB clusters. +func (c *Client) DescribeDBClusterEndpoints(ctx context.Context, params *DescribeDBClusterEndpointsInput, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterEndpoints", params, optFns, c.addOperationDescribeDBClusterEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterEndpointsInput struct { + + // The identifier of the endpoint to describe. This parameter is stored as a + // lowercase string. + DBClusterEndpointIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + DBClusterIdentifier *string + + // A set of name-value pairs that define which endpoints to include in the output. + // The filters are specified as name-value pairs, in the format + // Name=endpoint_type,Values=endpoint_type1,endpoint_type2,... . Name can be one + // of: db-cluster-endpoint-type , db-cluster-endpoint-custom-type , + // db-cluster-endpoint-id , db-cluster-endpoint-status . Values for the + // db-cluster-endpoint-type filter can be one or more of: reader , writer , custom + // . Values for the db-cluster-endpoint-custom-type filter can be one or more of: + // reader , any . Values for the db-cluster-endpoint-status filter can be one or + // more of: available , creating , deleting , inactive , modifying . + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBClusterEndpoints + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBClusterEndpointsOutput struct { + + // Contains the details of the endpoints associated with the cluster and matching + // any filter conditions. + DBClusterEndpoints []types.DBClusterEndpoint + + // An optional pagination token provided by a previous DescribeDBClusterEndpoints + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterEndpoints{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterEndpoints"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBClusterEndpointsPaginatorOptions is the paginator options for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterEndpointsPaginator is a paginator for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginator struct { + options DescribeDBClusterEndpointsPaginatorOptions + client DescribeDBClusterEndpointsAPIClient + params *DescribeDBClusterEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + options := DescribeDBClusterEndpointsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterEndpoints page. +func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterEndpointsAPIClient is a client that implements the +// DescribeDBClusterEndpoints operation. +type DescribeDBClusterEndpointsAPIClient interface { + DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) +} + +var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterEndpoints", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameterGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameterGroups.go new file mode 100644 index 00000000..ff532d78 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameterGroups.go @@ -0,0 +1,294 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DBClusterParameterGroup descriptions. If a +// DBClusterParameterGroupName parameter is specified, the list will contain only +// the description of the specified DB cluster parameter group. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DescribeDBClusterParameterGroups(ctx context.Context, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterParameterGroups", params, optFns, c.addOperationDescribeDBClusterParameterGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterParameterGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterParameterGroupsInput struct { + + // The name of a specific DB cluster parameter group to return details for. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBClusterParameterGroup. + DBClusterParameterGroupName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribeDBClusterParameterGroups request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBClusterParameterGroupsOutput struct { + + // A list of DB cluster parameter groups. + DBClusterParameterGroups []types.DBClusterParameterGroup + + // An optional pagination token provided by a previous + // DescribeDBClusterParameterGroups request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterParameterGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterParameterGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterParameterGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterParameterGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterParameterGroupsPaginator is a paginator for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginator struct { + options DescribeDBClusterParameterGroupsPaginatorOptions + client DescribeDBClusterParameterGroupsAPIClient + params *DescribeDBClusterParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterParameterGroups page. +func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterParameterGroupsAPIClient is a client that implements the +// DescribeDBClusterParameterGroups operation. +type DescribeDBClusterParameterGroupsAPIClient interface { + DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) +} + +var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterParameterGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameters.go new file mode 100644 index 00000000..2b67928f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterParameters.go @@ -0,0 +1,309 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the detailed parameter list for a particular DB cluster parameter group. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DescribeDBClusterParameters(ctx context.Context, params *DescribeDBClusterParametersInput, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterParameters", params, optFns, c.addOperationDescribeDBClusterParametersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterParametersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterParametersInput struct { + + // The name of a specific DB cluster parameter group to return parameter details + // for. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBClusterParameterGroup. + // + // This member is required. + DBClusterParameterGroupName *string + + // A filter that specifies one or more DB cluster parameters to describe. + // + // The only supported filter is parameter-name . The results list only includes + // information about the DB cluster parameters with these names. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBClusterParameters + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // A specific source to return parameters for. + // + // Valid Values: + // + // - engine-default + // + // - system + // + // - user + Source *string + + noSmithyDocumentSerde +} + +// Provides details about a DB cluster parameter group including the parameters in +// the DB cluster parameter group. +type DescribeDBClusterParametersOutput struct { + + // An optional pagination token provided by a previous DescribeDBClusterParameters + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // Provides a list of parameters for the DB cluster parameter group. + Parameters []types.Parameter + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterParameters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterParameters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterParametersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterParameters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBClusterParametersPaginatorOptions is the paginator options for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterParametersPaginator is a paginator for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginator struct { + options DescribeDBClusterParametersPaginatorOptions + client DescribeDBClusterParametersAPIClient + params *DescribeDBClusterParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + options := DescribeDBClusterParametersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterParameters page. +func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterParametersAPIClient is a client that implements the +// DescribeDBClusterParameters operation. +type DescribeDBClusterParametersAPIClient interface { + DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) +} + +var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterParameters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshotAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshotAttributes.go new file mode 100644 index 00000000..b0128b83 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshotAttributes.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DB cluster snapshot attribute names and values for a manual +// DB cluster snapshot. +// +// When sharing snapshots with other Amazon Web Services accounts, +// DescribeDBClusterSnapshotAttributes returns the restore attribute and a list of +// IDs for the Amazon Web Services accounts that are authorized to copy or restore +// the manual DB cluster snapshot. If all is included in the list of values for +// the restore attribute, then the manual DB cluster snapshot is public and can be +// copied or restored by all Amazon Web Services accounts. +// +// To add or remove access for an Amazon Web Services account to copy or restore a +// manual DB cluster snapshot, or to make the manual DB cluster snapshot public or +// private, use the ModifyDBClusterSnapshotAttribute API action. +func (c *Client) DescribeDBClusterSnapshotAttributes(ctx context.Context, params *DescribeDBClusterSnapshotAttributesInput, optFns ...func(*Options)) (*DescribeDBClusterSnapshotAttributesOutput, error) { + if params == nil { + params = &DescribeDBClusterSnapshotAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterSnapshotAttributes", params, optFns, c.addOperationDescribeDBClusterSnapshotAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterSnapshotAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterSnapshotAttributesInput struct { + + // The identifier for the DB cluster snapshot to describe the attributes for. + // + // This member is required. + DBClusterSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +type DescribeDBClusterSnapshotAttributesOutput struct { + + // Contains the results of a successful call to the + // DescribeDBClusterSnapshotAttributes API action. + // + // Manual DB cluster snapshot attributes are used to authorize other Amazon Web + // Services accounts to copy or restore a manual DB cluster snapshot. For more + // information, see the ModifyDBClusterSnapshotAttribute API action. + DBClusterSnapshotAttributesResult *types.DBClusterSnapshotAttributesResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterSnapshotAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterSnapshotAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterSnapshotAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterSnapshotAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterSnapshotAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterSnapshotAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeDBClusterSnapshotAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterSnapshotAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshots.go new file mode 100644 index 00000000..b53e48aa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusterSnapshots.go @@ -0,0 +1,976 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + jmespath "github.com/jmespath/go-jmespath" + "strconv" + "time" +) + +// Returns information about DB cluster snapshots. This API action supports +// pagination. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DescribeDBClusterSnapshots(ctx context.Context, params *DescribeDBClusterSnapshotsInput, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterSnapshots", params, optFns, c.addOperationDescribeDBClusterSnapshotsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClusterSnapshotsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClusterSnapshotsInput struct { + + // The ID of the DB cluster to retrieve the list of DB cluster snapshots for. This + // parameter can't be used in conjunction with the DBClusterSnapshotIdentifier + // parameter. This parameter isn't case-sensitive. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DBCluster. + DBClusterIdentifier *string + + // A specific DB cluster snapshot identifier to describe. This parameter can't be + // used in conjunction with the DBClusterIdentifier parameter. This value is + // stored as a lowercase string. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DBClusterSnapshot. + // + // - If this identifier is for an automated snapshot, the SnapshotType parameter + // must also be specified. + DBClusterSnapshotIdentifier *string + + // A specific DB cluster resource ID to describe. + DbClusterResourceId *string + + // A filter that specifies one or more DB cluster snapshots to describe. + // + // Supported filters: + // + // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon + // Resource Names (ARNs). + // + // - db-cluster-snapshot-id - Accepts DB cluster snapshot identifiers. + // + // - snapshot-type - Accepts types of DB cluster snapshots. + // + // - engine - Accepts names of database engines. + Filters []types.Filter + + // Specifies whether to include manual DB cluster snapshots that are public and + // can be copied or restored by any Amazon Web Services account. By default, the + // public snapshots are not included. + // + // You can share a manual DB cluster snapshot as public by using the ModifyDBClusterSnapshotAttribute API action. + IncludePublic *bool + + // Specifies whether to include shared manual DB cluster snapshots from other + // Amazon Web Services accounts that this Amazon Web Services account has been + // given permission to copy or restore. By default, these snapshots are not + // included. + // + // You can give an Amazon Web Services account permission to restore a manual DB + // cluster snapshot from another Amazon Web Services account by the + // ModifyDBClusterSnapshotAttribute API action. + IncludeShared *bool + + // An optional pagination token provided by a previous DescribeDBClusterSnapshots + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The type of DB cluster snapshots to be returned. You can specify one of the + // following values: + // + // - automated - Return all DB cluster snapshots that have been automatically + // taken by Amazon RDS for my Amazon Web Services account. + // + // - manual - Return all DB cluster snapshots that have been taken by my Amazon + // Web Services account. + // + // - shared - Return all manual DB cluster snapshots that have been shared to my + // Amazon Web Services account. + // + // - public - Return all DB cluster snapshots that have been marked as public. + // + // If you don't specify a SnapshotType value, then both automated and manual DB + // cluster snapshots are returned. You can include shared DB cluster snapshots with + // these results by enabling the IncludeShared parameter. You can include public + // DB cluster snapshots with these results by enabling the IncludePublic parameter. + // + // The IncludeShared and IncludePublic parameters don't apply for SnapshotType + // values of manual or automated . The IncludePublic parameter doesn't apply when + // SnapshotType is set to shared . The IncludeShared parameter doesn't apply when + // SnapshotType is set to public . + SnapshotType *string + + noSmithyDocumentSerde +} + +// Provides a list of DB cluster snapshots for the user as the result of a call to +// the DescribeDBClusterSnapshots action. +type DescribeDBClusterSnapshotsOutput struct { + + // Provides a list of DB cluster snapshots for the user. + DBClusterSnapshots []types.DBClusterSnapshot + + // An optional pagination token provided by a previous DescribeDBClusterSnapshots + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterSnapshots{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterSnapshots{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusterSnapshots"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClusterSnapshotsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DBClusterSnapshotAvailableWaiterOptions are waiter options for +// DBClusterSnapshotAvailableWaiter +type DBClusterSnapshotAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBClusterSnapshotAvailableWaiter will use default minimum delay of 30 seconds. + // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBClusterSnapshotAvailableWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBClusterSnapshotsInput, *DescribeDBClusterSnapshotsOutput, error) (bool, error) +} + +// DBClusterSnapshotAvailableWaiter defines the waiters for +// DBClusterSnapshotAvailable +type DBClusterSnapshotAvailableWaiter struct { + client DescribeDBClusterSnapshotsAPIClient + + options DBClusterSnapshotAvailableWaiterOptions +} + +// NewDBClusterSnapshotAvailableWaiter constructs a +// DBClusterSnapshotAvailableWaiter. +func NewDBClusterSnapshotAvailableWaiter(client DescribeDBClusterSnapshotsAPIClient, optFns ...func(*DBClusterSnapshotAvailableWaiterOptions)) *DBClusterSnapshotAvailableWaiter { + options := DBClusterSnapshotAvailableWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBClusterSnapshotAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBClusterSnapshotAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBClusterSnapshotAvailable waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *DBClusterSnapshotAvailableWaiter) Wait(ctx context.Context, params *DescribeDBClusterSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBClusterSnapshotAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBClusterSnapshotAvailable waiter +// and returns the output of the successful operation. The maxWaitDur is the +// maximum wait duration the waiter will wait. The maxWaitDur is required and must +// be greater than zero. +func (w *DBClusterSnapshotAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDBClusterSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBClusterSnapshotAvailableWaiterOptions)) (*DescribeDBClusterSnapshotsOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBClusterSnapshots(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBClusterSnapshotAvailable waiter") +} + +func dBClusterSnapshotAvailableStateRetryable(ctx context.Context, input *DescribeDBClusterSnapshotsInput, output *DescribeDBClusterSnapshotsOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "available" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleted" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "failed" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-restore" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-parameters" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DBClusterSnapshotDeletedWaiterOptions are waiter options for +// DBClusterSnapshotDeletedWaiter +type DBClusterSnapshotDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBClusterSnapshotDeletedWaiter will use default minimum delay of 30 seconds. + // Note that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBClusterSnapshotDeletedWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBClusterSnapshotsInput, *DescribeDBClusterSnapshotsOutput, error) (bool, error) +} + +// DBClusterSnapshotDeletedWaiter defines the waiters for DBClusterSnapshotDeleted +type DBClusterSnapshotDeletedWaiter struct { + client DescribeDBClusterSnapshotsAPIClient + + options DBClusterSnapshotDeletedWaiterOptions +} + +// NewDBClusterSnapshotDeletedWaiter constructs a DBClusterSnapshotDeletedWaiter. +func NewDBClusterSnapshotDeletedWaiter(client DescribeDBClusterSnapshotsAPIClient, optFns ...func(*DBClusterSnapshotDeletedWaiterOptions)) *DBClusterSnapshotDeletedWaiter { + options := DBClusterSnapshotDeletedWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBClusterSnapshotDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBClusterSnapshotDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBClusterSnapshotDeleted waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *DBClusterSnapshotDeletedWaiter) Wait(ctx context.Context, params *DescribeDBClusterSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBClusterSnapshotDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBClusterSnapshotDeleted waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBClusterSnapshotDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeDBClusterSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBClusterSnapshotDeletedWaiterOptions)) (*DescribeDBClusterSnapshotsOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBClusterSnapshots(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBClusterSnapshotDeleted waiter") +} + +func dBClusterSnapshotDeletedStateRetryable(ctx context.Context, input *DescribeDBClusterSnapshotsInput, output *DescribeDBClusterSnapshotsOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("length(DBClusterSnapshots) == `0`", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, nil + } + } + + if err != nil { + var errorType *types.DBClusterSnapshotNotFoundFault + if errors.As(err, &errorType) { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "creating" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "modifying" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "rebooting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusterSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "resetting-master-credentials" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClusterSnapshotsPaginator is a paginator for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginator struct { + options DescribeDBClusterSnapshotsPaginatorOptions + client DescribeDBClusterSnapshotsAPIClient + params *DescribeDBClusterSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + options := DescribeDBClusterSnapshotsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusterSnapshots page. +func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClusterSnapshotsAPIClient is a client that implements the +// DescribeDBClusterSnapshots operation. +type DescribeDBClusterSnapshotsAPIClient interface { + DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) +} + +var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusterSnapshots", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusters.go new file mode 100644 index 00000000..13e8e237 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBClusters.go @@ -0,0 +1,923 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + jmespath "github.com/jmespath/go-jmespath" + "strconv" + "time" +) + +// Describes existing Amazon Aurora DB clusters and Multi-AZ DB clusters. This API +// supports pagination. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// This operation can also return information for Amazon Neptune DB instances and +// Amazon DocumentDB instances. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) DescribeDBClusters(ctx context.Context, params *DescribeDBClustersInput, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if params == nil { + params = &DescribeDBClustersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusters", params, optFns, c.addOperationDescribeDBClustersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBClustersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBClustersInput struct { + + // The user-supplied DB cluster identifier or the Amazon Resource Name (ARN) of + // the DB cluster. If this parameter is specified, information for only the + // specific DB cluster is returned. This parameter isn't case-sensitive. + // + // Constraints: + // + // - If supplied, must match an existing DB cluster identifier. + DBClusterIdentifier *string + + // A filter that specifies one or more DB clusters to describe. + // + // Supported Filters: + // + // - clone-group-id - Accepts clone group identifiers. The results list only + // includes information about the DB clusters associated with these clone groups. + // + // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon + // Resource Names (ARNs). The results list only includes information about the DB + // clusters identified by these ARNs. + // + // - db-cluster-resource-id - Accepts DB cluster resource identifiers. The + // results list will only include information about the DB clusters identified by + // these DB cluster resource identifiers. + // + // - domain - Accepts Active Directory directory IDs. The results list only + // includes information about the DB clusters associated with these domains. + // + // - engine - Accepts engine names. The results list only includes information + // about the DB clusters for these engines. + Filters []types.Filter + + // Specifies whether the output includes information about clusters shared from + // other Amazon Web Services accounts. + IncludeShared *bool + + // An optional pagination token provided by a previous DescribeDBClusters request. + // If this parameter is specified, the response includes only records beyond the + // marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100 + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBClusters action. +type DescribeDBClustersOutput struct { + + // Contains a list of DB clusters for the user. + DBClusters []types.DBCluster + + // A pagination token that can be used in a later DescribeDBClusters request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBClusters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBClustersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DBClusterAvailableWaiterOptions are waiter options for DBClusterAvailableWaiter +type DBClusterAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBClusterAvailableWaiter will use default minimum delay of 30 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBClusterAvailableWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBClustersInput, *DescribeDBClustersOutput, error) (bool, error) +} + +// DBClusterAvailableWaiter defines the waiters for DBClusterAvailable +type DBClusterAvailableWaiter struct { + client DescribeDBClustersAPIClient + + options DBClusterAvailableWaiterOptions +} + +// NewDBClusterAvailableWaiter constructs a DBClusterAvailableWaiter. +func NewDBClusterAvailableWaiter(client DescribeDBClustersAPIClient, optFns ...func(*DBClusterAvailableWaiterOptions)) *DBClusterAvailableWaiter { + options := DBClusterAvailableWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBClusterAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBClusterAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBClusterAvailable waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *DBClusterAvailableWaiter) Wait(ctx context.Context, params *DescribeDBClustersInput, maxWaitDur time.Duration, optFns ...func(*DBClusterAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBClusterAvailable waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBClusterAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDBClustersInput, maxWaitDur time.Duration, optFns ...func(*DBClusterAvailableWaiterOptions)) (*DescribeDBClustersOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBClusters(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBClusterAvailable waiter") +} + +func dBClusterAvailableStateRetryable(ctx context.Context, input *DescribeDBClustersInput, output *DescribeDBClustersOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "available" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleted" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "failed" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-restore" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-parameters" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DBClusterDeletedWaiterOptions are waiter options for DBClusterDeletedWaiter +type DBClusterDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBClusterDeletedWaiter will use default minimum delay of 30 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBClusterDeletedWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBClustersInput, *DescribeDBClustersOutput, error) (bool, error) +} + +// DBClusterDeletedWaiter defines the waiters for DBClusterDeleted +type DBClusterDeletedWaiter struct { + client DescribeDBClustersAPIClient + + options DBClusterDeletedWaiterOptions +} + +// NewDBClusterDeletedWaiter constructs a DBClusterDeletedWaiter. +func NewDBClusterDeletedWaiter(client DescribeDBClustersAPIClient, optFns ...func(*DBClusterDeletedWaiterOptions)) *DBClusterDeletedWaiter { + options := DBClusterDeletedWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBClusterDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBClusterDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBClusterDeleted waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *DBClusterDeletedWaiter) Wait(ctx context.Context, params *DescribeDBClustersInput, maxWaitDur time.Duration, optFns ...func(*DBClusterDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBClusterDeleted waiter and returns +// the output of the successful operation. The maxWaitDur is the maximum wait +// duration the waiter will wait. The maxWaitDur is required and must be greater +// than zero. +func (w *DBClusterDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeDBClustersInput, maxWaitDur time.Duration, optFns ...func(*DBClusterDeletedWaiterOptions)) (*DescribeDBClustersOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBClusters(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBClusterDeleted waiter") +} + +func dBClusterDeletedStateRetryable(ctx context.Context, input *DescribeDBClustersInput, output *DescribeDBClustersOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("length(DBClusters) == `0`", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, nil + } + } + + if err != nil { + var errorType *types.DBClusterNotFoundFault + if errors.As(err, &errorType) { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "creating" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "modifying" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "rebooting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBClusters[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "resetting-master-credentials" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DescribeDBClustersPaginatorOptions is the paginator options for +// DescribeDBClusters +type DescribeDBClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100 + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBClustersPaginator is a paginator for DescribeDBClusters +type DescribeDBClustersPaginator struct { + options DescribeDBClustersPaginatorOptions + client DescribeDBClustersAPIClient + params *DescribeDBClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + if params == nil { + params = &DescribeDBClustersInput{} + } + + options := DescribeDBClustersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClustersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBClusters page. +func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters +// operation. +type DescribeDBClustersAPIClient interface { + DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) +} + +var _ DescribeDBClustersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBClusters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBEngineVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBEngineVersions.go new file mode 100644 index 00000000..df25652d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBEngineVersions.go @@ -0,0 +1,394 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the properties of specific versions of DB engines. +func (c *Client) DescribeDBEngineVersions(ctx context.Context, params *DescribeDBEngineVersionsInput, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBEngineVersions", params, optFns, c.addOperationDescribeDBEngineVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBEngineVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBEngineVersionsInput struct { + + // The name of a specific DB parameter group family to return details for. + // + // Constraints: + // + // - If supplied, must match an existing DB parameter group family. + DBParameterGroupFamily *string + + // Specifies whether to return only the default version of the specified engine or + // the engine and major version combination. + DefaultOnly *bool + + // The database engine to return version details for. + // + // Valid Values: + // + // - aurora-mysql + // + // - aurora-postgresql + // + // - custom-oracle-ee + // + // - custom-oracle-ee-cdb + // + // - custom-oracle-se2 + // + // - custom-oracle-se2-cdb + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + Engine *string + + // A specific database engine version to return details for. + // + // Example: 5.1.49 + EngineVersion *string + + // A filter that specifies one or more DB engine versions to describe. + // + // Supported filters: + // + // - db-parameter-group-family - Accepts parameter groups family names. The + // results list only includes information about the DB engine versions for these + // parameter group families. + // + // - engine - Accepts engine names. The results list only includes information + // about the DB engine versions for these engines. + // + // - engine-mode - Accepts DB engine modes. The results list only includes + // information about the DB engine versions for these engine modes. Valid DB engine + // modes are the following: + // + // - global + // + // - multimaster + // + // - parallelquery + // + // - provisioned + // + // - serverless + // + // - engine-version - Accepts engine versions. The results list only includes + // information about the DB engine versions for these engine versions. + // + // - status - Accepts engine version statuses. The results list only includes + // information about the DB engine versions for these statuses. Valid statuses are + // the following: + // + // - available + // + // - deprecated + Filters []types.Filter + + // Specifies whether to also list the engine versions that aren't available. The + // default is to list only available engine versions. + IncludeAll *bool + + // Specifies whether to list the supported character sets for each engine version. + // + // If this parameter is enabled and the requested engine supports the + // CharacterSetName parameter for CreateDBInstance , the response includes a list + // of supported character sets for each engine version. + // + // For RDS Custom, the default is not to list supported character sets. If you + // enable this parameter, RDS Custom returns no results. + ListSupportedCharacterSets *bool + + // Specifies whether to list the supported time zones for each engine version. + // + // If this parameter is enabled and the requested engine supports the TimeZone + // parameter for CreateDBInstance , the response includes a list of supported time + // zones for each engine version. + // + // For RDS Custom, the default is not to list supported time zones. If you enable + // this parameter, RDS Custom returns no results. + ListSupportedTimezones *bool + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBEngineVersions +// action. +type DescribeDBEngineVersionsOutput struct { + + // A list of DBEngineVersion elements. + DBEngineVersions []types.DBEngineVersion + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBEngineVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBEngineVersions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBEngineVersions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBEngineVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBEngineVersions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBEngineVersionsPaginator is a paginator for DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + options := DescribeDBEngineVersionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBEngineVersions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go new file mode 100644 index 00000000..b6a2033c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go @@ -0,0 +1,317 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays backups for both current and deleted instances. For example, use this +// operation to find details about automated backups for previously deleted +// instances. Current instances with retention periods greater than zero (0) are +// returned for both the DescribeDBInstanceAutomatedBackups and DescribeDBInstances +// operations. +// +// All parameters are optional. +func (c *Client) DescribeDBInstanceAutomatedBackups(ctx context.Context, params *DescribeDBInstanceAutomatedBackupsInput, optFns ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) { + if params == nil { + params = &DescribeDBInstanceAutomatedBackupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBInstanceAutomatedBackups", params, optFns, c.addOperationDescribeDBInstanceAutomatedBackupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBInstanceAutomatedBackupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Parameter input for DescribeDBInstanceAutomatedBackups. +type DescribeDBInstanceAutomatedBackupsInput struct { + + // The Amazon Resource Name (ARN) of the replicated automated backups, for + // example, + // arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE . + // + // This setting doesn't apply to RDS Custom. + DBInstanceAutomatedBackupsArn *string + + // (Optional) The user-supplied instance identifier. If this parameter is + // specified, it must match the identifier of an existing DB instance. It returns + // information from the specific DB instance's automated backup. This parameter + // isn't case-sensitive. + DBInstanceIdentifier *string + + // The resource ID of the DB instance that is the source of the automated backup. + // This parameter isn't case-sensitive. + DbiResourceId *string + + // A filter that specifies which resources to return based on status. + // + // Supported filters are the following: + // + // - status + // + // - active - Automated backups for current instances. + // + // - creating - Automated backups that are waiting for the first automated + // snapshot to be available. + // + // - retained - Automated backups for deleted instances and after backup + // replication is stopped. + // + // - db-instance-id - Accepts DB instance identifiers and Amazon Resource Names + // (ARNs). The results list includes only information about the DB instance + // automated backups identified by these ARNs. + // + // - dbi-resource-id - Accepts DB resource identifiers and Amazon Resource Names + // (ARNs). The results list includes only information about the DB instance + // resources identified by these ARNs. + // + // Returns all resources by default. The status for each resource is specified in + // the response. + Filters []types.Filter + + // The pagination token provided in the previous request. If this parameter is + // specified the response includes only records beyond the marker, up to MaxRecords + // . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeDBInstanceAutomatedBackups action. +type DescribeDBInstanceAutomatedBackupsOutput struct { + + // A list of DBInstanceAutomatedBackup instances. + DBInstanceAutomatedBackups []types.DBInstanceAutomatedBackup + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBInstanceAutomatedBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBInstanceAutomatedBackups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBInstanceAutomatedBackups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBInstanceAutomatedBackups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBInstanceAutomatedBackupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBInstanceAutomatedBackups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBInstanceAutomatedBackupsPaginatorOptions is the paginator options for +// DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBInstanceAutomatedBackupsPaginator is a paginator for +// DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginator struct { + options DescribeDBInstanceAutomatedBackupsPaginatorOptions + client DescribeDBInstanceAutomatedBackupsAPIClient + params *DescribeDBInstanceAutomatedBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstanceAutomatedBackupsPaginator returns a new +// DescribeDBInstanceAutomatedBackupsPaginator +func NewDescribeDBInstanceAutomatedBackupsPaginator(client DescribeDBInstanceAutomatedBackupsAPIClient, params *DescribeDBInstanceAutomatedBackupsInput, optFns ...func(*DescribeDBInstanceAutomatedBackupsPaginatorOptions)) *DescribeDBInstanceAutomatedBackupsPaginator { + if params == nil { + params = &DescribeDBInstanceAutomatedBackupsInput{} + } + + options := DescribeDBInstanceAutomatedBackupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBInstanceAutomatedBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstanceAutomatedBackupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBInstanceAutomatedBackups page. +func (p *DescribeDBInstanceAutomatedBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBInstanceAutomatedBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBInstanceAutomatedBackupsAPIClient is a client that implements the +// DescribeDBInstanceAutomatedBackups operation. +type DescribeDBInstanceAutomatedBackupsAPIClient interface { + DescribeDBInstanceAutomatedBackups(context.Context, *DescribeDBInstanceAutomatedBackupsInput, ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) +} + +var _ DescribeDBInstanceAutomatedBackupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBInstanceAutomatedBackups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBInstanceAutomatedBackups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstances.go new file mode 100644 index 00000000..5ff70e9c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBInstances.go @@ -0,0 +1,922 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + jmespath "github.com/jmespath/go-jmespath" + "strconv" + "time" +) + +// Describes provisioned RDS instances. This API supports pagination. +// +// This operation can also return information for Amazon Neptune DB instances and +// Amazon DocumentDB instances. +func (c *Client) DescribeDBInstances(ctx context.Context, params *DescribeDBInstancesInput, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if params == nil { + params = &DescribeDBInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBInstances", params, optFns, c.addOperationDescribeDBInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBInstancesInput struct { + + // The user-supplied instance identifier or the Amazon Resource Name (ARN) of the + // DB instance. If this parameter is specified, information from only the specific + // DB instance is returned. This parameter isn't case-sensitive. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DB instance. + DBInstanceIdentifier *string + + // A filter that specifies one or more DB instances to describe. + // + // Supported Filters: + // + // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon + // Resource Names (ARNs). The results list only includes information about the DB + // instances associated with the DB clusters identified by these ARNs. + // + // - db-instance-id - Accepts DB instance identifiers and DB instance Amazon + // Resource Names (ARNs). The results list only includes information about the DB + // instances identified by these ARNs. + // + // - dbi-resource-id - Accepts DB instance resource identifiers. The results list + // only includes information about the DB instances identified by these DB instance + // resource identifiers. + // + // - domain - Accepts Active Directory directory IDs. The results list only + // includes information about the DB instances associated with these domains. + // + // - engine - Accepts engine names. The results list only includes information + // about the DB instances for these engines. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBInstances + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBInstances +// action. +type DescribeDBInstancesOutput struct { + + // A list of DBInstance instances. + DBInstances []types.DBInstance + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBInstances{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBInstances"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBInstancesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DBInstanceAvailableWaiterOptions are waiter options for +// DBInstanceAvailableWaiter +type DBInstanceAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBInstanceAvailableWaiter will use default minimum delay of 30 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBInstanceAvailableWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBInstancesInput, *DescribeDBInstancesOutput, error) (bool, error) +} + +// DBInstanceAvailableWaiter defines the waiters for DBInstanceAvailable +type DBInstanceAvailableWaiter struct { + client DescribeDBInstancesAPIClient + + options DBInstanceAvailableWaiterOptions +} + +// NewDBInstanceAvailableWaiter constructs a DBInstanceAvailableWaiter. +func NewDBInstanceAvailableWaiter(client DescribeDBInstancesAPIClient, optFns ...func(*DBInstanceAvailableWaiterOptions)) *DBInstanceAvailableWaiter { + options := DBInstanceAvailableWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBInstanceAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBInstanceAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBInstanceAvailable waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *DBInstanceAvailableWaiter) Wait(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBInstanceAvailable waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBInstanceAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceAvailableWaiterOptions)) (*DescribeDBInstancesOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBInstances(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBInstanceAvailable waiter") +} + +func dBInstanceAvailableStateRetryable(ctx context.Context, input *DescribeDBInstancesInput, output *DescribeDBInstancesOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "available" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleted" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "failed" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-restore" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-parameters" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DBInstanceDeletedWaiterOptions are waiter options for DBInstanceDeletedWaiter +type DBInstanceDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBInstanceDeletedWaiter will use default minimum delay of 30 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBInstanceDeletedWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBInstancesInput, *DescribeDBInstancesOutput, error) (bool, error) +} + +// DBInstanceDeletedWaiter defines the waiters for DBInstanceDeleted +type DBInstanceDeletedWaiter struct { + client DescribeDBInstancesAPIClient + + options DBInstanceDeletedWaiterOptions +} + +// NewDBInstanceDeletedWaiter constructs a DBInstanceDeletedWaiter. +func NewDBInstanceDeletedWaiter(client DescribeDBInstancesAPIClient, optFns ...func(*DBInstanceDeletedWaiterOptions)) *DBInstanceDeletedWaiter { + options := DBInstanceDeletedWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBInstanceDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBInstanceDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBInstanceDeleted waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *DBInstanceDeletedWaiter) Wait(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBInstanceDeleted waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBInstanceDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceDeletedWaiterOptions)) (*DescribeDBInstancesOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBInstances(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBInstanceDeleted waiter") +} + +func dBInstanceDeletedStateRetryable(ctx context.Context, input *DescribeDBInstancesInput, output *DescribeDBInstancesOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("length(DBInstances) == `0`", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, nil + } + } + + if err != nil { + var apiErr smithy.APIError + ok := errors.As(err, &apiErr) + if !ok { + return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) + } + + if "DBInstanceNotFound" == apiErr.ErrorCode() { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "creating" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "modifying" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "rebooting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "resetting-master-credentials" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBInstancesPaginator is a paginator for DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + if params == nil { + params = &DescribeDBInstancesInput{} + } + + options := DescribeDBInstancesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBInstancesAPIClient is a client that implements the +// DescribeDBInstances operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBInstances", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBLogFiles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBLogFiles.go new file mode 100644 index 00000000..f2cfa0a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBLogFiles.go @@ -0,0 +1,288 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DB log files for the DB instance. +// +// This command doesn't apply to RDS Custom. +func (c *Client) DescribeDBLogFiles(ctx context.Context, params *DescribeDBLogFilesInput, optFns ...func(*Options)) (*DescribeDBLogFilesOutput, error) { + if params == nil { + params = &DescribeDBLogFilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBLogFiles", params, optFns, c.addOperationDescribeDBLogFilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBLogFilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBLogFilesInput struct { + + // The customer-assigned name of the DB instance that contains the log files you + // want to list. + // + // Constraints: + // + // - Must match the identifier of an existing DBInstance. + // + // This member is required. + DBInstanceIdentifier *string + + // Filters the available log files for files written since the specified date, in + // POSIX timestamp format with milliseconds. + FileLastWritten *int64 + + // Filters the available log files for files larger than the specified size. + FileSize *int64 + + // Filters the available log files for log file names that contain the specified + // string. + FilenameContains *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // The pagination token provided in the previous request. If this parameter is + // specified the response includes only records beyond the marker, up to + // MaxRecords. + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// The response from a call to DescribeDBLogFiles . +type DescribeDBLogFilesOutput struct { + + // The DB log files returned. + DescribeDBLogFiles []types.DescribeDBLogFilesDetails + + // A pagination token that can be used in a later DescribeDBLogFiles request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBLogFilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBLogFiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBLogFiles{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBLogFiles"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBLogFilesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBLogFiles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBLogFilesPaginatorOptions is the paginator options for +// DescribeDBLogFiles +type DescribeDBLogFilesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBLogFilesPaginator is a paginator for DescribeDBLogFiles +type DescribeDBLogFilesPaginator struct { + options DescribeDBLogFilesPaginatorOptions + client DescribeDBLogFilesAPIClient + params *DescribeDBLogFilesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBLogFilesPaginator returns a new DescribeDBLogFilesPaginator +func NewDescribeDBLogFilesPaginator(client DescribeDBLogFilesAPIClient, params *DescribeDBLogFilesInput, optFns ...func(*DescribeDBLogFilesPaginatorOptions)) *DescribeDBLogFilesPaginator { + if params == nil { + params = &DescribeDBLogFilesInput{} + } + + options := DescribeDBLogFilesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBLogFilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBLogFilesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBLogFiles page. +func (p *DescribeDBLogFilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBLogFilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBLogFiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBLogFilesAPIClient is a client that implements the DescribeDBLogFiles +// operation. +type DescribeDBLogFilesAPIClient interface { + DescribeDBLogFiles(context.Context, *DescribeDBLogFilesInput, ...func(*Options)) (*DescribeDBLogFilesOutput, error) +} + +var _ DescribeDBLogFilesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBLogFiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBLogFiles", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameterGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameterGroups.go new file mode 100644 index 00000000..a6a908b8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameterGroups.go @@ -0,0 +1,286 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DBParameterGroup descriptions. If a DBParameterGroupName is +// specified, the list will contain only the description of the specified DB +// parameter group. +func (c *Client) DescribeDBParameterGroups(ctx context.Context, params *DescribeDBParameterGroupsInput, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBParameterGroups", params, optFns, c.addOperationDescribeDBParameterGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBParameterGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBParameterGroupsInput struct { + + // The name of a specific DB parameter group to return details for. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBClusterParameterGroup. + DBParameterGroupName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBParameterGroups + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBParameterGroups +// action. +type DescribeDBParameterGroupsOutput struct { + + // A list of DBParameterGroup instances. + DBParameterGroups []types.DBParameterGroup + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBParameterGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBParameterGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBParameterGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBParameterGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBParameterGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBParameterGroupsPaginator is a paginator for DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginator struct { + options DescribeDBParameterGroupsPaginatorOptions + client DescribeDBParameterGroupsAPIClient + params *DescribeDBParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + options := DescribeDBParameterGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBParameterGroups page. +func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBParameterGroupsAPIClient is a client that implements the +// DescribeDBParameterGroups operation. +type DescribeDBParameterGroupsAPIClient interface { + DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) +} + +var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBParameterGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameters.go new file mode 100644 index 00000000..aa040233 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBParameters.go @@ -0,0 +1,295 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the detailed parameter list for a particular DB parameter group. +func (c *Client) DescribeDBParameters(ctx context.Context, params *DescribeDBParametersInput, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if params == nil { + params = &DescribeDBParametersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBParameters", params, optFns, c.addOperationDescribeDBParametersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBParametersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBParametersInput struct { + + // The name of a specific DB parameter group to return details for. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBParameterGroup. + // + // This member is required. + DBParameterGroupName *string + + // A filter that specifies one or more DB parameters to describe. + // + // The only supported filter is parameter-name . The results list only includes + // information about the DB parameters with these names. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBParameters + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The parameter types to return. + // + // Default: All parameter types returned + // + // Valid Values: user | system | engine-default + Source *string + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBParameters +// action. +type DescribeDBParametersOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // A list of Parameter values. + Parameters []types.Parameter + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBParameters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBParameters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBParametersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBParameters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBParametersPaginatorOptions is the paginator options for +// DescribeDBParameters +type DescribeDBParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBParametersPaginator is a paginator for DescribeDBParameters +type DescribeDBParametersPaginator struct { + options DescribeDBParametersPaginatorOptions + client DescribeDBParametersAPIClient + params *DescribeDBParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + if params == nil { + params = &DescribeDBParametersInput{} + } + + options := DescribeDBParametersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParametersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBParameters page. +func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBParametersAPIClient is a client that implements the +// DescribeDBParameters operation. +type DescribeDBParametersAPIClient interface { + DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) +} + +var _ DescribeDBParametersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBParameters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxies.go new file mode 100644 index 00000000..489ae6b1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxies.go @@ -0,0 +1,277 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about DB proxies. +func (c *Client) DescribeDBProxies(ctx context.Context, params *DescribeDBProxiesInput, optFns ...func(*Options)) (*DescribeDBProxiesOutput, error) { + if params == nil { + params = &DescribeDBProxiesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBProxies", params, optFns, c.addOperationDescribeDBProxiesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBProxiesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBProxiesInput struct { + + // The name of the DB proxy. If you omit this parameter, the output includes + // information about all DB proxies owned by your Amazon Web Services account ID. + DBProxyName *string + + // This parameter is not currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBProxiesOutput struct { + + // A return value representing an arbitrary number of DBProxy data structures. + DBProxies []types.DBProxy + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBProxiesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBProxies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBProxies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBProxies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBProxiesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBProxies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBProxiesPaginatorOptions is the paginator options for DescribeDBProxies +type DescribeDBProxiesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBProxiesPaginator is a paginator for DescribeDBProxies +type DescribeDBProxiesPaginator struct { + options DescribeDBProxiesPaginatorOptions + client DescribeDBProxiesAPIClient + params *DescribeDBProxiesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxiesPaginator returns a new DescribeDBProxiesPaginator +func NewDescribeDBProxiesPaginator(client DescribeDBProxiesAPIClient, params *DescribeDBProxiesInput, optFns ...func(*DescribeDBProxiesPaginatorOptions)) *DescribeDBProxiesPaginator { + if params == nil { + params = &DescribeDBProxiesInput{} + } + + options := DescribeDBProxiesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBProxiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxiesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBProxies page. +func (p *DescribeDBProxiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBProxies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBProxiesAPIClient is a client that implements the DescribeDBProxies +// operation. +type DescribeDBProxiesAPIClient interface { + DescribeDBProxies(context.Context, *DescribeDBProxiesInput, ...func(*Options)) (*DescribeDBProxiesOutput, error) +} + +var _ DescribeDBProxiesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBProxies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBProxies", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyEndpoints.go new file mode 100644 index 00000000..79c4f482 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyEndpoints.go @@ -0,0 +1,285 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about DB proxy endpoints. +func (c *Client) DescribeDBProxyEndpoints(ctx context.Context, params *DescribeDBProxyEndpointsInput, optFns ...func(*Options)) (*DescribeDBProxyEndpointsOutput, error) { + if params == nil { + params = &DescribeDBProxyEndpointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBProxyEndpoints", params, optFns, c.addOperationDescribeDBProxyEndpointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBProxyEndpointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBProxyEndpointsInput struct { + + // The name of a DB proxy endpoint to describe. If you omit this parameter, the + // output includes information about all DB proxy endpoints associated with the + // specified proxy. + DBProxyEndpointName *string + + // The name of the DB proxy whose endpoints you want to describe. If you omit this + // parameter, the output includes information about all DB proxy endpoints + // associated with all your DB proxies. + DBProxyName *string + + // This parameter is not currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBProxyEndpointsOutput struct { + + // The list of ProxyEndpoint objects returned by the API operation. + DBProxyEndpoints []types.DBProxyEndpoint + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBProxyEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBProxyEndpoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBProxyEndpoints{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBProxyEndpoints"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBProxyEndpointsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBProxyEndpoints(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBProxyEndpointsPaginatorOptions is the paginator options for +// DescribeDBProxyEndpoints +type DescribeDBProxyEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBProxyEndpointsPaginator is a paginator for DescribeDBProxyEndpoints +type DescribeDBProxyEndpointsPaginator struct { + options DescribeDBProxyEndpointsPaginatorOptions + client DescribeDBProxyEndpointsAPIClient + params *DescribeDBProxyEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxyEndpointsPaginator returns a new +// DescribeDBProxyEndpointsPaginator +func NewDescribeDBProxyEndpointsPaginator(client DescribeDBProxyEndpointsAPIClient, params *DescribeDBProxyEndpointsInput, optFns ...func(*DescribeDBProxyEndpointsPaginatorOptions)) *DescribeDBProxyEndpointsPaginator { + if params == nil { + params = &DescribeDBProxyEndpointsInput{} + } + + options := DescribeDBProxyEndpointsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBProxyEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyEndpointsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBProxyEndpoints page. +func (p *DescribeDBProxyEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBProxyEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBProxyEndpointsAPIClient is a client that implements the +// DescribeDBProxyEndpoints operation. +type DescribeDBProxyEndpointsAPIClient interface { + DescribeDBProxyEndpoints(context.Context, *DescribeDBProxyEndpointsInput, ...func(*Options)) (*DescribeDBProxyEndpointsOutput, error) +} + +var _ DescribeDBProxyEndpointsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBProxyEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBProxyEndpoints", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargetGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargetGroups.go new file mode 100644 index 00000000..39101524 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargetGroups.go @@ -0,0 +1,286 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about DB proxy target groups, represented by +// DBProxyTargetGroup data structures. +func (c *Client) DescribeDBProxyTargetGroups(ctx context.Context, params *DescribeDBProxyTargetGroupsInput, optFns ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) { + if params == nil { + params = &DescribeDBProxyTargetGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBProxyTargetGroups", params, optFns, c.addOperationDescribeDBProxyTargetGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBProxyTargetGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBProxyTargetGroupsInput struct { + + // The identifier of the DBProxy associated with the target group. + // + // This member is required. + DBProxyName *string + + // This parameter is not currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The identifier of the DBProxyTargetGroup to describe. + TargetGroupName *string + + noSmithyDocumentSerde +} + +type DescribeDBProxyTargetGroupsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // An arbitrary number of DBProxyTargetGroup objects, containing details of the + // corresponding target groups. + TargetGroups []types.DBProxyTargetGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBProxyTargetGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBProxyTargetGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBProxyTargetGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBProxyTargetGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBProxyTargetGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBProxyTargetGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBProxyTargetGroupsPaginatorOptions is the paginator options for +// DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBProxyTargetGroupsPaginator is a paginator for +// DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginator struct { + options DescribeDBProxyTargetGroupsPaginatorOptions + client DescribeDBProxyTargetGroupsAPIClient + params *DescribeDBProxyTargetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxyTargetGroupsPaginator returns a new +// DescribeDBProxyTargetGroupsPaginator +func NewDescribeDBProxyTargetGroupsPaginator(client DescribeDBProxyTargetGroupsAPIClient, params *DescribeDBProxyTargetGroupsInput, optFns ...func(*DescribeDBProxyTargetGroupsPaginatorOptions)) *DescribeDBProxyTargetGroupsPaginator { + if params == nil { + params = &DescribeDBProxyTargetGroupsInput{} + } + + options := DescribeDBProxyTargetGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBProxyTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBProxyTargetGroups page. +func (p *DescribeDBProxyTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBProxyTargetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBProxyTargetGroupsAPIClient is a client that implements the +// DescribeDBProxyTargetGroups operation. +type DescribeDBProxyTargetGroupsAPIClient interface { + DescribeDBProxyTargetGroups(context.Context, *DescribeDBProxyTargetGroupsInput, ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) +} + +var _ DescribeDBProxyTargetGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBProxyTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBProxyTargetGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargets.go new file mode 100644 index 00000000..ea91f4c1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBProxyTargets.go @@ -0,0 +1,283 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about DBProxyTarget objects. This API supports pagination. +func (c *Client) DescribeDBProxyTargets(ctx context.Context, params *DescribeDBProxyTargetsInput, optFns ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) { + if params == nil { + params = &DescribeDBProxyTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBProxyTargets", params, optFns, c.addOperationDescribeDBProxyTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBProxyTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBProxyTargetsInput struct { + + // The identifier of the DBProxyTarget to describe. + // + // This member is required. + DBProxyName *string + + // This parameter is not currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The identifier of the DBProxyTargetGroup to describe. + TargetGroupName *string + + noSmithyDocumentSerde +} + +type DescribeDBProxyTargetsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // An arbitrary number of DBProxyTarget objects, containing details of the + // corresponding targets. + Targets []types.DBProxyTarget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBProxyTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBProxyTargets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBProxyTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBProxyTargets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBProxyTargetsPaginatorOptions is the paginator options for +// DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBProxyTargetsPaginator is a paginator for DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginator struct { + options DescribeDBProxyTargetsPaginatorOptions + client DescribeDBProxyTargetsAPIClient + params *DescribeDBProxyTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxyTargetsPaginator returns a new DescribeDBProxyTargetsPaginator +func NewDescribeDBProxyTargetsPaginator(client DescribeDBProxyTargetsAPIClient, params *DescribeDBProxyTargetsInput, optFns ...func(*DescribeDBProxyTargetsPaginatorOptions)) *DescribeDBProxyTargetsPaginator { + if params == nil { + params = &DescribeDBProxyTargetsInput{} + } + + options := DescribeDBProxyTargetsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBProxyTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBProxyTargets page. +func (p *DescribeDBProxyTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBProxyTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBProxyTargetsAPIClient is a client that implements the +// DescribeDBProxyTargets operation. +type DescribeDBProxyTargetsAPIClient interface { + DescribeDBProxyTargets(context.Context, *DescribeDBProxyTargetsInput, ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) +} + +var _ DescribeDBProxyTargetsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBProxyTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBProxyTargets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBRecommendations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBRecommendations.go new file mode 100644 index 00000000..56feee7b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBRecommendations.go @@ -0,0 +1,362 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Describes the recommendations to resolve the issues for your DB instances, DB +// clusters, and DB parameter groups. +func (c *Client) DescribeDBRecommendations(ctx context.Context, params *DescribeDBRecommendationsInput, optFns ...func(*Options)) (*DescribeDBRecommendationsOutput, error) { + if params == nil { + params = &DescribeDBRecommendationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBRecommendations", params, optFns, c.addOperationDescribeDBRecommendationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBRecommendationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBRecommendationsInput struct { + + // A filter that specifies one or more recommendations to describe. + // + // Supported Filters: + // + // - recommendation-id - Accepts a list of recommendation identifiers. The + // results list only includes the recommendations whose identifier is one of the + // specified filter values. + // + // - status - Accepts a list of recommendation statuses. + // + // Valid values: + // + // - active - The recommendations which are ready for you to apply. + // + // - pending - The applied or scheduled recommendations which are in progress. + // + // - resolved - The recommendations which are completed. + // + // - dismissed - The recommendations that you dismissed. + // + // The results list only includes the recommendations whose status is one of the + // specified filter values. + // + // - severity - Accepts a list of recommendation severities. The results list + // only includes the recommendations whose severity is one of the specified filter + // values. + // + // Valid values: + // + // - high + // + // - medium + // + // - low + // + // - informational + // + // - type-id - Accepts a list of recommendation type identifiers. The results + // list only includes the recommendations whose type is one of the specified filter + // values. + // + // - dbi-resource-id - Accepts a list of database resource identifiers. The + // results list only includes the recommendations that generated for the specified + // databases. + // + // - cluster-resource-id - Accepts a list of cluster resource identifiers. The + // results list only includes the recommendations that generated for the specified + // clusters. + // + // - pg-arn - Accepts a list of parameter group ARNs. The results list only + // includes the recommendations that generated for the specified parameter groups. + // + // - cluster-pg-arn - Accepts a list of cluster parameter group ARNs. The results + // list only includes the recommendations that generated for the specified cluster + // parameter groups. + Filters []types.Filter + + // A filter to include only the recommendations that were updated after this + // specified time. + LastUpdatedAfter *time.Time + + // A filter to include only the recommendations that were updated before this + // specified time. + LastUpdatedBefore *time.Time + + // The language that you choose to return the list of recommendations. + // + // Valid values: + // + // - en + // + // - en_UK + // + // - de + // + // - es + // + // - fr + // + // - id + // + // - it + // + // - ja + // + // - ko + // + // - pt_BR + // + // - zh_TW + // + // - zh_CN + Locale *string + + // An optional pagination token provided by a previous DescribeDBRecommendations + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of recommendations to include in the response. If more + // records exist than the specified MaxRecords value, a pagination token called a + // marker is included in the response so that you can retrieve the remaining + // results. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBRecommendationsOutput struct { + + // A list of recommendations which is returned from DescribeDBRecommendations API + // request. + DBRecommendations []types.DBRecommendation + + // An optional pagination token provided by a previous DBRecommendationsMessage + // request. This token can be used later in a DescribeDBRecomendations request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBRecommendations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBRecommendations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBRecommendations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBRecommendationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBRecommendations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBRecommendationsPaginatorOptions is the paginator options for +// DescribeDBRecommendations +type DescribeDBRecommendationsPaginatorOptions struct { + // The maximum number of recommendations to include in the response. If more + // records exist than the specified MaxRecords value, a pagination token called a + // marker is included in the response so that you can retrieve the remaining + // results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBRecommendationsPaginator is a paginator for DescribeDBRecommendations +type DescribeDBRecommendationsPaginator struct { + options DescribeDBRecommendationsPaginatorOptions + client DescribeDBRecommendationsAPIClient + params *DescribeDBRecommendationsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBRecommendationsPaginator returns a new +// DescribeDBRecommendationsPaginator +func NewDescribeDBRecommendationsPaginator(client DescribeDBRecommendationsAPIClient, params *DescribeDBRecommendationsInput, optFns ...func(*DescribeDBRecommendationsPaginatorOptions)) *DescribeDBRecommendationsPaginator { + if params == nil { + params = &DescribeDBRecommendationsInput{} + } + + options := DescribeDBRecommendationsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBRecommendationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBRecommendationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBRecommendations page. +func (p *DescribeDBRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBRecommendationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBRecommendations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBRecommendationsAPIClient is a client that implements the +// DescribeDBRecommendations operation. +type DescribeDBRecommendationsAPIClient interface { + DescribeDBRecommendations(context.Context, *DescribeDBRecommendationsInput, ...func(*Options)) (*DescribeDBRecommendationsOutput, error) +} + +var _ DescribeDBRecommendationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBRecommendations", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSecurityGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSecurityGroups.go new file mode 100644 index 00000000..df8d9145 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSecurityGroups.go @@ -0,0 +1,291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DBSecurityGroup descriptions. If a DBSecurityGroupName is +// specified, the list will contain only the descriptions of the specified DB +// security group. +// +// EC2-Classic was retired on August 15, 2022. If you haven't migrated from +// EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For +// more information, see [Migrate from EC2-Classic to a VPC]in the Amazon EC2 User Guide, the blog [EC2-Classic Networking is Retiring – Here’s How to Prepare], and [Moving a DB instance not in a VPC into a VPC] in the +// Amazon RDS User Guide. +// +// [Migrate from EC2-Classic to a VPC]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html +// [EC2-Classic Networking is Retiring – Here’s How to Prepare]: http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/ +// [Moving a DB instance not in a VPC into a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html +func (c *Client) DescribeDBSecurityGroups(ctx context.Context, params *DescribeDBSecurityGroupsInput, optFns ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) { + if params == nil { + params = &DescribeDBSecurityGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBSecurityGroups", params, optFns, c.addOperationDescribeDBSecurityGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBSecurityGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBSecurityGroupsInput struct { + + // The name of the DB security group to return details for. + DBSecurityGroupName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBSecurityGroups + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBSecurityGroups +// action. +type DescribeDBSecurityGroupsOutput struct { + + // A list of DBSecurityGroup instances. + DBSecurityGroups []types.DBSecurityGroup + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBSecurityGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSecurityGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSecurityGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBSecurityGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBSecurityGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSecurityGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBSecurityGroupsPaginatorOptions is the paginator options for +// DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBSecurityGroupsPaginator is a paginator for DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginator struct { + options DescribeDBSecurityGroupsPaginatorOptions + client DescribeDBSecurityGroupsAPIClient + params *DescribeDBSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSecurityGroupsPaginator returns a new +// DescribeDBSecurityGroupsPaginator +func NewDescribeDBSecurityGroupsPaginator(client DescribeDBSecurityGroupsAPIClient, params *DescribeDBSecurityGroupsInput, optFns ...func(*DescribeDBSecurityGroupsPaginatorOptions)) *DescribeDBSecurityGroupsPaginator { + if params == nil { + params = &DescribeDBSecurityGroupsInput{} + } + + options := DescribeDBSecurityGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBSecurityGroups page. +func (p *DescribeDBSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBSecurityGroupsAPIClient is a client that implements the +// DescribeDBSecurityGroups operation. +type DescribeDBSecurityGroupsAPIClient interface { + DescribeDBSecurityGroups(context.Context, *DescribeDBSecurityGroupsInput, ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) +} + +var _ DescribeDBSecurityGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBSecurityGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBShardGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBShardGroups.go new file mode 100644 index 00000000..a08f80aa --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBShardGroups.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes existing Aurora Limitless Database DB shard groups. +func (c *Client) DescribeDBShardGroups(ctx context.Context, params *DescribeDBShardGroupsInput, optFns ...func(*Options)) (*DescribeDBShardGroupsOutput, error) { + if params == nil { + params = &DescribeDBShardGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBShardGroups", params, optFns, c.addOperationDescribeDBShardGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBShardGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBShardGroupsInput struct { + + // The user-supplied DB shard group identifier. If this parameter is specified, + // information for only the specific DB shard group is returned. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - If supplied, must match an existing DB shard group identifier. + DBShardGroupIdentifier *string + + // A filter that specifies one or more DB shard groups to describe. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBShardGroups + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100 + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeDBShardGroupsOutput struct { + + // Contains a list of DB shard groups for the user. + DBShardGroups []types.DBShardGroup + + // A pagination token that can be used in a later DescribeDBClusters request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBShardGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBShardGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBShardGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBShardGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBShardGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBShardGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeDBShardGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBShardGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotAttributes.go new file mode 100644 index 00000000..ab5a4bf0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotAttributes.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DB snapshot attribute names and values for a manual DB +// snapshot. +// +// When sharing snapshots with other Amazon Web Services accounts, +// DescribeDBSnapshotAttributes returns the restore attribute and a list of IDs +// for the Amazon Web Services accounts that are authorized to copy or restore the +// manual DB snapshot. If all is included in the list of values for the restore +// attribute, then the manual DB snapshot is public and can be copied or restored +// by all Amazon Web Services accounts. +// +// To add or remove access for an Amazon Web Services account to copy or restore a +// manual DB snapshot, or to make the manual DB snapshot public or private, use the +// ModifyDBSnapshotAttribute API action. +func (c *Client) DescribeDBSnapshotAttributes(ctx context.Context, params *DescribeDBSnapshotAttributesInput, optFns ...func(*Options)) (*DescribeDBSnapshotAttributesOutput, error) { + if params == nil { + params = &DescribeDBSnapshotAttributesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBSnapshotAttributes", params, optFns, c.addOperationDescribeDBSnapshotAttributesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBSnapshotAttributesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBSnapshotAttributesInput struct { + + // The identifier for the DB snapshot to describe the attributes for. + // + // This member is required. + DBSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +type DescribeDBSnapshotAttributesOutput struct { + + // Contains the results of a successful call to the DescribeDBSnapshotAttributes + // API action. + // + // Manual DB snapshot attributes are used to authorize other Amazon Web Services + // accounts to copy or restore a manual DB snapshot. For more information, see the + // ModifyDBSnapshotAttribute API action. + DBSnapshotAttributesResult *types.DBSnapshotAttributesResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBSnapshotAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSnapshotAttributes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSnapshotAttributes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBSnapshotAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBSnapshotAttributesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSnapshotAttributes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeDBSnapshotAttributes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBSnapshotAttributes", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotTenantDatabases.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotTenantDatabases.go new file mode 100644 index 00000000..bc23bfc0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshotTenantDatabases.go @@ -0,0 +1,335 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the tenant databases that exist in a DB snapshot. This command only +// applies to RDS for Oracle DB instances in the multi-tenant configuration. +// +// You can use this command to inspect the tenant databases within a snapshot +// before restoring it. You can't directly interact with the tenant databases in a +// DB snapshot. If you restore a snapshot that was taken from DB instance using the +// multi-tenant configuration, you restore all its tenant databases. +func (c *Client) DescribeDBSnapshotTenantDatabases(ctx context.Context, params *DescribeDBSnapshotTenantDatabasesInput, optFns ...func(*Options)) (*DescribeDBSnapshotTenantDatabasesOutput, error) { + if params == nil { + params = &DescribeDBSnapshotTenantDatabasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBSnapshotTenantDatabases", params, optFns, c.addOperationDescribeDBSnapshotTenantDatabasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBSnapshotTenantDatabasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBSnapshotTenantDatabasesInput struct { + + // The ID of the DB instance used to create the DB snapshots. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DBInstance . + DBInstanceIdentifier *string + + // The ID of a DB snapshot that contains the tenant databases to describe. This + // value is stored as a lowercase string. + // + // Constraints: + // + // - If you specify this parameter, the value must match the ID of an existing + // DB snapshot. + // + // - If you specify an automatic snapshot, you must also specify SnapshotType . + DBSnapshotIdentifier *string + + // A specific DB resource identifier to describe. + DbiResourceId *string + + // A filter that specifies one or more tenant databases to describe. + // + // Supported filters: + // + // - tenant-db-name - Tenant database names. The results list only includes + // information about the tenant databases that match these tenant DB names. + // + // - tenant-database-resource-id - Tenant database resource identifiers. The + // results list only includes information about the tenant databases contained + // within the DB snapshots. + // + // - dbi-resource-id - DB instance resource identifiers. The results list only + // includes information about snapshots containing tenant databases contained + // within the DB instances identified by these resource identifiers. + // + // - db-instance-id - Accepts DB instance identifiers and DB instance Amazon + // Resource Names (ARNs). + // + // - db-snapshot-id - Accepts DB snapshot identifiers. + // + // - snapshot-type - Accepts types of DB snapshots. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribeDBSnapshotTenantDatabases request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + MaxRecords *int32 + + // The type of DB snapshots to be returned. You can specify one of the following + // values: + // + // - automated – All DB snapshots that have been automatically taken by Amazon + // RDS for my Amazon Web Services account. + // + // - manual – All DB snapshots that have been taken by my Amazon Web Services + // account. + // + // - shared – All manual DB snapshots that have been shared to my Amazon Web + // Services account. + // + // - public – All DB snapshots that have been marked as public. + // + // - awsbackup – All DB snapshots managed by the Amazon Web Services Backup + // service. + SnapshotType *string + + noSmithyDocumentSerde +} + +type DescribeDBSnapshotTenantDatabasesOutput struct { + + // A list of DB snapshot tenant databases. + DBSnapshotTenantDatabases []types.DBSnapshotTenantDatabase + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBSnapshotTenantDatabasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSnapshotTenantDatabases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSnapshotTenantDatabases{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBSnapshotTenantDatabases"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBSnapshotTenantDatabasesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSnapshotTenantDatabases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBSnapshotTenantDatabasesPaginatorOptions is the paginator options for +// DescribeDBSnapshotTenantDatabases +type DescribeDBSnapshotTenantDatabasesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBSnapshotTenantDatabasesPaginator is a paginator for +// DescribeDBSnapshotTenantDatabases +type DescribeDBSnapshotTenantDatabasesPaginator struct { + options DescribeDBSnapshotTenantDatabasesPaginatorOptions + client DescribeDBSnapshotTenantDatabasesAPIClient + params *DescribeDBSnapshotTenantDatabasesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSnapshotTenantDatabasesPaginator returns a new +// DescribeDBSnapshotTenantDatabasesPaginator +func NewDescribeDBSnapshotTenantDatabasesPaginator(client DescribeDBSnapshotTenantDatabasesAPIClient, params *DescribeDBSnapshotTenantDatabasesInput, optFns ...func(*DescribeDBSnapshotTenantDatabasesPaginatorOptions)) *DescribeDBSnapshotTenantDatabasesPaginator { + if params == nil { + params = &DescribeDBSnapshotTenantDatabasesInput{} + } + + options := DescribeDBSnapshotTenantDatabasesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBSnapshotTenantDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSnapshotTenantDatabasesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBSnapshotTenantDatabases page. +func (p *DescribeDBSnapshotTenantDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSnapshotTenantDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBSnapshotTenantDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBSnapshotTenantDatabasesAPIClient is a client that implements the +// DescribeDBSnapshotTenantDatabases operation. +type DescribeDBSnapshotTenantDatabasesAPIClient interface { + DescribeDBSnapshotTenantDatabases(context.Context, *DescribeDBSnapshotTenantDatabasesInput, ...func(*Options)) (*DescribeDBSnapshotTenantDatabasesOutput, error) +} + +var _ DescribeDBSnapshotTenantDatabasesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBSnapshotTenantDatabases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBSnapshotTenantDatabases", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshots.go new file mode 100644 index 00000000..e6e21da9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSnapshots.go @@ -0,0 +1,981 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + jmespath "github.com/jmespath/go-jmespath" + "strconv" + "time" +) + +// Returns information about DB snapshots. This API action supports pagination. +func (c *Client) DescribeDBSnapshots(ctx context.Context, params *DescribeDBSnapshotsInput, optFns ...func(*Options)) (*DescribeDBSnapshotsOutput, error) { + if params == nil { + params = &DescribeDBSnapshotsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBSnapshots", params, optFns, c.addOperationDescribeDBSnapshotsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBSnapshotsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBSnapshotsInput struct { + + // The ID of the DB instance to retrieve the list of DB snapshots for. This + // parameter isn't case-sensitive. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DBInstance. + DBInstanceIdentifier *string + + // A specific DB snapshot identifier to describe. This value is stored as a + // lowercase string. + // + // Constraints: + // + // - If supplied, must match the identifier of an existing DBSnapshot. + // + // - If this identifier is for an automated snapshot, the SnapshotType parameter + // must also be specified. + DBSnapshotIdentifier *string + + // A specific DB resource ID to describe. + DbiResourceId *string + + // A filter that specifies one or more DB snapshots to describe. + // + // Supported filters: + // + // - db-instance-id - Accepts DB instance identifiers and DB instance Amazon + // Resource Names (ARNs). + // + // - db-snapshot-id - Accepts DB snapshot identifiers. + // + // - dbi-resource-id - Accepts identifiers of source DB instances. + // + // - snapshot-type - Accepts types of DB snapshots. + // + // - engine - Accepts names of database engines. + Filters []types.Filter + + // Specifies whether to include manual DB cluster snapshots that are public and + // can be copied or restored by any Amazon Web Services account. By default, the + // public snapshots are not included. + // + // You can share a manual DB snapshot as public by using the ModifyDBSnapshotAttribute API. + // + // This setting doesn't apply to RDS Custom. + IncludePublic *bool + + // Specifies whether to include shared manual DB cluster snapshots from other + // Amazon Web Services accounts that this Amazon Web Services account has been + // given permission to copy or restore. By default, these snapshots are not + // included. + // + // You can give an Amazon Web Services account permission to restore a manual DB + // snapshot from another Amazon Web Services account by using the + // ModifyDBSnapshotAttribute API action. + // + // This setting doesn't apply to RDS Custom. + IncludeShared *bool + + // An optional pagination token provided by a previous DescribeDBSnapshots + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The type of snapshots to be returned. You can specify one of the following + // values: + // + // - automated - Return all DB snapshots that have been automatically taken by + // Amazon RDS for my Amazon Web Services account. + // + // - manual - Return all DB snapshots that have been taken by my Amazon Web + // Services account. + // + // - shared - Return all manual DB snapshots that have been shared to my Amazon + // Web Services account. + // + // - public - Return all DB snapshots that have been marked as public. + // + // - awsbackup - Return the DB snapshots managed by the Amazon Web Services + // Backup service. + // + // For information about Amazon Web Services Backup, see the [Amazon Web Services Backup Developer Guide.] + // + // The awsbackup type does not apply to Aurora. + // + // If you don't specify a SnapshotType value, then both automated and manual + // snapshots are returned. Shared and public DB snapshots are not included in the + // returned results by default. You can include shared snapshots with these results + // by enabling the IncludeShared parameter. You can include public snapshots with + // these results by enabling the IncludePublic parameter. + // + // The IncludeShared and IncludePublic parameters don't apply for SnapshotType + // values of manual or automated . The IncludePublic parameter doesn't apply when + // SnapshotType is set to shared . The IncludeShared parameter doesn't apply when + // SnapshotType is set to public . + // + // [Amazon Web Services Backup Developer Guide.]: https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html + SnapshotType *string + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBSnapshots +// action. +type DescribeDBSnapshotsOutput struct { + + // A list of DBSnapshot instances. + DBSnapshots []types.DBSnapshot + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSnapshots{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSnapshots{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBSnapshots"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBSnapshotsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSnapshots(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DBSnapshotAvailableWaiterOptions are waiter options for +// DBSnapshotAvailableWaiter +type DBSnapshotAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBSnapshotAvailableWaiter will use default minimum delay of 30 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBSnapshotAvailableWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBSnapshotsInput, *DescribeDBSnapshotsOutput, error) (bool, error) +} + +// DBSnapshotAvailableWaiter defines the waiters for DBSnapshotAvailable +type DBSnapshotAvailableWaiter struct { + client DescribeDBSnapshotsAPIClient + + options DBSnapshotAvailableWaiterOptions +} + +// NewDBSnapshotAvailableWaiter constructs a DBSnapshotAvailableWaiter. +func NewDBSnapshotAvailableWaiter(client DescribeDBSnapshotsAPIClient, optFns ...func(*DBSnapshotAvailableWaiterOptions)) *DBSnapshotAvailableWaiter { + options := DBSnapshotAvailableWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBSnapshotAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBSnapshotAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBSnapshotAvailable waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *DBSnapshotAvailableWaiter) Wait(ctx context.Context, params *DescribeDBSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBSnapshotAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBSnapshotAvailable waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBSnapshotAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDBSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBSnapshotAvailableWaiterOptions)) (*DescribeDBSnapshotsOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBSnapshots(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBSnapshotAvailable waiter") +} + +func dBSnapshotAvailableStateRetryable(ctx context.Context, input *DescribeDBSnapshotsInput, output *DescribeDBSnapshotsOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "available" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleted" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "failed" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-restore" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-parameters" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DBSnapshotDeletedWaiterOptions are waiter options for DBSnapshotDeletedWaiter +type DBSnapshotDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // DBSnapshotDeletedWaiter will use default minimum delay of 30 seconds. Note that + // MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, DBSnapshotDeletedWaiter will use default max delay of 120 seconds. + // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeDBSnapshotsInput, *DescribeDBSnapshotsOutput, error) (bool, error) +} + +// DBSnapshotDeletedWaiter defines the waiters for DBSnapshotDeleted +type DBSnapshotDeletedWaiter struct { + client DescribeDBSnapshotsAPIClient + + options DBSnapshotDeletedWaiterOptions +} + +// NewDBSnapshotDeletedWaiter constructs a DBSnapshotDeletedWaiter. +func NewDBSnapshotDeletedWaiter(client DescribeDBSnapshotsAPIClient, optFns ...func(*DBSnapshotDeletedWaiterOptions)) *DBSnapshotDeletedWaiter { + options := DBSnapshotDeletedWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = dBSnapshotDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &DBSnapshotDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for DBSnapshotDeleted waiter. The maxWaitDur is +// the maximum wait duration the waiter will wait. The maxWaitDur is required and +// must be greater than zero. +func (w *DBSnapshotDeletedWaiter) Wait(ctx context.Context, params *DescribeDBSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBSnapshotDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for DBSnapshotDeleted waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *DBSnapshotDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeDBSnapshotsInput, maxWaitDur time.Duration, optFns ...func(*DBSnapshotDeletedWaiterOptions)) (*DescribeDBSnapshotsOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeDBSnapshots(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for DBSnapshotDeleted waiter") +} + +func dBSnapshotDeletedStateRetryable(ctx context.Context, input *DescribeDBSnapshotsInput, output *DescribeDBSnapshotsOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("length(DBSnapshots) == `0`", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, nil + } + } + + if err != nil { + var apiErr smithy.APIError + ok := errors.As(err, &apiErr) + if !ok { + return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) + } + + if "DBSnapshotNotFound" == apiErr.ErrorCode() { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "creating" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "modifying" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "rebooting" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("DBSnapshots[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "resetting-master-credentials" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// DescribeDBSnapshotsPaginatorOptions is the paginator options for +// DescribeDBSnapshots +type DescribeDBSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBSnapshotsPaginator is a paginator for DescribeDBSnapshots +type DescribeDBSnapshotsPaginator struct { + options DescribeDBSnapshotsPaginatorOptions + client DescribeDBSnapshotsAPIClient + params *DescribeDBSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSnapshotsPaginator returns a new DescribeDBSnapshotsPaginator +func NewDescribeDBSnapshotsPaginator(client DescribeDBSnapshotsAPIClient, params *DescribeDBSnapshotsInput, optFns ...func(*DescribeDBSnapshotsPaginatorOptions)) *DescribeDBSnapshotsPaginator { + if params == nil { + params = &DescribeDBSnapshotsInput{} + } + + options := DescribeDBSnapshotsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBSnapshots page. +func (p *DescribeDBSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBSnapshotsAPIClient is a client that implements the +// DescribeDBSnapshots operation. +type DescribeDBSnapshotsAPIClient interface { + DescribeDBSnapshots(context.Context, *DescribeDBSnapshotsInput, ...func(*Options)) (*DescribeDBSnapshotsOutput, error) +} + +var _ DescribeDBSnapshotsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBSnapshots", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSubnetGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSubnetGroups.go new file mode 100644 index 00000000..be077281 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeDBSubnetGroups.go @@ -0,0 +1,285 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is +// specified, the list will contain only the descriptions of the specified +// DBSubnetGroup. +// +// For an overview of CIDR ranges, go to the [Wikipedia Tutorial]. +// +// [Wikipedia Tutorial]: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing +func (c *Client) DescribeDBSubnetGroups(ctx context.Context, params *DescribeDBSubnetGroupsInput, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDBSubnetGroups", params, optFns, c.addOperationDescribeDBSubnetGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDBSubnetGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDBSubnetGroupsInput struct { + + // The name of the DB subnet group to return details for. + DBSubnetGroupName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeDBSubnetGroups + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeDBSubnetGroups +// action. +type DescribeDBSubnetGroupsOutput struct { + + // A list of DBSubnetGroup instances. + DBSubnetGroups []types.DBSubnetGroup + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSubnetGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSubnetGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDBSubnetGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeDBSubnetGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSubnetGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeDBSubnetGroupsPaginator is a paginator for DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + options := DescribeDBSubnetGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDBSubnetGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultClusterParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultClusterParameters.go new file mode 100644 index 00000000..79ab2e4f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultClusterParameters.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the default engine and system parameter information for the cluster +// database engine. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +func (c *Client) DescribeEngineDefaultClusterParameters(ctx context.Context, params *DescribeEngineDefaultClusterParametersInput, optFns ...func(*Options)) (*DescribeEngineDefaultClusterParametersOutput, error) { + if params == nil { + params = &DescribeEngineDefaultClusterParametersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEngineDefaultClusterParameters", params, optFns, c.addOperationDescribeEngineDefaultClusterParametersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEngineDefaultClusterParametersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEngineDefaultClusterParametersInput struct { + + // The name of the DB cluster parameter group family to return engine parameter + // information for. + // + // This member is required. + DBParameterGroupFamily *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribeEngineDefaultClusterParameters request. If this parameter is specified, + // the response includes only records beyond the marker, up to the value specified + // by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeEngineDefaultClusterParametersOutput struct { + + // Contains the result of a successful invocation of the + // DescribeEngineDefaultParameters action. + EngineDefaults *types.EngineDefaults + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEngineDefaultClusterParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEngineDefaultClusterParameters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEngineDefaultClusterParameters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEngineDefaultClusterParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeEngineDefaultClusterParametersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEngineDefaultClusterParameters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeEngineDefaultClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeEngineDefaultClusterParameters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultParameters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultParameters.go new file mode 100644 index 00000000..2e28889f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEngineDefaultParameters.go @@ -0,0 +1,385 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the default engine and system parameter information for the specified +// database engine. +func (c *Client) DescribeEngineDefaultParameters(ctx context.Context, params *DescribeEngineDefaultParametersInput, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEngineDefaultParameters", params, optFns, c.addOperationDescribeEngineDefaultParametersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEngineDefaultParametersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEngineDefaultParametersInput struct { + + // The name of the DB parameter group family. + // + // Valid Values: + // + // - aurora-mysql5.7 + // + // - aurora-mysql8.0 + // + // - aurora-postgresql10 + // + // - aurora-postgresql11 + // + // - aurora-postgresql12 + // + // - aurora-postgresql13 + // + // - aurora-postgresql14 + // + // - custom-oracle-ee-19 + // + // - custom-oracle-ee-cdb-19 + // + // - db2-ae + // + // - db2-se + // + // - mariadb10.2 + // + // - mariadb10.3 + // + // - mariadb10.4 + // + // - mariadb10.5 + // + // - mariadb10.6 + // + // - mysql5.7 + // + // - mysql8.0 + // + // - oracle-ee-19 + // + // - oracle-ee-cdb-19 + // + // - oracle-ee-cdb-21 + // + // - oracle-se2-19 + // + // - oracle-se2-cdb-19 + // + // - oracle-se2-cdb-21 + // + // - postgres10 + // + // - postgres11 + // + // - postgres12 + // + // - postgres13 + // + // - postgres14 + // + // - sqlserver-ee-11.0 + // + // - sqlserver-ee-12.0 + // + // - sqlserver-ee-13.0 + // + // - sqlserver-ee-14.0 + // + // - sqlserver-ee-15.0 + // + // - sqlserver-ex-11.0 + // + // - sqlserver-ex-12.0 + // + // - sqlserver-ex-13.0 + // + // - sqlserver-ex-14.0 + // + // - sqlserver-ex-15.0 + // + // - sqlserver-se-11.0 + // + // - sqlserver-se-12.0 + // + // - sqlserver-se-13.0 + // + // - sqlserver-se-14.0 + // + // - sqlserver-se-15.0 + // + // - sqlserver-web-11.0 + // + // - sqlserver-web-12.0 + // + // - sqlserver-web-13.0 + // + // - sqlserver-web-14.0 + // + // - sqlserver-web-15.0 + // + // This member is required. + DBParameterGroupFamily *string + + // A filter that specifies one or more parameters to describe. + // + // The only supported filter is parameter-name . The results list only includes + // information about the parameters with these names. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribeEngineDefaultParameters request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeEngineDefaultParametersOutput struct { + + // Contains the result of a successful invocation of the + // DescribeEngineDefaultParameters action. + EngineDefaults *types.EngineDefaults + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEngineDefaultParameters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEngineDefaultParameters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEngineDefaultParameters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeEngineDefaultParametersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + options := DescribeEngineDefaultParametersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeEngineDefaultParameters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventCategories.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventCategories.go new file mode 100644 index 00000000..c7e2bd21 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventCategories.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays a list of categories for all event source types, or, if specified, for +// a specified source type. You can also see this list in the "Amazon RDS event +// categories and event messages" section of the [Amazon RDS User Guide]or the [Amazon Aurora User Guide]. +// +// [Amazon RDS User Guide]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html +// [Amazon Aurora User Guide]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html +func (c *Client) DescribeEventCategories(ctx context.Context, params *DescribeEventCategoriesInput, optFns ...func(*Options)) (*DescribeEventCategoriesOutput, error) { + if params == nil { + params = &DescribeEventCategoriesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEventCategories", params, optFns, c.addOperationDescribeEventCategoriesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEventCategoriesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEventCategoriesInput struct { + + // This parameter isn't currently supported. + Filters []types.Filter + + // The type of source that is generating the events. For RDS Proxy events, specify + // db-proxy . + // + // Valid Values: db-instance | db-cluster | db-parameter-group | db-security-group + // | db-snapshot | db-cluster-snapshot | db-proxy + SourceType *string + + noSmithyDocumentSerde +} + +// Data returned from the DescribeEventCategories operation. +type DescribeEventCategoriesOutput struct { + + // A list of EventCategoriesMap data types. + EventCategoriesMapList []types.EventCategoriesMap + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEventCategoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEventCategories{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEventCategories{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEventCategories"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeEventCategoriesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEventCategories(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeEventCategories(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeEventCategories", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventSubscriptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventSubscriptions.go new file mode 100644 index 00000000..60972127 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEventSubscriptions.go @@ -0,0 +1,286 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the subscription descriptions for a customer account. The description +// for a subscription includes SubscriptionName , SNSTopicARN , CustomerID , +// SourceType , SourceID , CreationTime , and Status . +// +// If you specify a SubscriptionName , lists the description for that subscription. +func (c *Client) DescribeEventSubscriptions(ctx context.Context, params *DescribeEventSubscriptionsInput, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEventSubscriptions", params, optFns, c.addOperationDescribeEventSubscriptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEventSubscriptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEventSubscriptionsInput struct { + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The name of the RDS event notification subscription you want to describe. + SubscriptionName *string + + noSmithyDocumentSerde +} + +// Data returned by the DescribeEventSubscriptions action. +type DescribeEventSubscriptionsOutput struct { + + // A list of EventSubscriptions data types. + EventSubscriptionsList []types.EventSubscription + + // An optional pagination token provided by a previous + // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEventSubscriptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEventSubscriptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEventSubscriptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeEventSubscriptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEventSubscriptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + options := DescribeEventSubscriptionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeEventSubscriptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEvents.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEvents.go new file mode 100644 index 00000000..9d3e1e9d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeEvents.go @@ -0,0 +1,346 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns events related to DB instances, DB clusters, DB parameter groups, DB +// security groups, DB snapshots, DB cluster snapshots, and RDS Proxies for the +// past 14 days. Events specific to a particular DB instance, DB cluster, DB +// parameter group, DB security group, DB snapshot, DB cluster snapshot group, or +// RDS Proxy can be obtained by providing the name as a parameter. +// +// For more information on working with events, see [Monitoring Amazon RDS events] in the Amazon RDS User Guide +// and [Monitoring Amazon Aurora events]in the Amazon Aurora User Guide. +// +// By default, RDS returns events that were generated in the past hour. +// +// [Monitoring Amazon RDS events]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/working-with-events.html +// [Monitoring Amazon Aurora events]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/working-with-events.html +func (c *Client) DescribeEvents(ctx context.Context, params *DescribeEventsInput, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if params == nil { + params = &DescribeEventsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEvents", params, optFns, c.addOperationDescribeEventsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEventsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEventsInput struct { + + // The number of minutes to retrieve events for. + // + // Default: 60 + Duration *int32 + + // The end of the time interval for which to retrieve events, specified in ISO + // 8601 format. For more information about ISO 8601, go to the [ISO8601 Wikipedia page.] + // + // Example: 2009-07-08T18:00Z + // + // [ISO8601 Wikipedia page.]: http://en.wikipedia.org/wiki/ISO_8601 + EndTime *time.Time + + // A list of event categories that trigger notifications for a event notification + // subscription. + EventCategories []string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeEvents request. If + // this parameter is specified, the response includes only records beyond the + // marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The identifier of the event source for which events are returned. If not + // specified, then all sources are included in the response. + // + // Constraints: + // + // - If SourceIdentifier is supplied, SourceType must also be provided. + // + // - If the source type is a DB instance, a DBInstanceIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster, a DBClusterIdentifier value must be + // supplied. + // + // - If the source type is a DB parameter group, a DBParameterGroupName value + // must be supplied. + // + // - If the source type is a DB security group, a DBSecurityGroupName value must + // be supplied. + // + // - If the source type is a DB snapshot, a DBSnapshotIdentifier value must be + // supplied. + // + // - If the source type is a DB cluster snapshot, a DBClusterSnapshotIdentifier + // value must be supplied. + // + // - If the source type is an RDS Proxy, a DBProxyName value must be supplied. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + SourceIdentifier *string + + // The event source to retrieve events for. If no value is specified, all events + // are returned. + SourceType types.SourceType + + // The beginning of the time interval to retrieve events for, specified in ISO + // 8601 format. For more information about ISO 8601, go to the [ISO8601 Wikipedia page.] + // + // Example: 2009-07-08T18:00Z + // + // [ISO8601 Wikipedia page.]: http://en.wikipedia.org/wiki/ISO_8601 + StartTime *time.Time + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeEvents action. +type DescribeEventsOutput struct { + + // A list of Event instances. + Events []types.Event + + // An optional pagination token provided by a previous Events request. If this + // parameter is specified, the response includes only records beyond the marker, up + // to the value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEvents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEvents{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEvents"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeEventsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEvents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeEventsPaginator is a paginator for DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + if params == nil { + params = &DescribeEventsInput{} + } + + options := DescribeEventsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeEvents", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeExportTasks.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeExportTasks.go new file mode 100644 index 00000000..559c6f97 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeExportTasks.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a snapshot or cluster export to Amazon S3. This API +// operation supports pagination. +func (c *Client) DescribeExportTasks(ctx context.Context, params *DescribeExportTasksInput, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { + if params == nil { + params = &DescribeExportTasksInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeExportTasks", params, optFns, c.addOperationDescribeExportTasksMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeExportTasksOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeExportTasksInput struct { + + // The identifier of the snapshot or cluster export task to be described. + ExportTaskIdentifier *string + + // Filters specify one or more snapshot or cluster exports to describe. The + // filters are specified as name-value pairs that define what to include in the + // output. Filter names and values are case-sensitive. + // + // Supported filters include the following: + // + // - export-task-identifier - An identifier for the snapshot or cluster export + // task. + // + // - s3-bucket - The Amazon S3 bucket the data is exported to. + // + // - source-arn - The Amazon Resource Name (ARN) of the snapshot or cluster + // exported to Amazon S3. + // + // - status - The status of the export task. Must be lowercase. Valid statuses + // are the following: + // + // - canceled + // + // - canceling + // + // - complete + // + // - failed + // + // - in_progress + // + // - starting + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeExportTasks + // request. If you specify this parameter, the response includes only records + // beyond the marker, up to the value specified by the MaxRecords parameter. + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified value, a pagination token called a marker is included in the + // response. You can use the marker in a later DescribeExportTasks request to + // retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. + SourceArn *string + + // The type of source for the export. + SourceType types.ExportSourceType + + noSmithyDocumentSerde +} + +type DescribeExportTasksOutput struct { + + // Information about an export of a snapshot or cluster to Amazon S3. + ExportTasks []types.ExportTask + + // A pagination token that can be used in a later DescribeExportTasks request. A + // marker is used for pagination to identify the location to begin output for the + // next response of DescribeExportTasks . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeExportTasksMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeExportTasks{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeExportTasks{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeExportTasks"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeExportTasksValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExportTasks(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeExportTasksPaginatorOptions is the paginator options for +// DescribeExportTasks +type DescribeExportTasksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified value, a pagination token called a marker is included in the + // response. You can use the marker in a later DescribeExportTasks request to + // retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeExportTasksPaginator is a paginator for DescribeExportTasks +type DescribeExportTasksPaginator struct { + options DescribeExportTasksPaginatorOptions + client DescribeExportTasksAPIClient + params *DescribeExportTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeExportTasksPaginator returns a new DescribeExportTasksPaginator +func NewDescribeExportTasksPaginator(client DescribeExportTasksAPIClient, params *DescribeExportTasksInput, optFns ...func(*DescribeExportTasksPaginatorOptions)) *DescribeExportTasksPaginator { + if params == nil { + params = &DescribeExportTasksInput{} + } + + options := DescribeExportTasksPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeExportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportTasksPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeExportTasks page. +func (p *DescribeExportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeExportTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeExportTasksAPIClient is a client that implements the +// DescribeExportTasks operation. +type DescribeExportTasksAPIClient interface { + DescribeExportTasks(context.Context, *DescribeExportTasksInput, ...func(*Options)) (*DescribeExportTasksOutput, error) +} + +var _ DescribeExportTasksAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeExportTasks(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeExportTasks", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeGlobalClusters.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeGlobalClusters.go new file mode 100644 index 00000000..46aea090 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeGlobalClusters.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about Aurora global database clusters. This API supports +// pagination. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// This action only applies to Aurora DB clusters. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +func (c *Client) DescribeGlobalClusters(ctx context.Context, params *DescribeGlobalClustersInput, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { + if params == nil { + params = &DescribeGlobalClustersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeGlobalClusters", params, optFns, c.addOperationDescribeGlobalClustersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeGlobalClustersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeGlobalClustersInput struct { + + // A filter that specifies one or more global database clusters to describe. This + // parameter is case-sensitive. + // + // Currently, the only supported filter is region . + // + // If used, the request returns information about any global cluster with at least + // one member (primary or secondary) in the specified Amazon Web Services Regions. + Filters []types.Filter + + // The user-supplied DB cluster identifier. If this parameter is specified, + // information from only the specific DB cluster is returned. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - If supplied, must match an existing DBClusterIdentifier. + GlobalClusterIdentifier *string + + // An optional pagination token provided by a previous DescribeGlobalClusters + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeGlobalClustersOutput struct { + + // The list of global clusters returned by this request. + GlobalClusters []types.GlobalCluster + + // An optional pagination token provided by a previous DescribeGlobalClusters + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeGlobalClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeGlobalClusters{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeGlobalClusters{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeGlobalClusters"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeGlobalClustersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGlobalClusters(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeGlobalClustersPaginatorOptions is the paginator options for +// DescribeGlobalClusters +type DescribeGlobalClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeGlobalClustersPaginator is a paginator for DescribeGlobalClusters +type DescribeGlobalClustersPaginator struct { + options DescribeGlobalClustersPaginatorOptions + client DescribeGlobalClustersAPIClient + params *DescribeGlobalClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeGlobalClustersPaginator returns a new DescribeGlobalClustersPaginator +func NewDescribeGlobalClustersPaginator(client DescribeGlobalClustersAPIClient, params *DescribeGlobalClustersInput, optFns ...func(*DescribeGlobalClustersPaginatorOptions)) *DescribeGlobalClustersPaginator { + if params == nil { + params = &DescribeGlobalClustersInput{} + } + + options := DescribeGlobalClustersPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeGlobalClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalClustersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeGlobalClusters page. +func (p *DescribeGlobalClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeGlobalClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeGlobalClustersAPIClient is a client that implements the +// DescribeGlobalClusters operation. +type DescribeGlobalClustersAPIClient interface { + DescribeGlobalClusters(context.Context, *DescribeGlobalClustersInput, ...func(*Options)) (*DescribeGlobalClustersOutput, error) +} + +var _ DescribeGlobalClustersAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeGlobalClusters(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeGlobalClusters", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeIntegrations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeIntegrations.go new file mode 100644 index 00000000..eeb4d498 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeIntegrations.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describe one or more zero-ETL integrations with Amazon Redshift. +func (c *Client) DescribeIntegrations(ctx context.Context, params *DescribeIntegrationsInput, optFns ...func(*Options)) (*DescribeIntegrationsOutput, error) { + if params == nil { + params = &DescribeIntegrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeIntegrations", params, optFns, c.addOperationDescribeIntegrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeIntegrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeIntegrationsInput struct { + + // A filter that specifies one or more resources to return. + Filters []types.Filter + + // The unique identifier of the integration. + IntegrationIdentifier *string + + // An optional pagination token provided by a previous DescribeIntegrations + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeIntegrationsOutput struct { + + // A list of integrations. + Integrations []types.Integration + + // A pagination token that can be used in a later DescribeIntegrations request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeIntegrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeIntegrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeIntegrations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIntegrations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeIntegrationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIntegrations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeIntegrationsPaginatorOptions is the paginator options for +// DescribeIntegrations +type DescribeIntegrationsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeIntegrationsPaginator is a paginator for DescribeIntegrations +type DescribeIntegrationsPaginator struct { + options DescribeIntegrationsPaginatorOptions + client DescribeIntegrationsAPIClient + params *DescribeIntegrationsInput + nextToken *string + firstPage bool +} + +// NewDescribeIntegrationsPaginator returns a new DescribeIntegrationsPaginator +func NewDescribeIntegrationsPaginator(client DescribeIntegrationsAPIClient, params *DescribeIntegrationsInput, optFns ...func(*DescribeIntegrationsPaginatorOptions)) *DescribeIntegrationsPaginator { + if params == nil { + params = &DescribeIntegrationsInput{} + } + + options := DescribeIntegrationsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeIntegrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeIntegrationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeIntegrations page. +func (p *DescribeIntegrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIntegrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeIntegrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeIntegrationsAPIClient is a client that implements the +// DescribeIntegrations operation. +type DescribeIntegrationsAPIClient interface { + DescribeIntegrations(context.Context, *DescribeIntegrationsInput, ...func(*Options)) (*DescribeIntegrationsOutput, error) +} + +var _ DescribeIntegrationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeIntegrations", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroupOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroupOptions.go new file mode 100644 index 00000000..290a6d63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroupOptions.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes all available options for the specified engine. +func (c *Client) DescribeOptionGroupOptions(ctx context.Context, params *DescribeOptionGroupOptionsInput, optFns ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) { + if params == nil { + params = &DescribeOptionGroupOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeOptionGroupOptions", params, optFns, c.addOperationDescribeOptionGroupOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeOptionGroupOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeOptionGroupOptionsInput struct { + + // The name of the engine to describe options for. + // + // Valid Values: + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // This member is required. + EngineName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // If specified, filters the results to include only options for the specified + // major engine version. + MajorEngineVersion *string + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + noSmithyDocumentSerde +} + +type DescribeOptionGroupOptionsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // List of available option group options. + OptionGroupOptions []types.OptionGroupOption + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeOptionGroupOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeOptionGroupOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeOptionGroupOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOptionGroupOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeOptionGroupOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOptionGroupOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeOptionGroupOptionsPaginatorOptions is the paginator options for +// DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeOptionGroupOptionsPaginator is a paginator for +// DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginator struct { + options DescribeOptionGroupOptionsPaginatorOptions + client DescribeOptionGroupOptionsAPIClient + params *DescribeOptionGroupOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOptionGroupOptionsPaginator returns a new +// DescribeOptionGroupOptionsPaginator +func NewDescribeOptionGroupOptionsPaginator(client DescribeOptionGroupOptionsAPIClient, params *DescribeOptionGroupOptionsInput, optFns ...func(*DescribeOptionGroupOptionsPaginatorOptions)) *DescribeOptionGroupOptionsPaginator { + if params == nil { + params = &DescribeOptionGroupOptionsInput{} + } + + options := DescribeOptionGroupOptionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeOptionGroupOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupOptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeOptionGroupOptions page. +func (p *DescribeOptionGroupOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeOptionGroupOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeOptionGroupOptionsAPIClient is a client that implements the +// DescribeOptionGroupOptions operation. +type DescribeOptionGroupOptionsAPIClient interface { + DescribeOptionGroupOptions(context.Context, *DescribeOptionGroupOptionsInput, ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) +} + +var _ DescribeOptionGroupOptionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeOptionGroupOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeOptionGroupOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroups.go new file mode 100644 index 00000000..b9886bac --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOptionGroups.go @@ -0,0 +1,315 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the available option groups. +func (c *Client) DescribeOptionGroups(ctx context.Context, params *DescribeOptionGroupsInput, optFns ...func(*Options)) (*DescribeOptionGroupsOutput, error) { + if params == nil { + params = &DescribeOptionGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeOptionGroups", params, optFns, c.addOperationDescribeOptionGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeOptionGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeOptionGroupsInput struct { + + // A filter to only include option groups associated with this database engine. + // + // Valid Values: + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + EngineName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // Filters the list of option groups to only include groups associated with a + // specific database engine version. If specified, then EngineName must also be + // specified. + MajorEngineVersion *string + + // An optional pagination token provided by a previous DescribeOptionGroups + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The name of the option group to describe. Can't be supplied together with + // EngineName or MajorEngineVersion. + OptionGroupName *string + + noSmithyDocumentSerde +} + +// List of option groups. +type DescribeOptionGroupsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // List of option groups. + OptionGroupsList []types.OptionGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeOptionGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeOptionGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeOptionGroups{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOptionGroups"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeOptionGroupsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOptionGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeOptionGroupsPaginatorOptions is the paginator options for +// DescribeOptionGroups +type DescribeOptionGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeOptionGroupsPaginator is a paginator for DescribeOptionGroups +type DescribeOptionGroupsPaginator struct { + options DescribeOptionGroupsPaginatorOptions + client DescribeOptionGroupsAPIClient + params *DescribeOptionGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeOptionGroupsPaginator returns a new DescribeOptionGroupsPaginator +func NewDescribeOptionGroupsPaginator(client DescribeOptionGroupsAPIClient, params *DescribeOptionGroupsInput, optFns ...func(*DescribeOptionGroupsPaginatorOptions)) *DescribeOptionGroupsPaginator { + if params == nil { + params = &DescribeOptionGroupsInput{} + } + + options := DescribeOptionGroupsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeOptionGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeOptionGroups page. +func (p *DescribeOptionGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeOptionGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeOptionGroupsAPIClient is a client that implements the +// DescribeOptionGroups operation. +type DescribeOptionGroupsAPIClient interface { + DescribeOptionGroups(context.Context, *DescribeOptionGroupsInput, ...func(*Options)) (*DescribeOptionGroupsOutput, error) +} + +var _ DescribeOptionGroupsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeOptionGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeOptionGroups", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOrderableDBInstanceOptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOrderableDBInstanceOptions.go new file mode 100644 index 00000000..2df96a9e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeOrderableDBInstanceOptions.go @@ -0,0 +1,353 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the orderable DB instance options for a specified DB engine. +func (c *Client) DescribeOrderableDBInstanceOptions(ctx context.Context, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeOrderableDBInstanceOptions", params, optFns, c.addOperationDescribeOrderableDBInstanceOptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeOrderableDBInstanceOptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeOrderableDBInstanceOptionsInput struct { + + // The name of the database engine to describe DB instance options for. + // + // Valid Values: + // + // - aurora-mysql + // + // - aurora-postgresql + // + // - custom-oracle-ee + // + // - custom-oracle-ee-cdb + // + // - custom-oracle-se2 + // + // - custom-oracle-se2-cdb + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // This member is required. + Engine *string + + // The Availability Zone group associated with a Local Zone. Specify this + // parameter to retrieve available options for the Local Zones in the group. + // + // Omit this parameter to show the available options in the specified Amazon Web + // Services Region. + // + // This setting doesn't apply to RDS Custom DB instances. + AvailabilityZoneGroup *string + + // A filter to include only the available options for the specified DB instance + // class. + DBInstanceClass *string + + // A filter to include only the available options for the specified engine version. + EngineVersion *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // A filter to include only the available options for the specified license model. + // + // RDS Custom supports only the BYOL licensing model. + LicenseModel *string + + // An optional pagination token provided by a previous + // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the + // response includes only records beyond the marker, up to the value specified by + // MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 1000. + MaxRecords *int32 + + // Specifies whether to show only VPC or non-VPC offerings. RDS Custom supports + // only VPC offerings. + // + // RDS Custom supports only VPC offerings. If you describe non-VPC offerings for + // RDS Custom, the output shows VPC offerings. + Vpc *bool + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeOrderableDBInstanceOptions action. +type DescribeOrderableDBInstanceOptionsOutput struct { + + // An optional pagination token provided by a previous OrderableDBInstanceOptions + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // An OrderableDBInstanceOption structure containing information about orderable + // options for the DB instance. + OrderableDBInstanceOptions []types.OrderableDBInstanceOption + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeOrderableDBInstanceOptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeOrderableDBInstanceOptions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOrderableDBInstanceOptions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeOrderableDBInstanceOptionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 1000. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeOrderableDBInstanceOptions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribePendingMaintenanceActions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribePendingMaintenanceActions.go new file mode 100644 index 00000000..e9d74f63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribePendingMaintenanceActions.go @@ -0,0 +1,300 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of resources (for example, DB instances) that have at least one +// pending maintenance action. +// +// This API follows an eventual consistency model. This means that the result of +// the DescribePendingMaintenanceActions command might not be immediately visible +// to all subsequent RDS commands. Keep this in mind when you use +// DescribePendingMaintenanceActions immediately after using a previous API command +// such as ApplyPendingMaintenanceActions . +func (c *Client) DescribePendingMaintenanceActions(ctx context.Context, params *DescribePendingMaintenanceActionsInput, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribePendingMaintenanceActions", params, optFns, c.addOperationDescribePendingMaintenanceActionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribePendingMaintenanceActionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribePendingMaintenanceActionsInput struct { + + // A filter that specifies one or more resources to return pending maintenance + // actions for. + // + // Supported filters: + // + // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon + // Resource Names (ARNs). The results list only includes pending maintenance + // actions for the DB clusters identified by these ARNs. + // + // - db-instance-id - Accepts DB instance identifiers and DB instance ARNs. The + // results list only includes pending maintenance actions for the DB instances + // identified by these ARNs. + Filters []types.Filter + + // An optional pagination token provided by a previous + // DescribePendingMaintenanceActions request. If this parameter is specified, the + // response includes only records beyond the marker, up to a number of records + // specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The ARN of a resource to return pending maintenance actions for. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +// Data returned from the DescribePendingMaintenanceActions action. +type DescribePendingMaintenanceActionsOutput struct { + + // An optional pagination token provided by a previous + // DescribePendingMaintenanceActions request. If this parameter is specified, the + // response includes only records beyond the marker, up to a number of records + // specified by MaxRecords . + Marker *string + + // A list of the pending maintenance actions for the resource. + PendingMaintenanceActions []types.ResourcePendingMaintenanceActions + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribePendingMaintenanceActions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribePendingMaintenanceActions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePendingMaintenanceActions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribePendingMaintenanceActionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + options := DescribePendingMaintenanceActionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribePendingMaintenanceActions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstances.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstances.go new file mode 100644 index 00000000..a3930be3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstances.go @@ -0,0 +1,317 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about reserved DB instances for this account, or about a +// specified reserved DB instance. +func (c *Client) DescribeReservedDBInstances(ctx context.Context, params *DescribeReservedDBInstancesInput, optFns ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) { + if params == nil { + params = &DescribeReservedDBInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeReservedDBInstances", params, optFns, c.addOperationDescribeReservedDBInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeReservedDBInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeReservedDBInstancesInput struct { + + // The DB instance class filter value. Specify this parameter to show only those + // reservations matching the specified DB instances class. + DBInstanceClass *string + + // The duration filter value, specified in years or seconds. Specify this + // parameter to show only reservations for this duration. + // + // Valid Values: 1 | 3 | 31536000 | 94608000 + Duration *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // The lease identifier filter value. Specify this parameter to show only the + // reservation that matches the specified lease ID. + // + // Amazon Web Services Support might request the lease ID for an issue related to + // a reserved DB instance. + LeaseId *string + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // Specifies whether to show only those reservations that support Multi-AZ. + MultiAZ *bool + + // The offering type filter value. Specify this parameter to show only the + // available offerings matching the specified offering type. + // + // Valid Values: "Partial Upfront" | "All Upfront" | "No Upfront" + OfferingType *string + + // The product description filter value. Specify this parameter to show only those + // reservations matching the specified product description. + ProductDescription *string + + // The reserved DB instance identifier filter value. Specify this parameter to + // show only the reservation that matches the specified reservation ID. + ReservedDBInstanceId *string + + // The offering identifier filter value. Specify this parameter to show only + // purchased reservations matching the specified offering identifier. + ReservedDBInstancesOfferingId *string + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeReservedDBInstances action. +type DescribeReservedDBInstancesOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // A list of reserved DB instances. + ReservedDBInstances []types.ReservedDBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeReservedDBInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeReservedDBInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeReservedDBInstances{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedDBInstances"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeReservedDBInstancesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedDBInstances(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeReservedDBInstancesPaginatorOptions is the paginator options for +// DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeReservedDBInstancesPaginator is a paginator for +// DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginator struct { + options DescribeReservedDBInstancesPaginatorOptions + client DescribeReservedDBInstancesAPIClient + params *DescribeReservedDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedDBInstancesPaginator returns a new +// DescribeReservedDBInstancesPaginator +func NewDescribeReservedDBInstancesPaginator(client DescribeReservedDBInstancesAPIClient, params *DescribeReservedDBInstancesInput, optFns ...func(*DescribeReservedDBInstancesPaginatorOptions)) *DescribeReservedDBInstancesPaginator { + if params == nil { + params = &DescribeReservedDBInstancesInput{} + } + + options := DescribeReservedDBInstancesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeReservedDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeReservedDBInstances page. +func (p *DescribeReservedDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeReservedDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeReservedDBInstancesAPIClient is a client that implements the +// DescribeReservedDBInstances operation. +type DescribeReservedDBInstancesAPIClient interface { + DescribeReservedDBInstances(context.Context, *DescribeReservedDBInstancesInput, ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) +} + +var _ DescribeReservedDBInstancesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeReservedDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeReservedDBInstances", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstancesOfferings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstancesOfferings.go new file mode 100644 index 00000000..36ba3bad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeReservedDBInstancesOfferings.go @@ -0,0 +1,309 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists available reserved DB instance offerings. +func (c *Client) DescribeReservedDBInstancesOfferings(ctx context.Context, params *DescribeReservedDBInstancesOfferingsInput, optFns ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) { + if params == nil { + params = &DescribeReservedDBInstancesOfferingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeReservedDBInstancesOfferings", params, optFns, c.addOperationDescribeReservedDBInstancesOfferingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeReservedDBInstancesOfferingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeReservedDBInstancesOfferingsInput struct { + + // The DB instance class filter value. Specify this parameter to show only the + // available offerings matching the specified DB instance class. + DBInstanceClass *string + + // Duration filter value, specified in years or seconds. Specify this parameter to + // show only reservations for this duration. + // + // Valid Values: 1 | 3 | 31536000 | 94608000 + Duration *string + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // Specifies whether to show only those reservations that support Multi-AZ. + MultiAZ *bool + + // The offering type filter value. Specify this parameter to show only the + // available offerings matching the specified offering type. + // + // Valid Values: "Partial Upfront" | "All Upfront" | "No Upfront" + OfferingType *string + + // Product description filter value. Specify this parameter to show only the + // available offerings that contain the specified product description. + // + // The results show offerings that partially match the filter value. + ProductDescription *string + + // The offering identifier filter value. Specify this parameter to show only the + // available offering that matches the specified reservation identifier. + // + // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 + ReservedDBInstancesOfferingId *string + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeReservedDBInstancesOfferings action. +type DescribeReservedDBInstancesOfferingsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // A list of reserved DB instance offerings. + ReservedDBInstancesOfferings []types.ReservedDBInstancesOffering + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeReservedDBInstancesOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeReservedDBInstancesOfferings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeReservedDBInstancesOfferings{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeReservedDBInstancesOfferings"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeReservedDBInstancesOfferingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReservedDBInstancesOfferings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeReservedDBInstancesOfferingsPaginatorOptions is the paginator options +// for DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeReservedDBInstancesOfferingsPaginator is a paginator for +// DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginator struct { + options DescribeReservedDBInstancesOfferingsPaginatorOptions + client DescribeReservedDBInstancesOfferingsAPIClient + params *DescribeReservedDBInstancesOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedDBInstancesOfferingsPaginator returns a new +// DescribeReservedDBInstancesOfferingsPaginator +func NewDescribeReservedDBInstancesOfferingsPaginator(client DescribeReservedDBInstancesOfferingsAPIClient, params *DescribeReservedDBInstancesOfferingsInput, optFns ...func(*DescribeReservedDBInstancesOfferingsPaginatorOptions)) *DescribeReservedDBInstancesOfferingsPaginator { + if params == nil { + params = &DescribeReservedDBInstancesOfferingsInput{} + } + + options := DescribeReservedDBInstancesOfferingsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeReservedDBInstancesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesOfferingsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeReservedDBInstancesOfferings page. +func (p *DescribeReservedDBInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeReservedDBInstancesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeReservedDBInstancesOfferingsAPIClient is a client that implements the +// DescribeReservedDBInstancesOfferings operation. +type DescribeReservedDBInstancesOfferingsAPIClient interface { + DescribeReservedDBInstancesOfferings(context.Context, *DescribeReservedDBInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) +} + +var _ DescribeReservedDBInstancesOfferingsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeReservedDBInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeReservedDBInstancesOfferings", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeSourceRegions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeSourceRegions.go new file mode 100644 index 00000000..6eda75e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeSourceRegions.go @@ -0,0 +1,297 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of the source Amazon Web Services Regions where the current +// Amazon Web Services Region can create a read replica, copy a DB snapshot from, +// or replicate automated backups from. +// +// Use this operation to determine whether cross-Region features are supported +// between other Regions and your current Region. This operation supports +// pagination. +// +// To return information about the Regions that are enabled for your account, or +// all Regions, use the EC2 operation DescribeRegions . For more information, see [DescribeRegions] +// in the Amazon EC2 API Reference. +// +// [DescribeRegions]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRegions.html +func (c *Client) DescribeSourceRegions(ctx context.Context, params *DescribeSourceRegionsInput, optFns ...func(*Options)) (*DescribeSourceRegionsOutput, error) { + if params == nil { + params = &DescribeSourceRegionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeSourceRegions", params, optFns, c.addOperationDescribeSourceRegionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeSourceRegionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeSourceRegionsInput struct { + + // This parameter isn't currently supported. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeSourceRegions + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int32 + + // The source Amazon Web Services Region name. For example, us-east-1 . + // + // Constraints: + // + // - Must specify a valid Amazon Web Services Region name. + RegionName *string + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the DescribeSourceRegions +// action. +type DescribeSourceRegionsOutput struct { + + // An optional pagination token provided by a previous request. If this parameter + // is specified, the response includes only records beyond the marker, up to the + // value specified by MaxRecords . + Marker *string + + // A list of SourceRegion instances that contains each source Amazon Web Services + // Region that the current Amazon Web Services Region can get a read replica or a + // DB snapshot from. + SourceRegions []types.SourceRegion + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeSourceRegionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeSourceRegions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeSourceRegions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeSourceRegions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeSourceRegionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSourceRegions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeSourceRegionsPaginatorOptions is the paginator options for +// DescribeSourceRegions +type DescribeSourceRegionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeSourceRegionsPaginator is a paginator for DescribeSourceRegions +type DescribeSourceRegionsPaginator struct { + options DescribeSourceRegionsPaginatorOptions + client DescribeSourceRegionsAPIClient + params *DescribeSourceRegionsInput + nextToken *string + firstPage bool +} + +// NewDescribeSourceRegionsPaginator returns a new DescribeSourceRegionsPaginator +func NewDescribeSourceRegionsPaginator(client DescribeSourceRegionsAPIClient, params *DescribeSourceRegionsInput, optFns ...func(*DescribeSourceRegionsPaginatorOptions)) *DescribeSourceRegionsPaginator { + if params == nil { + params = &DescribeSourceRegionsInput{} + } + + options := DescribeSourceRegionsPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeSourceRegionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSourceRegionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeSourceRegions page. +func (p *DescribeSourceRegionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSourceRegionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeSourceRegions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeSourceRegionsAPIClient is a client that implements the +// DescribeSourceRegions operation. +type DescribeSourceRegionsAPIClient interface { + DescribeSourceRegions(context.Context, *DescribeSourceRegionsInput, ...func(*Options)) (*DescribeSourceRegionsOutput, error) +} + +var _ DescribeSourceRegionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeSourceRegions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeSourceRegions", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeTenantDatabases.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeTenantDatabases.go new file mode 100644 index 00000000..3dd381c3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeTenantDatabases.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + smithywaiter "github.com/aws/smithy-go/waiter" + jmespath "github.com/jmespath/go-jmespath" + "strconv" + "time" +) + +// Describes the tenant databases in a DB instance that uses the multi-tenant +// configuration. Only RDS for Oracle CDB instances are supported. +func (c *Client) DescribeTenantDatabases(ctx context.Context, params *DescribeTenantDatabasesInput, optFns ...func(*Options)) (*DescribeTenantDatabasesOutput, error) { + if params == nil { + params = &DescribeTenantDatabasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeTenantDatabases", params, optFns, c.addOperationDescribeTenantDatabasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeTenantDatabasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeTenantDatabasesInput struct { + + // The user-supplied DB instance identifier, which must match the identifier of an + // existing instance owned by the Amazon Web Services account. This parameter isn't + // case-sensitive. + DBInstanceIdentifier *string + + // A filter that specifies one or more database tenants to describe. + // + // Supported filters: + // + // - tenant-db-name - Tenant database names. The results list only includes + // information about the tenant databases that match these tenant DB names. + // + // - tenant-database-resource-id - Tenant database resource identifiers. + // + // - dbi-resource-id - DB instance resource identifiers. The results list only + // includes information about the tenants contained within the DB instances + // identified by these resource identifiers. + Filters []types.Filter + + // An optional pagination token provided by a previous DescribeTenantDatabases + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + MaxRecords *int32 + + // The user-supplied tenant database name, which must match the name of an + // existing tenant database on the specified DB instance owned by your Amazon Web + // Services account. This parameter isn’t case-sensitive. + TenantDBName *string + + noSmithyDocumentSerde +} + +type DescribeTenantDatabasesOutput struct { + + // An optional pagination token provided by a previous DescribeTenantDatabases + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords . + Marker *string + + // An array of the tenant databases requested by the DescribeTenantDatabases + // operation. + TenantDatabases []types.TenantDatabase + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeTenantDatabasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeTenantDatabases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeTenantDatabases{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeTenantDatabases"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeTenantDatabasesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTenantDatabases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// TenantDatabaseAvailableWaiterOptions are waiter options for +// TenantDatabaseAvailableWaiter +type TenantDatabaseAvailableWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // TenantDatabaseAvailableWaiter will use default minimum delay of 30 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, TenantDatabaseAvailableWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeTenantDatabasesInput, *DescribeTenantDatabasesOutput, error) (bool, error) +} + +// TenantDatabaseAvailableWaiter defines the waiters for TenantDatabaseAvailable +type TenantDatabaseAvailableWaiter struct { + client DescribeTenantDatabasesAPIClient + + options TenantDatabaseAvailableWaiterOptions +} + +// NewTenantDatabaseAvailableWaiter constructs a TenantDatabaseAvailableWaiter. +func NewTenantDatabaseAvailableWaiter(client DescribeTenantDatabasesAPIClient, optFns ...func(*TenantDatabaseAvailableWaiterOptions)) *TenantDatabaseAvailableWaiter { + options := TenantDatabaseAvailableWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = tenantDatabaseAvailableStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &TenantDatabaseAvailableWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for TenantDatabaseAvailable waiter. The +// maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is +// required and must be greater than zero. +func (w *TenantDatabaseAvailableWaiter) Wait(ctx context.Context, params *DescribeTenantDatabasesInput, maxWaitDur time.Duration, optFns ...func(*TenantDatabaseAvailableWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for TenantDatabaseAvailable waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *TenantDatabaseAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeTenantDatabasesInput, maxWaitDur time.Duration, optFns ...func(*TenantDatabaseAvailableWaiterOptions)) (*DescribeTenantDatabasesOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeTenantDatabases(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for TenantDatabaseAvailable waiter") +} + +func tenantDatabaseAvailableStateRetryable(ctx context.Context, input *DescribeTenantDatabasesInput, output *DescribeTenantDatabasesOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("TenantDatabases[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "available" + var match = true + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + if len(listOfValues) == 0 { + match = false + } + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) != expectedValue { + match = false + } + } + + if match { + return false, nil + } + } + + if err == nil { + pathValue, err := jmespath.Search("TenantDatabases[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "deleted" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("TenantDatabases[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-parameters" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + if err == nil { + pathValue, err := jmespath.Search("TenantDatabases[].Status", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "incompatible-restore" + listOfValues, ok := pathValue.([]interface{}) + if !ok { + return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) + } + + for _, v := range listOfValues { + value, ok := v.(*string) + if !ok { + return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) + } + + if string(*value) == expectedValue { + return false, fmt.Errorf("waiter state transitioned to Failure") + } + } + } + + return true, nil +} + +// TenantDatabaseDeletedWaiterOptions are waiter options for +// TenantDatabaseDeletedWaiter +type TenantDatabaseDeletedWaiterOptions struct { + + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. + APIOptions []func(*middleware.Stack) error + + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + + // MinDelay is the minimum amount of time to delay between retries. If unset, + // TenantDatabaseDeletedWaiter will use default minimum delay of 30 seconds. Note + // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. + MinDelay time.Duration + + // MaxDelay is the maximum amount of time to delay between retries. If unset or + // set to zero, TenantDatabaseDeletedWaiter will use default max delay of 120 + // seconds. Note that MaxDelay must resolve to value greater than or equal to the + // MinDelay. + MaxDelay time.Duration + + // LogWaitAttempts is used to enable logging for waiter retry attempts + LogWaitAttempts bool + + // Retryable is function that can be used to override the service defined + // waiter-behavior based on operation output, or returned error. This function is + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. + Retryable func(context.Context, *DescribeTenantDatabasesInput, *DescribeTenantDatabasesOutput, error) (bool, error) +} + +// TenantDatabaseDeletedWaiter defines the waiters for TenantDatabaseDeleted +type TenantDatabaseDeletedWaiter struct { + client DescribeTenantDatabasesAPIClient + + options TenantDatabaseDeletedWaiterOptions +} + +// NewTenantDatabaseDeletedWaiter constructs a TenantDatabaseDeletedWaiter. +func NewTenantDatabaseDeletedWaiter(client DescribeTenantDatabasesAPIClient, optFns ...func(*TenantDatabaseDeletedWaiterOptions)) *TenantDatabaseDeletedWaiter { + options := TenantDatabaseDeletedWaiterOptions{} + options.MinDelay = 30 * time.Second + options.MaxDelay = 120 * time.Second + options.Retryable = tenantDatabaseDeletedStateRetryable + + for _, fn := range optFns { + fn(&options) + } + return &TenantDatabaseDeletedWaiter{ + client: client, + options: options, + } +} + +// Wait calls the waiter function for TenantDatabaseDeleted waiter. The maxWaitDur +// is the maximum wait duration the waiter will wait. The maxWaitDur is required +// and must be greater than zero. +func (w *TenantDatabaseDeletedWaiter) Wait(ctx context.Context, params *DescribeTenantDatabasesInput, maxWaitDur time.Duration, optFns ...func(*TenantDatabaseDeletedWaiterOptions)) error { + _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) + return err +} + +// WaitForOutput calls the waiter function for TenantDatabaseDeleted waiter and +// returns the output of the successful operation. The maxWaitDur is the maximum +// wait duration the waiter will wait. The maxWaitDur is required and must be +// greater than zero. +func (w *TenantDatabaseDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeTenantDatabasesInput, maxWaitDur time.Duration, optFns ...func(*TenantDatabaseDeletedWaiterOptions)) (*DescribeTenantDatabasesOutput, error) { + if maxWaitDur <= 0 { + return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") + } + + options := w.options + for _, fn := range optFns { + fn(&options) + } + + if options.MaxDelay <= 0 { + options.MaxDelay = 120 * time.Second + } + + if options.MinDelay > options.MaxDelay { + return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) + } + + ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) + defer cancelFn() + + logger := smithywaiter.Logger{} + remainingTime := maxWaitDur + + var attempt int64 + for { + + attempt++ + apiOptions := options.APIOptions + start := time.Now() + + if options.LogWaitAttempts { + logger.Attempt = attempt + apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) + apiOptions = append(apiOptions, logger.AddLogger) + } + + out, err := w.client.DescribeTenantDatabases(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } + o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } + }) + + retryable, err := options.Retryable(ctx, params, out, err) + if err != nil { + return nil, err + } + if !retryable { + return out, nil + } + + remainingTime -= time.Since(start) + if remainingTime < options.MinDelay || remainingTime <= 0 { + break + } + + // compute exponential backoff between waiter retries + delay, err := smithywaiter.ComputeDelay( + attempt, options.MinDelay, options.MaxDelay, remainingTime, + ) + if err != nil { + return nil, fmt.Errorf("error computing waiter delay, %w", err) + } + + remainingTime -= delay + // sleep for the delay amount before invoking a request + if err := smithytime.SleepWithContext(ctx, delay); err != nil { + return nil, fmt.Errorf("request cancelled while waiting, %w", err) + } + } + return nil, fmt.Errorf("exceeded max wait time for TenantDatabaseDeleted waiter") +} + +func tenantDatabaseDeletedStateRetryable(ctx context.Context, input *DescribeTenantDatabasesInput, output *DescribeTenantDatabasesOutput, err error) (bool, error) { + + if err == nil { + pathValue, err := jmespath.Search("length(TenantDatabases) == `0`", output) + if err != nil { + return false, fmt.Errorf("error evaluating waiter state: %w", err) + } + + expectedValue := "true" + bv, err := strconv.ParseBool(expectedValue) + if err != nil { + return false, fmt.Errorf("error parsing boolean from string %w", err) + } + value, ok := pathValue.(bool) + if !ok { + return false, fmt.Errorf("waiter comparator expected bool value got %T", pathValue) + } + + if value == bv { + return false, nil + } + } + + if err != nil { + var errorType *types.DBInstanceNotFoundFault + if errors.As(err, &errorType) { + return false, nil + } + } + + return true, nil +} + +// DescribeTenantDatabasesPaginatorOptions is the paginator options for +// DescribeTenantDatabases +type DescribeTenantDatabasesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeTenantDatabasesPaginator is a paginator for DescribeTenantDatabases +type DescribeTenantDatabasesPaginator struct { + options DescribeTenantDatabasesPaginatorOptions + client DescribeTenantDatabasesAPIClient + params *DescribeTenantDatabasesInput + nextToken *string + firstPage bool +} + +// NewDescribeTenantDatabasesPaginator returns a new +// DescribeTenantDatabasesPaginator +func NewDescribeTenantDatabasesPaginator(client DescribeTenantDatabasesAPIClient, params *DescribeTenantDatabasesInput, optFns ...func(*DescribeTenantDatabasesPaginatorOptions)) *DescribeTenantDatabasesPaginator { + if params == nil { + params = &DescribeTenantDatabasesInput{} + } + + options := DescribeTenantDatabasesPaginatorOptions{} + if params.MaxRecords != nil { + options.Limit = *params.MaxRecords + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeTenantDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTenantDatabasesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeTenantDatabases page. +func (p *DescribeTenantDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTenantDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxRecords = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeTenantDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeTenantDatabasesAPIClient is a client that implements the +// DescribeTenantDatabases operation. +type DescribeTenantDatabasesAPIClient interface { + DescribeTenantDatabases(context.Context, *DescribeTenantDatabasesInput, ...func(*Options)) (*DescribeTenantDatabasesOutput, error) +} + +var _ DescribeTenantDatabasesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeTenantDatabases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeTenantDatabases", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeValidDBInstanceModifications.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeValidDBInstanceModifications.go new file mode 100644 index 00000000..4cd793db --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DescribeValidDBInstanceModifications.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// You can call DescribeValidDBInstanceModifications to learn what modifications +// you can make to your DB instance. You can use this information when you call +// ModifyDBInstance . +// +// This command doesn't apply to RDS Custom. +func (c *Client) DescribeValidDBInstanceModifications(ctx context.Context, params *DescribeValidDBInstanceModificationsInput, optFns ...func(*Options)) (*DescribeValidDBInstanceModificationsOutput, error) { + if params == nil { + params = &DescribeValidDBInstanceModificationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeValidDBInstanceModifications", params, optFns, c.addOperationDescribeValidDBInstanceModificationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeValidDBInstanceModificationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeValidDBInstanceModificationsInput struct { + + // The customer identifier or the ARN of your DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + noSmithyDocumentSerde +} + +type DescribeValidDBInstanceModificationsOutput struct { + + // Information about valid modifications that you can make to your DB instance. + // Contains the result of a successful call to the + // DescribeValidDBInstanceModifications action. You can use this information when + // you call ModifyDBInstance . + ValidDBInstanceModificationsMessage *types.ValidDBInstanceModificationsMessage + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeValidDBInstanceModificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeValidDBInstanceModifications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeValidDBInstanceModifications{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeValidDBInstanceModifications"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeValidDBInstanceModificationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeValidDBInstanceModifications(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeValidDBInstanceModifications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeValidDBInstanceModifications", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DisableHttpEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DisableHttpEndpoint.go new file mode 100644 index 00000000..cb5fe19e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DisableHttpEndpoint.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disables the HTTP endpoint for the specified DB cluster. Disabling this +// endpoint disables RDS Data API. +// +// For more information, see [Using RDS Data API] in the Amazon Aurora User Guide. +// +// This operation applies only to Aurora Serverless v2 and provisioned DB +// clusters. To disable the HTTP endpoint for Aurora Serverless v1 DB clusters, use +// the EnableHttpEndpoint parameter of the ModifyDBCluster operation. +// +// [Using RDS Data API]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html +func (c *Client) DisableHttpEndpoint(ctx context.Context, params *DisableHttpEndpointInput, optFns ...func(*Options)) (*DisableHttpEndpointOutput, error) { + if params == nil { + params = &DisableHttpEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableHttpEndpoint", params, optFns, c.addOperationDisableHttpEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableHttpEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableHttpEndpointInput struct { + + // The Amazon Resource Name (ARN) of the DB cluster. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DisableHttpEndpointOutput struct { + + // Indicates whether the HTTP endpoint is enabled or disabled for the DB cluster. + HttpEndpointEnabled *bool + + // The ARN of the DB cluster. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableHttpEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDisableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDisableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisableHttpEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDisableHttpEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableHttpEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisableHttpEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisableHttpEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DownloadDBLogFilePortion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DownloadDBLogFilePortion.go new file mode 100644 index 00000000..9bde86c1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_DownloadDBLogFilePortion.go @@ -0,0 +1,320 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Downloads all or a portion of the specified log file, up to 1 MB in size. +// +// This command doesn't apply to RDS Custom. +func (c *Client) DownloadDBLogFilePortion(ctx context.Context, params *DownloadDBLogFilePortionInput, optFns ...func(*Options)) (*DownloadDBLogFilePortionOutput, error) { + if params == nil { + params = &DownloadDBLogFilePortionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DownloadDBLogFilePortion", params, optFns, c.addOperationDownloadDBLogFilePortionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DownloadDBLogFilePortionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DownloadDBLogFilePortionInput struct { + + // The customer-assigned name of the DB instance that contains the log files you + // want to list. + // + // Constraints: + // + // - Must match the identifier of an existing DBInstance. + // + // This member is required. + DBInstanceIdentifier *string + + // The name of the log file to be downloaded. + // + // This member is required. + LogFileName *string + + // The pagination token provided in the previous request or "0". If the Marker + // parameter is specified the response includes only records beyond the marker + // until the end of the file or up to NumberOfLines. + Marker *string + + // The number of lines to download. If the number of lines specified results in a + // file over 1 MB in size, the file is truncated at 1 MB in size. + // + // If the NumberOfLines parameter is specified, then the block of lines returned + // can be from the beginning or the end of the log file, depending on the value of + // the Marker parameter. + // + // - If neither Marker or NumberOfLines are specified, the entire log file is + // returned up to a maximum of 10000 lines, starting with the most recent log + // entries first. + // + // - If NumberOfLines is specified and Marker isn't specified, then the most + // recent lines from the end of the log file are returned. + // + // - If Marker is specified as "0", then the specified number of lines from the + // beginning of the log file are returned. + // + // - You can download the log file in blocks of lines by specifying the size of + // the block using the NumberOfLines parameter, and by specifying a value of "0" + // for the Marker parameter in your first request. Include the Marker value + // returned in the response as the Marker value for the next request, continuing + // until the AdditionalDataPending response element returns false. + NumberOfLines *int32 + + noSmithyDocumentSerde +} + +// This data type is used as a response element to DownloadDBLogFilePortion . +type DownloadDBLogFilePortionOutput struct { + + // A Boolean value that, if true, indicates there is more data to be downloaded. + AdditionalDataPending *bool + + // Entries from the specified log file. + LogFileData *string + + // A pagination token that can be used in a later DownloadDBLogFilePortion request. + Marker *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDownloadDBLogFilePortionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDownloadDBLogFilePortion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDownloadDBLogFilePortion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DownloadDBLogFilePortion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDownloadDBLogFilePortionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDownloadDBLogFilePortion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DownloadDBLogFilePortionPaginatorOptions is the paginator options for +// DownloadDBLogFilePortion +type DownloadDBLogFilePortionPaginatorOptions struct { + // The number of lines to download. If the number of lines specified results in a + // file over 1 MB in size, the file is truncated at 1 MB in size. + // + // If the NumberOfLines parameter is specified, then the block of lines returned + // can be from the beginning or the end of the log file, depending on the value of + // the Marker parameter. + // + // - If neither Marker or NumberOfLines are specified, the entire log file is + // returned up to a maximum of 10000 lines, starting with the most recent log + // entries first. + // + // - If NumberOfLines is specified and Marker isn't specified, then the most + // recent lines from the end of the log file are returned. + // + // - If Marker is specified as "0", then the specified number of lines from the + // beginning of the log file are returned. + // + // - You can download the log file in blocks of lines by specifying the size of + // the block using the NumberOfLines parameter, and by specifying a value of "0" + // for the Marker parameter in your first request. Include the Marker value + // returned in the response as the Marker value for the next request, continuing + // until the AdditionalDataPending response element returns false. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DownloadDBLogFilePortionPaginator is a paginator for DownloadDBLogFilePortion +type DownloadDBLogFilePortionPaginator struct { + options DownloadDBLogFilePortionPaginatorOptions + client DownloadDBLogFilePortionAPIClient + params *DownloadDBLogFilePortionInput + nextToken *string + firstPage bool +} + +// NewDownloadDBLogFilePortionPaginator returns a new +// DownloadDBLogFilePortionPaginator +func NewDownloadDBLogFilePortionPaginator(client DownloadDBLogFilePortionAPIClient, params *DownloadDBLogFilePortionInput, optFns ...func(*DownloadDBLogFilePortionPaginatorOptions)) *DownloadDBLogFilePortionPaginator { + if params == nil { + params = &DownloadDBLogFilePortionInput{} + } + + options := DownloadDBLogFilePortionPaginatorOptions{} + if params.NumberOfLines != nil { + options.Limit = *params.NumberOfLines + } + + for _, fn := range optFns { + fn(&options) + } + + return &DownloadDBLogFilePortionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DownloadDBLogFilePortionPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DownloadDBLogFilePortion page. +func (p *DownloadDBLogFilePortionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DownloadDBLogFilePortionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.NumberOfLines = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DownloadDBLogFilePortion(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DownloadDBLogFilePortionAPIClient is a client that implements the +// DownloadDBLogFilePortion operation. +type DownloadDBLogFilePortionAPIClient interface { + DownloadDBLogFilePortion(context.Context, *DownloadDBLogFilePortionInput, ...func(*Options)) (*DownloadDBLogFilePortionOutput, error) +} + +var _ DownloadDBLogFilePortionAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDownloadDBLogFilePortion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DownloadDBLogFilePortion", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_EnableHttpEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_EnableHttpEndpoint.go new file mode 100644 index 00000000..a9c67469 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_EnableHttpEndpoint.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables the HTTP endpoint for the DB cluster. By default, the HTTP endpoint +// isn't enabled. +// +// When enabled, this endpoint provides a connectionless web service API (RDS Data +// API) for running SQL queries on the Aurora DB cluster. You can also query your +// database from inside the RDS console with the RDS query editor. +// +// For more information, see [Using RDS Data API] in the Amazon Aurora User Guide. +// +// This operation applies only to Aurora Serverless v2 and provisioned DB +// clusters. To enable the HTTP endpoint for Aurora Serverless v1 DB clusters, use +// the EnableHttpEndpoint parameter of the ModifyDBCluster operation. +// +// [Using RDS Data API]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html +func (c *Client) EnableHttpEndpoint(ctx context.Context, params *EnableHttpEndpointInput, optFns ...func(*Options)) (*EnableHttpEndpointOutput, error) { + if params == nil { + params = &EnableHttpEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableHttpEndpoint", params, optFns, c.addOperationEnableHttpEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableHttpEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableHttpEndpointInput struct { + + // The Amazon Resource Name (ARN) of the DB cluster. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type EnableHttpEndpointOutput struct { + + // Indicates whether the HTTP endpoint is enabled or disabled for the DB cluster. + HttpEndpointEnabled *bool + + // The ARN of the DB cluster. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableHttpEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpEnableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpEnableHttpEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "EnableHttpEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpEnableHttpEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableHttpEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEnableHttpEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "EnableHttpEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverDBCluster.go new file mode 100644 index 00000000..148533d9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverDBCluster.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Forces a failover for a DB cluster. +// +// For an Aurora DB cluster, failover for a DB cluster promotes one of the Aurora +// Replicas (read-only instances) in the DB cluster to be the primary DB instance +// (the cluster writer). +// +// For a Multi-AZ DB cluster, after RDS terminates the primary DB instance, the +// internal monitoring system detects that the primary DB instance is unhealthy and +// promotes a readable standby (read-only instances) in the DB cluster to be the +// primary DB instance (the cluster writer). Failover times are typically less than +// 35 seconds. +// +// An Amazon Aurora DB cluster automatically fails over to an Aurora Replica, if +// one exists, when the primary DB instance fails. A Multi-AZ DB cluster +// automatically fails over to a readable standby DB instance when the primary DB +// instance fails. +// +// To simulate a failure of a primary instance for testing, you can force a +// failover. Because each instance in a DB cluster has its own endpoint address, +// make sure to clean up and re-establish any existing connections that use those +// endpoint addresses when the failover is complete. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) FailoverDBCluster(ctx context.Context, params *FailoverDBClusterInput, optFns ...func(*Options)) (*FailoverDBClusterOutput, error) { + if params == nil { + params = &FailoverDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "FailoverDBCluster", params, optFns, c.addOperationFailoverDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*FailoverDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type FailoverDBClusterInput struct { + + // The identifier of the DB cluster to force a failover for. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing DB cluster. + // + // This member is required. + DBClusterIdentifier *string + + // The name of the DB instance to promote to the primary DB instance. + // + // Specify the DB instance identifier for an Aurora Replica or a Multi-AZ readable + // standby in the DB cluster, for example mydbcluster-replica1 . + // + // This setting isn't supported for RDS for MySQL Multi-AZ DB clusters. + TargetDBInstanceIdentifier *string + + noSmithyDocumentSerde +} + +type FailoverDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationFailoverDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpFailoverDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpFailoverDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "FailoverDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpFailoverDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFailoverDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opFailoverDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "FailoverDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverGlobalCluster.go new file mode 100644 index 00000000..de7ac2ae --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_FailoverGlobalCluster.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Promotes the specified secondary DB cluster to be the primary DB cluster in the +// global database cluster to fail over or switch over a global database. +// Switchover operations were previously called "managed planned failovers." +// +// Although this operation can be used either to fail over or to switch over a +// global database cluster, its intended use is for global database failover. To +// switch over a global database cluster, we recommend that you use the SwitchoverGlobalClusteroperation +// instead. +// +// How you use this operation depends on whether you are failing over or switching +// over your global database cluster: +// +// - Failing over - Specify the AllowDataLoss parameter and don't specify the +// Switchover parameter. +// +// - Switching over - Specify the Switchover parameter or omit it, but don't +// specify the AllowDataLoss parameter. +// +// # About failing over and switching over +// +// While failing over and switching over a global database cluster both change the +// primary DB cluster, you use these operations for different reasons: +// +// - Failing over - Use this operation to respond to an unplanned event, such as +// a Regional disaster in the primary Region. Failing over can result in a loss of +// write transaction data that wasn't replicated to the chosen secondary before the +// failover event occurred. However, the recovery process that promotes a DB +// instance on the chosen seconday DB cluster to be the primary writer DB instance +// guarantees that the data is in a transactionally consistent state. +// +// For more information about failing over an Amazon Aurora global database, see [Performing managed failovers for Aurora global databases] +// +// in the Amazon Aurora User Guide. +// +// - Switching over - Use this operation on a healthy global database cluster +// for planned events, such as Regional rotation or to fail back to the original +// primary DB cluster after a failover operation. With this operation, there is no +// data loss. +// +// For more information about switching over an Amazon Aurora global database, see [Performing switchovers for Aurora global databases] +// +// in the Amazon Aurora User Guide. +// +// [Performing managed failovers for Aurora global databases]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-failover.managed-unplanned +// [Performing switchovers for Aurora global databases]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover +func (c *Client) FailoverGlobalCluster(ctx context.Context, params *FailoverGlobalClusterInput, optFns ...func(*Options)) (*FailoverGlobalClusterOutput, error) { + if params == nil { + params = &FailoverGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "FailoverGlobalCluster", params, optFns, c.addOperationFailoverGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*FailoverGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type FailoverGlobalClusterInput struct { + + // The identifier of the global database cluster (Aurora global database) this + // operation should apply to. The identifier is the unique key assigned by the user + // when the Aurora global database is created. In other words, it's the name of the + // Aurora global database. + // + // Constraints: + // + // - Must match the identifier of an existing global database cluster. + // + // This member is required. + GlobalClusterIdentifier *string + + // The identifier of the secondary Aurora DB cluster that you want to promote to + // the primary for the global database cluster. Use the Amazon Resource Name (ARN) + // for the identifier so that Aurora can locate the cluster in its Amazon Web + // Services Region. + // + // This member is required. + TargetDbClusterIdentifier *string + + // Specifies whether to allow data loss for this global database cluster + // operation. Allowing data loss triggers a global failover operation. + // + // If you don't specify AllowDataLoss , the global database cluster operation + // defaults to a switchover. + // + // Constraints: + // + // - Can't be specified together with the Switchover parameter. + AllowDataLoss *bool + + // Specifies whether to switch over this global database cluster. + // + // Constraints: + // + // - Can't be specified together with the AllowDataLoss parameter. + Switchover *bool + + noSmithyDocumentSerde +} + +type FailoverGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationFailoverGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpFailoverGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpFailoverGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "FailoverGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpFailoverGlobalClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFailoverGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opFailoverGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "FailoverGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ListTagsForResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ListTagsForResource.go new file mode 100644 index 00000000..f6dafd92 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ListTagsForResource.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all tags on an Amazon RDS resource. +// +// For an overview on tagging an Amazon RDS resource, see [Tagging Amazon RDS Resources] in the Amazon RDS User +// Guide or [Tagging Amazon Aurora and Amazon RDS Resources]in the Amazon Aurora User Guide. +// +// [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html +// [Tagging Amazon Aurora and Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon RDS resource with tags to be listed. This value is an Amazon + // Resource Name (ARN). For information about creating an ARN, see [Constructing an ARN for Amazon RDS]in the Amazon + // RDS User Guide. + // + // [Constructing an ARN for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + ResourceName *string + + // This parameter isn't currently supported. + Filters []types.Filter + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // List of tags returned by the ListTagsForResource operation. + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyActivityStream.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyActivityStream.go new file mode 100644 index 00000000..7cf5d422 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyActivityStream.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Changes the audit policy state of a database activity stream to either locked +// (default) or unlocked. A locked policy is read-only, whereas an unlocked policy +// is read/write. If your activity stream is started and locked, you can unlock it, +// customize your audit policy, and then lock your activity stream. Restarting the +// activity stream isn't required. For more information, see [Modifying a database activity stream]in the Amazon RDS +// User Guide. +// +// This operation is supported for RDS for Oracle and Microsoft SQL Server. +// +// [Modifying a database activity stream]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.Modifying.html +func (c *Client) ModifyActivityStream(ctx context.Context, params *ModifyActivityStreamInput, optFns ...func(*Options)) (*ModifyActivityStreamOutput, error) { + if params == nil { + params = &ModifyActivityStreamInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyActivityStream", params, optFns, c.addOperationModifyActivityStreamMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyActivityStreamOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyActivityStreamInput struct { + + // The audit policy state. When a policy is unlocked, it is read/write. When it is + // locked, it is read-only. You can edit your audit policy only when the activity + // stream is unlocked or stopped. + AuditPolicyState types.AuditPolicyState + + // The Amazon Resource Name (ARN) of the RDS for Oracle or Microsoft SQL Server DB + // instance. For example, arn:aws:rds:us-east-1:12345667890:db:my-orcl-db . + ResourceArn *string + + noSmithyDocumentSerde +} + +type ModifyActivityStreamOutput struct { + + // Indicates whether engine-native audit fields are included in the database + // activity stream. + EngineNativeAuditFieldsIncluded *bool + + // The name of the Amazon Kinesis data stream to be used for the database activity + // stream. + KinesisStreamName *string + + // The Amazon Web Services KMS key identifier for encryption of messages in the + // database activity stream. + KmsKeyId *string + + // The mode of the database activity stream. + Mode types.ActivityStreamMode + + // The status of the modification to the policy state of the database activity + // stream. + PolicyStatus types.ActivityStreamPolicyStatus + + // The status of the modification to the database activity stream. + Status types.ActivityStreamStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyActivityStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyActivityStream{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyActivityStream{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyActivityStream"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyActivityStream(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyActivityStream(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyActivityStream", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCertificates.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCertificates.go new file mode 100644 index 00000000..a59c3bed --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCertificates.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Override the system-default Secure Sockets Layer/Transport Layer Security +// (SSL/TLS) certificate for Amazon RDS for new DB instances, or remove the +// override. +// +// By using this operation, you can specify an RDS-approved SSL/TLS certificate +// for new DB instances that is different from the default certificate provided by +// RDS. You can also use this operation to remove the override, so that new DB +// instances use the default certificate provided by RDS. +// +// You might need to override the default certificate in the following situations: +// +// - You already migrated your applications to support the latest certificate +// authority (CA) certificate, but the new CA certificate is not yet the RDS +// default CA certificate for the specified Amazon Web Services Region. +// +// - RDS has already moved to a new default CA certificate for the specified +// Amazon Web Services Region, but you are still in the process of supporting the +// new CA certificate. In this case, you temporarily need additional time to finish +// your application changes. +// +// For more information about rotating your SSL/TLS certificate for RDS DB +// engines, see [Rotating Your SSL/TLS Certificate]in the Amazon RDS User Guide. +// +// For more information about rotating your SSL/TLS certificate for Aurora DB +// engines, see [Rotating Your SSL/TLS Certificate]in the Amazon Aurora User Guide. +// +// [Rotating Your SSL/TLS Certificate]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html +func (c *Client) ModifyCertificates(ctx context.Context, params *ModifyCertificatesInput, optFns ...func(*Options)) (*ModifyCertificatesOutput, error) { + if params == nil { + params = &ModifyCertificatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyCertificates", params, optFns, c.addOperationModifyCertificatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyCertificatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyCertificatesInput struct { + + // The new default certificate identifier to override the current one with. + // + // To determine the valid values, use the describe-certificates CLI command or the + // DescribeCertificates API operation. + CertificateIdentifier *string + + // Specifies whether to remove the override for the default certificate. If the + // override is removed, the default certificate is the system default. + RemoveCustomerOverride *bool + + noSmithyDocumentSerde +} + +type ModifyCertificatesOutput struct { + + // A CA certificate for an Amazon Web Services account. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + Certificate *types.Certificate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyCertificatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyCertificates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyCertificates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyCertificates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCertificates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyCertificates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyCertificates", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCurrentDBClusterCapacity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCurrentDBClusterCapacity.go new file mode 100644 index 00000000..a6e848ab --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCurrentDBClusterCapacity.go @@ -0,0 +1,228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Set the capacity of an Aurora Serverless v1 DB cluster to a specific value. +// +// Aurora Serverless v1 scales seamlessly based on the workload on the DB cluster. +// In some cases, the capacity might not scale fast enough to meet a sudden change +// in workload, such as a large number of new transactions. Call +// ModifyCurrentDBClusterCapacity to set the capacity explicitly. +// +// After this call sets the DB cluster capacity, Aurora Serverless v1 can +// automatically scale the DB cluster based on the cooldown period for scaling up +// and the cooldown period for scaling down. +// +// For more information about Aurora Serverless v1, see [Using Amazon Aurora Serverless v1] in the Amazon Aurora User +// Guide. +// +// If you call ModifyCurrentDBClusterCapacity with the default TimeoutAction , +// connections that prevent Aurora Serverless v1 from finding a scaling point might +// be dropped. For more information about scaling points, see [Autoscaling for Aurora Serverless v1]in the Amazon Aurora +// User Guide. +// +// This operation only applies to Aurora Serverless v1 DB clusters. +// +// [Autoscaling for Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.auto-scaling +// [Using Amazon Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html +func (c *Client) ModifyCurrentDBClusterCapacity(ctx context.Context, params *ModifyCurrentDBClusterCapacityInput, optFns ...func(*Options)) (*ModifyCurrentDBClusterCapacityOutput, error) { + if params == nil { + params = &ModifyCurrentDBClusterCapacityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyCurrentDBClusterCapacity", params, optFns, c.addOperationModifyCurrentDBClusterCapacityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyCurrentDBClusterCapacityOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyCurrentDBClusterCapacityInput struct { + + // The DB cluster identifier for the cluster being modified. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing DB cluster. + // + // This member is required. + DBClusterIdentifier *string + + // The DB cluster capacity. + // + // When you change the capacity of a paused Aurora Serverless v1 DB cluster, it + // automatically resumes. + // + // Constraints: + // + // - For Aurora MySQL, valid capacity values are 1 , 2 , 4 , 8 , 16 , 32 , 64 , + // 128 , and 256 . + // + // - For Aurora PostgreSQL, valid capacity values are 2 , 4 , 8 , 16 , 32 , 64 , + // 192 , and 384 . + Capacity *int32 + + // The amount of time, in seconds, that Aurora Serverless v1 tries to find a + // scaling point to perform seamless scaling before enforcing the timeout action. + // The default is 300. + // + // Specify a value between 10 and 600 seconds. + SecondsBeforeTimeout *int32 + + // The action to take when the timeout is reached, either ForceApplyCapacityChange + // or RollbackCapacityChange . + // + // ForceApplyCapacityChange , the default, sets the capacity to the specified value + // as soon as possible. + // + // RollbackCapacityChange ignores the capacity change if a scaling point isn't + // found in the timeout period. + TimeoutAction *string + + noSmithyDocumentSerde +} + +type ModifyCurrentDBClusterCapacityOutput struct { + + // The current capacity of the DB cluster. + CurrentCapacity *int32 + + // A user-supplied DB cluster identifier. This identifier is the unique key that + // identifies a DB cluster. + DBClusterIdentifier *string + + // A value that specifies the capacity that the DB cluster scales to next. + PendingCapacity *int32 + + // The number of seconds before a call to ModifyCurrentDBClusterCapacity times out. + SecondsBeforeTimeout *int32 + + // The timeout action of a call to ModifyCurrentDBClusterCapacity , either + // ForceApplyCapacityChange or RollbackCapacityChange . + TimeoutAction *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyCurrentDBClusterCapacityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyCurrentDBClusterCapacity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyCurrentDBClusterCapacity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyCurrentDBClusterCapacity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyCurrentDBClusterCapacityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCurrentDBClusterCapacity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyCurrentDBClusterCapacity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyCurrentDBClusterCapacity", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCustomDBEngineVersion.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCustomDBEngineVersion.go new file mode 100644 index 00000000..1d8aa01c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyCustomDBEngineVersion.go @@ -0,0 +1,362 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies the status of a custom engine version (CEV). You can find CEVs to +// modify by calling DescribeDBEngineVersions . +// +// The MediaImport service that imports files from Amazon S3 to create CEVs isn't +// integrated with Amazon Web Services CloudTrail. If you turn on data logging for +// Amazon RDS in CloudTrail, calls to the ModifyCustomDbEngineVersion event aren't +// logged. However, you might see calls from the API gateway that accesses your +// Amazon S3 bucket. These calls originate from the MediaImport service for the +// ModifyCustomDbEngineVersion event. +// +// For more information, see [Modifying CEV status] in the Amazon RDS User Guide. +// +// [Modifying CEV status]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.html#custom-cev.modify +func (c *Client) ModifyCustomDBEngineVersion(ctx context.Context, params *ModifyCustomDBEngineVersionInput, optFns ...func(*Options)) (*ModifyCustomDBEngineVersionOutput, error) { + if params == nil { + params = &ModifyCustomDBEngineVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyCustomDBEngineVersion", params, optFns, c.addOperationModifyCustomDBEngineVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyCustomDBEngineVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyCustomDBEngineVersionInput struct { + + // The database engine. RDS Custom for Oracle supports the following values: + // + // - custom-oracle-ee + // + // - custom-oracle-ee-cdb + // + // - custom-oracle-se2 + // + // - custom-oracle-se2-cdb + // + // This member is required. + Engine *string + + // The custom engine version (CEV) that you want to modify. This option is + // required for RDS Custom for Oracle, but optional for Amazon RDS. The combination + // of Engine and EngineVersion is unique per customer per Amazon Web Services + // Region. + // + // This member is required. + EngineVersion *string + + // An optional description of your CEV. + Description *string + + // The availability status to be assigned to the CEV. Valid values are as follows: + // + // available You can use this CEV to create a new RDS Custom DB instance. + // + // inactive You can create a new RDS Custom instance by restoring a DB snapshot + // with this CEV. You can't patch or create new instances with this CEV. + // + // You can change any status to any status. A typical reason to change status is + // to prevent the accidental use of a CEV, or to make a deprecated CEV eligible for + // use again. For example, you might change the status of your CEV from available + // to inactive , and from inactive back to available . To change the availability + // status of the CEV, it must not currently be in use by an RDS Custom instance, + // snapshot, or automated backup. + Status types.CustomEngineVersionStatus + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the action +// DescribeDBEngineVersions . +type ModifyCustomDBEngineVersionOutput struct { + + // The creation time of the DB engine version. + CreateTime *time.Time + + // JSON string that lists the installation files and parameters that RDS Custom + // uses to create a custom engine version (CEV). RDS Custom applies the patches in + // the order in which they're listed in the manifest. You can set the Oracle home, + // Oracle base, and UNIX/Linux user and group using the installation parameters. + // For more information, see [JSON fields in the CEV manifest]in the Amazon RDS User Guide. + // + // [JSON fields in the CEV manifest]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.preparing.html#custom-cev.preparing.manifest.fields + CustomDBEngineVersionManifest *string + + // The description of the database engine. + DBEngineDescription *string + + // A value that indicates the source media provider of the AMI based on the usage + // operation. Applicable for RDS Custom for SQL Server. + DBEngineMediaType *string + + // The ARN of the custom engine version. + DBEngineVersionArn *string + + // The description of the database engine version. + DBEngineVersionDescription *string + + // The name of the DB parameter group family for the database engine. + DBParameterGroupFamily *string + + // The name of the Amazon S3 bucket that contains your database installation files. + DatabaseInstallationFilesS3BucketName *string + + // The Amazon S3 directory that contains the database installation files. If not + // specified, then no prefix is assumed. + DatabaseInstallationFilesS3Prefix *string + + // The default character set for new instances of this engine version, if the + // CharacterSetName parameter of the CreateDBInstance API isn't specified. + DefaultCharacterSet *types.CharacterSet + + // The name of the database engine. + Engine *string + + // The version number of the database engine. + EngineVersion *string + + // The types of logs that the database engine has available for export to + // CloudWatch Logs. + ExportableLogTypes []string + + // The EC2 image + Image *types.CustomDBEngineVersionAMI + + // The Amazon Web Services KMS key identifier for an encrypted CEV. This parameter + // is required for RDS Custom, but optional for Amazon RDS. + KMSKeyId *string + + // The major engine version of the CEV. + MajorEngineVersion *string + + // Specifies any Aurora Serverless v2 properties or limits that differ between + // Aurora engine versions. You can test the values of this attribute when deciding + // which Aurora version to use in a new or upgraded DB cluster. You can also + // retrieve the version of an existing DB cluster and check whether that version + // supports certain Aurora Serverless v2 features before you attempt to use those + // features. + ServerlessV2FeaturesSupport *types.ServerlessV2FeaturesSupport + + // The status of the DB engine version, either available or deprecated . + Status *string + + // A list of the supported CA certificate identifiers. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + SupportedCACertificateIdentifiers []string + + // A list of the character sets supported by this engine for the CharacterSetName + // parameter of the CreateDBInstance operation. + SupportedCharacterSets []types.CharacterSet + + // A list of the supported DB engine modes. + SupportedEngineModes []string + + // A list of features supported by the DB engine. + // + // The supported features vary by DB engine and DB engine version. + // + // To determine the supported features for a specific DB engine and DB engine + // version using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine --engine-version + // + // For example, to determine the supported features for RDS for PostgreSQL version + // 13.3 using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine postgres --engine-version 13.3 + // + // The supported features are listed under SupportedFeatureNames in the output. + SupportedFeatureNames []string + + // A list of the character sets supported by the Oracle DB engine for the + // NcharCharacterSetName parameter of the CreateDBInstance operation. + SupportedNcharCharacterSets []types.CharacterSet + + // A list of the time zones supported by this engine for the Timezone parameter of + // the CreateDBInstance action. + SupportedTimezones []types.Timezone + + // Indicates whether the engine version supports Babelfish for Aurora PostgreSQL. + SupportsBabelfish *bool + + // Indicates whether the engine version supports rotating the server certificate + // without rebooting the DB instance. + SupportsCertificateRotationWithoutRestart *bool + + // Indicates whether you can use Aurora global databases with a specific DB engine + // version. + SupportsGlobalDatabases *bool + + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. + SupportsIntegrations *bool + + // Indicates whether the DB engine version supports Aurora Limitless Database. + SupportsLimitlessDatabase *bool + + // Indicates whether the DB engine version supports forwarding write operations + // from reader DB instances to the writer DB instance in the DB cluster. By + // default, write operations aren't allowed on reader DB instances. + // + // Valid for: Aurora DB clusters only + SupportsLocalWriteForwarding *bool + + // Indicates whether the engine version supports exporting the log types specified + // by ExportableLogTypes to CloudWatch Logs. + SupportsLogExportsToCloudwatchLogs *bool + + // Indicates whether you can use Aurora parallel query with a specific DB engine + // version. + SupportsParallelQuery *bool + + // Indicates whether the database engine version supports read replicas. + SupportsReadReplica *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // A list of engine versions that this database engine version can be upgraded to. + ValidUpgradeTarget []types.UpgradeTarget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyCustomDBEngineVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyCustomDBEngineVersion{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyCustomDBEngineVersion"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyCustomDBEngineVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCustomDBEngineVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyCustomDBEngineVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyCustomDBEngineVersion", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBCluster.go new file mode 100644 index 00000000..aa85a2b1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBCluster.go @@ -0,0 +1,795 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the settings of an Amazon Aurora DB cluster or a Multi-AZ DB cluster. +// You can change one or more settings by specifying these parameters and the new +// values in the request. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) ModifyDBCluster(ctx context.Context, params *ModifyDBClusterInput, optFns ...func(*Options)) (*ModifyDBClusterOutput, error) { + if params == nil { + params = &ModifyDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBCluster", params, optFns, c.addOperationModifyDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBClusterInput struct { + + // The DB cluster identifier for the cluster being modified. This parameter isn't + // case-sensitive. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must match the identifier of an existing DB cluster. + // + // This member is required. + DBClusterIdentifier *string + + // The amount of storage in gibibytes (GiB) to allocate to each DB instance in the + // Multi-AZ DB cluster. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + AllocatedStorage *int32 + + // Specifies whether engine mode changes from serverless to provisioned are + // allowed. + // + // Valid for Cluster Type: Aurora Serverless v1 DB clusters only + // + // Constraints: + // + // - You must allow engine mode changes when specifying a different value for + // the EngineMode parameter from the DB cluster's current engine mode. + AllowEngineModeChange *bool + + // Specifies whether major version upgrades are allowed. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - You must allow major version upgrades when specifying a value for the + // EngineVersion parameter that is a different major version than the DB + // cluster's current version. + AllowMajorVersionUpgrade *bool + + // Specifies whether the modifications in this request are asynchronously applied + // as soon as possible, regardless of the PreferredMaintenanceWindow setting for + // the DB cluster. If this parameter is disabled, changes to the DB cluster are + // applied during the next maintenance window. + // + // Most modifications can be applied immediately or during the next scheduled + // maintenance window. Some modifications, such as turning on deletion protection + // and changing the master password, are applied immediately—regardless of when you + // choose to apply them. + // + // By default, this parameter is disabled. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + ApplyImmediately *bool + + // Specifies whether minor engine upgrades are applied automatically to the DB + // cluster during the maintenance window. By default, minor engine upgrades are + // applied automatically. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + AutoMinorVersionUpgrade *bool + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + AwsBackupRecoveryPointArn *string + + // The target backtrack window, in seconds. To disable backtracking, set this + // value to 0 . + // + // Valid for Cluster Type: Aurora MySQL DB clusters only + // + // Default: 0 + // + // Constraints: + // + // - If specified, this value must be set to a number from 0 to 259,200 (72 + // hours). + BacktrackWindow *int64 + + // The number of days for which automated backups are retained. Specify a minimum + // value of 1 . + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Default: 1 + // + // Constraints: + // + // - Must be a value from 1 to 35. + BackupRetentionPeriod *int32 + + // The CA certificate identifier to use for the DB cluster's server certificate. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Multi-AZ DB clusters + // + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // The configuration setting for the log types to be enabled for export to + // CloudWatch Logs for a specific DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // The following values are valid for each DB engine: + // + // - Aurora MySQL - audit | error | general | slowquery + // + // - Aurora PostgreSQL - postgresql + // + // - RDS for MySQL - error | general | slowquery + // + // - RDS for PostgreSQL - postgresql | upgrade + // + // For more information about exporting CloudWatch Logs for Amazon RDS, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon RDS User Guide. + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + CloudwatchLogsExportConfiguration *types.CloudwatchLogsExportConfiguration + + // Specifies whether to copy all tags from the DB cluster to snapshots of the DB + // cluster. The default is not to copy them. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + CopyTagsToSnapshot *bool + + // The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, + // for example db.m6gd.xlarge . Not all DB instance classes are available in all + // Amazon Web Services Regions, or for all database engines. + // + // For the full list of DB instance classes and availability for your engine, see [DB Instance Class] + // in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBClusterInstanceClass *string + + // The name of the DB cluster parameter group to use for the DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + DBClusterParameterGroupName *string + + // The name of the DB parameter group to apply to all instances of the DB cluster. + // + // When you apply a parameter group using the DBInstanceParameterGroupName + // parameter, the DB cluster isn't rebooted automatically. Also, parameter changes + // are applied immediately rather than during the next maintenance window. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // Default: The existing name setting + // + // Constraints: + // + // - The DB parameter group must be in the same DB parameter group family as + // this DB cluster. + // + // - The DBInstanceParameterGroupName parameter is valid in combination with the + // AllowMajorVersionUpgrade parameter for a major version upgrade only. + DBInstanceParameterGroupName *string + + // Specifies the mode of Database Insights to enable for the DB cluster. + // + // If you change the value from standard to advanced , you must set the + // PerformanceInsightsEnabled parameter to true and the + // PerformanceInsightsRetentionPeriod parameter to 465. + // + // If you change the value from advanced to standard , you must set the + // PerformanceInsightsEnabled parameter to false . + // + // Valid for Cluster Type: Aurora DB clusters only + DatabaseInsightsMode types.DatabaseInsightsMode + + // Specifies whether the DB cluster has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + DeletionProtection *bool + + // The Active Directory directory ID to move the DB cluster to. Specify none to + // remove the cluster from its current domain. The domain must be created prior to + // this operation. + // + // For more information, see [Kerberos Authentication] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html + Domain *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // Valid for Cluster Type: Aurora DB clusters only + DomainIAMRoleName *string + + // Specifies whether to enable this DB cluster to forward write operations to the + // primary cluster of a global cluster (Aurora global database). By default, write + // operations are not allowed on Aurora DB clusters that are secondary clusters in + // an Aurora global database. + // + // You can set this value only on Aurora DB clusters that are members of an Aurora + // global database. With this parameter enabled, a secondary cluster can forward + // writes to the current primary cluster, and the resulting changes are replicated + // back to this cluster. For the primary DB cluster of an Aurora global database, + // this value is used immediately if the primary is demoted by a global cluster API + // operation, but it does nothing until then. + // + // Valid for Cluster Type: Aurora DB clusters only + EnableGlobalWriteForwarding *bool + + // Specifies whether to enable the HTTP endpoint for an Aurora Serverless v1 DB + // cluster. By default, the HTTP endpoint isn't enabled. + // + // When enabled, the HTTP endpoint provides a connectionless web service API (RDS + // Data API) for running SQL queries on the Aurora Serverless v1 DB cluster. You + // can also query your database from inside the RDS console with the RDS query + // editor. + // + // For more information, see [Using RDS Data API] in the Amazon Aurora User Guide. + // + // This parameter applies only to Aurora Serverless v1 DB clusters. To enable or + // disable the HTTP endpoint for an Aurora Serverless v2 or provisioned DB cluster, + // use the EnableHttpEndpoint and DisableHttpEndpoint operations. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [Using RDS Data API]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html + EnableHttpEndpoint *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication] in the Amazon Aurora User Guide or [IAM database authentication for MariaDB, MySQL, and PostgreSQL] in the Amazon + // RDS User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [IAM Database Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html + // [IAM database authentication for MariaDB, MySQL, and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Aurora Limitless Database. You must enable Aurora + // Limitless Database to create a DB shard group. + // + // Valid for: Aurora DB clusters only + // + // This setting is no longer used. Instead use the ClusterScalabilityType setting + // when you create your Aurora Limitless Database DB cluster. + EnableLimitlessDatabase *bool + + // Specifies whether read replicas can forward write operations to the writer DB + // instance in the DB cluster. By default, write operations aren't allowed on + // reader DB instances. + // + // Valid for: Aurora DB clusters only + EnableLocalWriteForwarding *bool + + // Specifies whether to turn on Performance Insights for the DB cluster. + // + // For more information, see [Using Amazon Performance Insights] in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The DB engine mode of the DB cluster, either provisioned or serverless . + // + // The DB engine mode can be modified only from serverless to provisioned . + // + // For more information, see [CreateDBCluster]. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // [CreateDBCluster]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBCluster.html + EngineMode *string + + // The version number of the database engine to which you want to upgrade. + // Changing this parameter results in an outage. The change is applied during the + // next maintenance window unless ApplyImmediately is enabled. + // + // If the cluster that you're modifying has one or more read replicas, all + // replicas must be running an engine version that's the same or later than the + // version you specify. + // + // To list all of the available engine versions for Aurora MySQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine aurora-mysql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for Aurora PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine aurora-postgresql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for MySQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine mysql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine postgres --query + // "DBEngineVersions[].EngineVersion" + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + EngineVersion *string + + // The amount of Provisioned IOPS (input/output operations per second) to be + // initially allocated for each DB instance in the Multi-AZ DB cluster. + // + // For information about valid IOPS values, see [Amazon RDS Provisioned IOPS storage] in the Amazon RDS User Guide. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // Constraints: + // + // - Must be a multiple between .5 and 50 of the storage amount for the DB + // cluster. + // + // [Amazon RDS Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // If the DB cluster doesn't manage the master user password with Amazon Web + // Services Secrets Manager, you can turn on this management. In this case, you + // can't specify MasterUserPassword . + // + // If the DB cluster already manages the master user password with Amazon Web + // Services Secrets Manager, and you specify that the master user password is not + // managed with Amazon Web Services Secrets Manager, then you must specify + // MasterUserPassword . In this case, RDS deletes the secret and uses the new + // password for the master user specified by MasterUserPassword . + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon + // Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The new password for the master database user. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must contain from 8 to 41 characters. + // + // - Can contain any printable ASCII character except "/", """, or "@". + // + // - Can't be specified if ManageMasterUserPassword is turned on. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if both of the following conditions are met: + // + // - The DB cluster doesn't manage the master user password in Amazon Web + // Services Secrets Manager. + // + // If the DB cluster already manages the master user password in Amazon Web + // Services Secrets Manager, you can't change the KMS key that is used to encrypt + // the secret. + // + // - You are turning on ManageMasterUserPassword to manage the master user + // password in Amazon Web Services Secrets Manager. + // + // If you are turning on ManageMasterUserPassword and don't specify + // MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS key is used to + // encrypt the secret. If the secret is in a different Amazon Web Services account, + // then you can't use the aws/secretsmanager KMS key to encrypt the secret, and + // you must use a customer managed KMS key. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + MasterUserSecretKmsKeyId *string + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB cluster. To turn off collecting Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, also set MonitoringInterval to a value other + // than 0 . + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + // Enhanced Monitoring metrics to Amazon CloudWatch Logs. An example is + // arn:aws:iam:123456789012:role/emaccess . For information on creating a + // monitoring role, see [To create an IAM role for Amazon RDS Enhanced Monitoring]in the Amazon RDS User Guide. + // + // If MonitoringInterval is set to a value other than 0 , supply a + // MonitoringRoleArn value. + // + // Valid for Cluster Type: Multi-AZ DB clusters only + // + // [To create an IAM role for Amazon RDS Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole + MonitoringRoleArn *string + + // The network type of the DB cluster. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The new DB cluster identifier for the DB cluster when renaming a DB cluster. + // This value is stored as a lowercase string. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - The first character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster2 + NewDBClusterIdentifier *string + + // The option group to associate the DB cluster with. + // + // DB clusters are associated with a default option group that can't be modified. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // issues an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the DB cluster accepts connections. + // + // Valid for Cluster Type: Aurora DB clusters only + // + // Valid Values: 1150-65535 + // + // Default: The same port as the original DB cluster. + Port *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, using the BackupRetentionPeriod parameter. + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region. To view the time blocks available, see + // [Backup window]in the Amazon Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.Backups.BackupWindow + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur, in Universal + // Coordinated Time (UTC). + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region, occurring on a random day of the week. + // To see the time blocks available, see [Adjusting the Preferred DB Cluster Maintenance Window]in the Amazon Aurora User Guide. + // + // Constraints: + // + // - Must be in the format ddd:hh24:mi-ddd:hh24:mi . + // + // - Days must be one of Mon | Tue | Wed | Thu | Fri | Sat | Sun . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must be at least 30 minutes. + // + // [Adjusting the Preferred DB Cluster Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora + PreferredMaintenanceWindow *string + + // Specifies whether to rotate the secret managed by Amazon Web Services Secrets + // Manager for the master user password. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB cluster. The secret value + // contains the updated password. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon + // Aurora User Guide. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Constraints: + // + // - You must apply the change immediately when rotating the master user + // password. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html + RotateMasterUserPassword *bool + + // The scaling properties of the DB cluster. You can only modify scaling + // properties for DB clusters in serverless DB engine mode. + // + // Valid for Cluster Type: Aurora DB clusters only + ScalingConfiguration *types.ScalingConfiguration + + // Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration + + // The storage type to associate with the DB cluster. + // + // For information on storage types for Aurora DB clusters, see [Storage configurations for Amazon Aurora DB clusters]. For information + // on storage types for Multi-AZ DB clusters, see [Settings for creating Multi-AZ DB clusters]. + // + // When specified for a Multi-AZ DB cluster, a value for the Iops parameter is + // required. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: + // + // - Aurora DB clusters - aurora | aurora-iopt1 + // + // - Multi-AZ DB clusters - io1 | io2 | gp3 + // + // Default: + // + // - Aurora DB clusters - aurora + // + // - Multi-AZ DB clusters - io1 + // + // [Storage configurations for Amazon Aurora DB clusters]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Overview.StorageReliability.html#aurora-storage-type + // [Settings for creating Multi-AZ DB clusters]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/create-multi-az-db-cluster.html#create-multi-az-db-cluster-settings + StorageType *string + + // A list of EC2 VPC security groups to associate with this DB cluster. + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type ModifyDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterEndpoint.go new file mode 100644 index 00000000..df8d4fea --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterEndpoint.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the properties of an endpoint in an Amazon Aurora DB cluster. +// +// This operation only applies to Aurora DB clusters. +func (c *Client) ModifyDBClusterEndpoint(ctx context.Context, params *ModifyDBClusterEndpointInput, optFns ...func(*Options)) (*ModifyDBClusterEndpointOutput, error) { + if params == nil { + params = &ModifyDBClusterEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBClusterEndpoint", params, optFns, c.addOperationModifyDBClusterEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBClusterEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBClusterEndpointInput struct { + + // The identifier of the endpoint to modify. This parameter is stored as a + // lowercase string. + // + // This member is required. + DBClusterEndpointIdentifier *string + + // The type of the endpoint. One of: READER , WRITER , ANY . + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. Only + // relevant if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + noSmithyDocumentSerde +} + +// This data type represents the information you need to connect to an Amazon +// Aurora DB cluster. This data type is used as a response element in the following +// actions: +// +// - CreateDBClusterEndpoint +// +// - DescribeDBClusterEndpoints +// +// - ModifyDBClusterEndpoint +// +// - DeleteDBClusterEndpoint +// +// For the data structure that represents Amazon RDS DB instance endpoints, see +// Endpoint . +type ModifyDBClusterEndpointOutput struct { + + // The type associated with a custom endpoint. One of: READER , WRITER , ANY . + CustomEndpointType *string + + // The Amazon Resource Name (ARN) for the endpoint. + DBClusterEndpointArn *string + + // The identifier associated with the endpoint. This parameter is stored as a + // lowercase string. + DBClusterEndpointIdentifier *string + + // A unique system-generated identifier for an endpoint. It remains the same for + // the whole life of the endpoint. + DBClusterEndpointResourceIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + DBClusterIdentifier *string + + // The DNS address of the endpoint. + Endpoint *string + + // The type of the endpoint. One of: READER , WRITER , CUSTOM . + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. Only + // relevant if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + // The current status of the endpoint. One of: creating , available , deleting , + // inactive , modifying . The inactive state applies to an endpoint that can't be + // used for a certain kind of cluster, such as a writer endpoint for a read-only + // secondary cluster in a global database. + Status *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBClusterEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBClusterEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBClusterEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBClusterEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBClusterEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBClusterEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBClusterEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterParameterGroup.go new file mode 100644 index 00000000..acdf3557 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterParameterGroup.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the parameters of a DB cluster parameter group. To modify more than +// one parameter, submit a list of the following: ParameterName , ParameterValue , +// and ApplyMethod . A maximum of 20 parameters can be modified in a single request. +// +// After you create a DB cluster parameter group, you should wait at least 5 +// minutes before creating your first DB cluster that uses that DB cluster +// parameter group as the default parameter group. This allows Amazon RDS to fully +// complete the create operation before the parameter group is used as the default +// for a new DB cluster. This is especially important for parameters that are +// critical when creating the default database for a DB cluster, such as the +// character set for the default database defined by the character_set_database +// parameter. You can use the Parameter Groups option of the [Amazon RDS console]or the +// DescribeDBClusterParameters operation to verify that your DB cluster parameter +// group has been created or modified. +// +// If the modified DB cluster parameter group is used by an Aurora Serverless v1 +// cluster, Aurora applies the update immediately. The cluster restart might +// interrupt your workload. In that case, your application must reopen any +// connections and retry any transactions that were active when the parameter +// changes took effect. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [Amazon RDS console]: https://console.aws.amazon.com/rds/ +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) ModifyDBClusterParameterGroup(ctx context.Context, params *ModifyDBClusterParameterGroupInput, optFns ...func(*Options)) (*ModifyDBClusterParameterGroupOutput, error) { + if params == nil { + params = &ModifyDBClusterParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBClusterParameterGroup", params, optFns, c.addOperationModifyDBClusterParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBClusterParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBClusterParameterGroupInput struct { + + // The name of the DB cluster parameter group to modify. + // + // This member is required. + DBClusterParameterGroupName *string + + // A list of parameters in the DB cluster parameter group to modify. + // + // Valid Values (for the application method): immediate | pending-reboot + // + // You can use the immediate value with dynamic parameters only. You can use the + // pending-reboot value for both dynamic and static parameters. + // + // When the application method is immediate , changes to dynamic parameters are + // applied immediately to the DB clusters associated with the parameter group. When + // the application method is pending-reboot , changes to dynamic and static + // parameters are applied after a reboot without failover to the DB clusters + // associated with the parameter group. + // + // This member is required. + Parameters []types.Parameter + + noSmithyDocumentSerde +} + +type ModifyDBClusterParameterGroupOutput struct { + + // The name of the DB cluster parameter group. + // + // Constraints: + // + // - Must be 1 to 255 letters or numbers. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // This value is stored as a lowercase string. + DBClusterParameterGroupName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBClusterParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBClusterParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBClusterParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBClusterParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterSnapshotAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterSnapshotAttribute.go new file mode 100644 index 00000000..c2370992 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBClusterSnapshotAttribute.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds an attribute and values to, or removes an attribute and values from, a +// manual DB cluster snapshot. +// +// To share a manual DB cluster snapshot with other Amazon Web Services accounts, +// specify restore as the AttributeName and use the ValuesToAdd parameter to add a +// list of IDs of the Amazon Web Services accounts that are authorized to restore +// the manual DB cluster snapshot. Use the value all to make the manual DB cluster +// snapshot public, which means that it can be copied or restored by all Amazon Web +// Services accounts. +// +// Don't add the all value for any manual DB cluster snapshots that contain +// private information that you don't want available to all Amazon Web Services +// accounts. +// +// If a manual DB cluster snapshot is encrypted, it can be shared, but only by +// specifying a list of authorized Amazon Web Services account IDs for the +// ValuesToAdd parameter. You can't use all as a value for that parameter in this +// case. +// +// To view which Amazon Web Services accounts have access to copy or restore a +// manual DB cluster snapshot, or whether a manual DB cluster snapshot is public or +// private, use the DescribeDBClusterSnapshotAttributesAPI operation. The accounts are returned as values for the +// restore attribute. +func (c *Client) ModifyDBClusterSnapshotAttribute(ctx context.Context, params *ModifyDBClusterSnapshotAttributeInput, optFns ...func(*Options)) (*ModifyDBClusterSnapshotAttributeOutput, error) { + if params == nil { + params = &ModifyDBClusterSnapshotAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBClusterSnapshotAttribute", params, optFns, c.addOperationModifyDBClusterSnapshotAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBClusterSnapshotAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBClusterSnapshotAttributeInput struct { + + // The name of the DB cluster snapshot attribute to modify. + // + // To manage authorization for other Amazon Web Services accounts to copy or + // restore a manual DB cluster snapshot, set this value to restore . + // + // To view the list of attributes available to modify, use the DescribeDBClusterSnapshotAttributes API operation. + // + // This member is required. + AttributeName *string + + // The identifier for the DB cluster snapshot to modify the attributes for. + // + // This member is required. + DBClusterSnapshotIdentifier *string + + // A list of DB cluster snapshot attributes to add to the attribute specified by + // AttributeName . + // + // To authorize other Amazon Web Services accounts to copy or restore a manual DB + // cluster snapshot, set this list to include one or more Amazon Web Services + // account IDs, or all to make the manual DB cluster snapshot restorable by any + // Amazon Web Services account. Do not add the all value for any manual DB cluster + // snapshots that contain private information that you don't want available to all + // Amazon Web Services accounts. + ValuesToAdd []string + + // A list of DB cluster snapshot attributes to remove from the attribute specified + // by AttributeName . + // + // To remove authorization for other Amazon Web Services accounts to copy or + // restore a manual DB cluster snapshot, set this list to include one or more + // Amazon Web Services account identifiers, or all to remove authorization for any + // Amazon Web Services account to copy or restore the DB cluster snapshot. If you + // specify all , an Amazon Web Services account whose account ID is explicitly + // added to the restore attribute can still copy or restore a manual DB cluster + // snapshot. + ValuesToRemove []string + + noSmithyDocumentSerde +} + +type ModifyDBClusterSnapshotAttributeOutput struct { + + // Contains the results of a successful call to the + // DescribeDBClusterSnapshotAttributes API action. + // + // Manual DB cluster snapshot attributes are used to authorize other Amazon Web + // Services accounts to copy or restore a manual DB cluster snapshot. For more + // information, see the ModifyDBClusterSnapshotAttribute API action. + DBClusterSnapshotAttributesResult *types.DBClusterSnapshotAttributesResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBClusterSnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBClusterSnapshotAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBClusterSnapshotAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBClusterSnapshotAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBClusterSnapshotAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBClusterSnapshotAttribute(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBClusterSnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBClusterSnapshotAttribute", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBInstance.go new file mode 100644 index 00000000..f2585497 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBInstance.go @@ -0,0 +1,1127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies settings for a DB instance. You can change one or more database +// configuration parameters by specifying these parameters and the new values in +// the request. To learn what modifications you can make to your DB instance, call +// DescribeValidDBInstanceModifications before you call ModifyDBInstance . +func (c *Client) ModifyDBInstance(ctx context.Context, params *ModifyDBInstanceInput, optFns ...func(*Options)) (*ModifyDBInstanceOutput, error) { + if params == nil { + params = &ModifyDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBInstance", params, optFns, c.addOperationModifyDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBInstanceInput struct { + + // The identifier of DB instance to modify. This value is stored as a lowercase + // string. + // + // Constraints: + // + // - Must match the identifier of an existing DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + // The new amount of storage in gibibytes (GiB) to allocate for the DB instance. + // + // For RDS for Db2, MariaDB, RDS for MySQL, RDS for Oracle, and RDS for + // PostgreSQL, the value supplied must be at least 10% greater than the current + // value. Values that are not at least 10% greater than the existing value are + // rounded up so that they are 10% greater than the current value. + // + // For the valid values for allocated storage for each engine, see CreateDBInstance + // . + // + // Constraints: + // + // - When you increase the allocated storage for a DB instance that uses + // Provisioned IOPS ( gp3 , io1 , or io2 storage type), you must also specify the + // Iops parameter. You can use the current value for Iops . + AllocatedStorage *int32 + + // Specifies whether major version upgrades are allowed. Changing this parameter + // doesn't result in an outage and the change is asynchronously applied as soon as + // possible. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Constraints: + // + // - Major version upgrades must be allowed when specifying a value for the + // EngineVersion parameter that's a different major version than the DB + // instance's current version. + AllowMajorVersionUpgrade *bool + + // Specifies whether the modifications in this request and any pending + // modifications are asynchronously applied as soon as possible, regardless of the + // PreferredMaintenanceWindow setting for the DB instance. By default, this + // parameter is disabled. + // + // If this parameter is disabled, changes to the DB instance are applied during + // the next maintenance window. Some parameter changes can cause an outage and are + // applied on the next call to RebootDBInstance, or the next failure reboot. Review the table of + // parameters in [Modifying a DB Instance]in the Amazon RDS User Guide to see the impact of enabling or + // disabling ApplyImmediately for each modified parameter and to determine when + // the changes are applied. + // + // [Modifying a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html + ApplyImmediately *bool + + // Specifies whether minor version upgrades are applied automatically to the DB + // instance during the maintenance window. An outage occurs when all the following + // conditions are met: + // + // - The automatic upgrade is enabled for the maintenance window. + // + // - A newer minor version is available. + // + // - RDS has enabled automatic patching for the engine version. + // + // If any of the preceding conditions isn't met, Amazon RDS applies the change as + // soon as possible and doesn't cause an outage. + // + // For an RDS Custom DB instance, don't enable this setting. Otherwise, the + // operation returns an error. + AutoMinorVersionUpgrade *bool + + // The automation mode of the RDS Custom DB instance. If full , the DB instance + // automates monitoring and instance recovery. If all paused , the instance pauses + // automation for the duration set by ResumeFullAutomationModeMinutes . + AutomationMode types.AutomationMode + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + // + // This setting doesn't apply to RDS Custom DB instances. + AwsBackupRecoveryPointArn *string + + // The number of days to retain automated backups. Setting this parameter to a + // positive number enables backups. Setting this parameter to 0 disables automated + // backups. + // + // Enabling and disabling backups can result in a brief I/O suspension that lasts + // from a few seconds to a few minutes, depending on the size and class of your DB + // instance. + // + // These changes are applied during the next maintenance window unless the + // ApplyImmediately parameter is enabled for this request. If you change the + // parameter from one non-zero value to another non-zero value, the change is + // asynchronously applied as soon as possible. + // + // This setting doesn't apply to Amazon Aurora DB instances. The retention period + // for automated backups is managed by the DB cluster. For more information, see + // ModifyDBCluster . + // + // Default: Uses existing setting + // + // Constraints: + // + // - Must be a value from 0 to 35. + // + // - Can't be set to 0 if the DB instance is a source to read replicas. + // + // - Can't be set to 0 for an RDS Custom for Oracle DB instance. + BackupRetentionPeriod *int32 + + // The CA certificate identifier to use for the DB instance's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // Specifies whether the DB instance is restarted when you rotate your SSL/TLS + // certificate. + // + // By default, the DB instance is restarted when you rotate your SSL/TLS + // certificate. The certificate is not updated until the DB instance is restarted. + // + // Set this parameter only if you are not using SSL/TLS to connect to the DB + // instance. + // + // If you are using SSL/TLS to connect to the DB instance, follow the appropriate + // instructions for your DB engine to rotate your SSL/TLS certificate: + // + // - For more information about rotating your SSL/TLS certificate for RDS DB + // engines, see [Rotating Your SSL/TLS Certificate.]in the Amazon RDS User Guide. + // + // - For more information about rotating your SSL/TLS certificate for Aurora DB + // engines, see [Rotating Your SSL/TLS Certificate]in the Amazon Aurora User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Rotating Your SSL/TLS Certificate.]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html + // [Rotating Your SSL/TLS Certificate]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html + CertificateRotationRestart *bool + + // The log types to be enabled for export to CloudWatch Logs for a specific DB + // instance. + // + // A change to the CloudwatchLogsExportConfiguration parameter is always applied + // to the DB instance immediately. Therefore, the ApplyImmediately parameter has + // no effect. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // The following values are valid for each DB engine: + // + // - Aurora MySQL - audit | error | general | slowquery + // + // - Aurora PostgreSQL - postgresql + // + // - RDS for MySQL - error | general | slowquery + // + // - RDS for PostgreSQL - postgresql | upgrade + // + // For more information about exporting CloudWatch Logs for Amazon RDS, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon RDS User Guide. + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + CloudwatchLogsExportConfiguration *types.CloudwatchLogsExportConfiguration + + // Specifies whether to copy all tags from the DB instance to snapshots of the DB + // instance. By default, tags aren't copied. + // + // This setting doesn't apply to Amazon Aurora DB instances. Copying tags to + // snapshots is managed by the DB cluster. Setting this value for an Aurora DB + // instance has no effect on the DB cluster setting. For more information, see + // ModifyDBCluster . + CopyTagsToSnapshot *bool + + // The new compute and memory capacity of the DB instance, for example db.m4.large + // . Not all DB instance classes are available in all Amazon Web Services Regions, + // or for all database engines. For the full list of DB instance classes, and + // availability for your engine, see [DB Instance Class]in the Amazon RDS User Guide or [Aurora DB instance classes] in the + // Amazon Aurora User Guide. For RDS Custom, see [DB instance class support for RDS Custom for Oracle]and [DB instance class support for RDS Custom for SQL Server]. + // + // If you modify the DB instance class, an outage occurs during the change. The + // change is applied during the next maintenance window, unless you specify + // ApplyImmediately in your request. + // + // Default: Uses existing setting + // + // Constraints: + // + // - If you are modifying the DB instance class and upgrading the engine version + // at the same time, the currently running engine version must be supported on the + // specified DB instance class. Otherwise, the operation returns an error. In this + // case, first run the operation to upgrade the engine version, and then run it + // again to modify the DB instance class. + // + // [Aurora DB instance classes]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.DBInstanceClass.html + // [DB instance class support for RDS Custom for SQL Server]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-reqs-limits-MS.html#custom-reqs-limits.instancesMS + // [DB instance class support for RDS Custom for Oracle]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-reqs-limits.html#custom-reqs-limits.instances + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBInstanceClass *string + + // The name of the DB parameter group to apply to the DB instance. + // + // Changing this setting doesn't result in an outage. The parameter group name + // itself is changed immediately, but the actual parameter changes are not applied + // until you reboot the instance without failover. In this case, the DB instance + // isn't rebooted automatically, and the parameter changes aren't applied during + // the next maintenance window. However, if you modify dynamic parameters in the + // newly associated DB parameter group, these changes are applied immediately + // without a reboot. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Default: Uses existing setting + // + // Constraints: + // + // - Must be in the same DB parameter group family as the DB instance. + DBParameterGroupName *string + + // The port number on which the database accepts connections. + // + // The value of the DBPortNumber parameter must not match any of the port values + // specified for options in the option group for the DB instance. + // + // If you change the DBPortNumber value, your database restarts regardless of the + // value of the ApplyImmediately parameter. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: 1150-65535 + // + // Default: + // + // - Amazon Aurora - 3306 + // + // - RDS for Db2 - 50000 + // + // - RDS for MariaDB - 3306 + // + // - RDS for Microsoft SQL Server - 1433 + // + // - RDS for MySQL - 3306 + // + // - RDS for Oracle - 1521 + // + // - RDS for PostgreSQL - 5432 + // + // Constraints: + // + // - For RDS for Microsoft SQL Server, the value can't be 1234 , 1434 , 3260 , + // 3343 , 3389 , 47001 , or 49152-49156 . + DBPortNumber *int32 + + // A list of DB security groups to authorize on this DB instance. Changing this + // setting doesn't result in an outage and the change is asynchronously applied as + // soon as possible. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Constraints: + // + // - If supplied, must match existing DB security groups. + DBSecurityGroups []string + + // The new DB subnet group for the DB instance. You can use this parameter to move + // your DB instance to a different VPC. + // + // If your DB instance isn't in a VPC, you can also use this parameter to move + // your DB instance into a VPC. For more information, see [Working with a DB instance in a VPC]in the Amazon RDS User + // Guide. + // + // Changing the subnet group causes an outage during the change. The change is + // applied during the next maintenance window, unless you enable ApplyImmediately . + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Constraints: + // + // - If supplied, must match existing DB subnet group. + // + // Example: mydbsubnetgroup + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Non-VPC2VPC + DBSubnetGroupName *string + + // Specifies the mode of Database Insights to enable for the DB instance. + // + // This setting only applies to Amazon Aurora DB instances. + // + // Currently, this value is inherited from the DB cluster and can't be changed. + DatabaseInsightsMode types.DatabaseInsightsMode + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Specifies whether the DB instance has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // This setting doesn't apply to Amazon Aurora DB instances. You can enable or + // disable deletion protection for the DB cluster. For more information, see + // ModifyDBCluster . DB instances in a DB cluster can be deleted even when deletion + // protection is enabled for the DB cluster. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // Specifies whether to remove the DB instance from the Active Directory domain. + DisableDomain *bool + + // The Active Directory directory ID to move the DB instance to. Specify none to + // remove the instance from its current domain. You must create the domain before + // this operation. Currently, you can create only Db2, MySQL, Microsoft SQL Server, + // Oracle, and PostgreSQL DB instances in an Active Directory Domain. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The ARN for the Secrets Manager secret with the credentials for the user + // joining the domain. + // + // Example: + // arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 + DomainAuthSecretArn *string + + // The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + // controllers. + // + // Constraints: + // + // - Two IP addresses must be provided. If there isn't a secondary domain + // controller, use the IP address of the primary domain controller for both entries + // in the list. + // + // Example: 123.124.125.126,234.235.236.237 + DomainDnsIps []string + + // The fully qualified domain name (FQDN) of an Active Directory domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: mymanagedADtest.mymanagedAD.mydomain + DomainFqdn *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // This setting doesn't apply to RDS Custom DB instances. + DomainIAMRoleName *string + + // The Active Directory organizational unit for your DB instance to join. + // + // Constraints: + // + // - Must be in the distinguished name format. + // + // - Can't be longer than 64 characters. + // + // Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain + DomainOu *string + + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts DB instance. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the DB instance from outside of its virtual + // private cloud (VPC) on your local network. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + EnableCustomerOwnedIp *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // This setting doesn't apply to Amazon Aurora. Mapping Amazon Web Services IAM + // accounts to database accounts is managed by the DB cluster. + // + // For more information about IAM database authentication, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS + // User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Performance Insights for the DB instance. + // + // For more information, see [Using Amazon Performance Insights] in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The target Oracle DB engine when you convert a non-CDB to a CDB. This + // intermediate step is necessary to upgrade an Oracle Database 19c non-CDB to an + // Oracle Database 21c CDB. + // + // Note the following requirements: + // + // - Make sure that you specify oracle-ee-cdb or oracle-se2-cdb . + // + // - Make sure that your DB engine runs Oracle Database 19c with an April 2021 + // or later RU. + // + // Note the following limitations: + // + // - You can't convert a CDB to a non-CDB. + // + // - You can't convert a replica database. + // + // - You can't convert a non-CDB to a CDB and upgrade the engine version in the + // same command. + // + // - You can't convert the existing custom parameter or option group when it has + // options or parameters that are permanent or persistent. In this situation, the + // DB instance reverts to the default option and parameter group. To avoid + // reverting to the default, specify a new parameter group with + // --db-parameter-group-name and a new option group with --option-group-name . + Engine *string + + // The version number of the database engine to upgrade to. Changing this + // parameter results in an outage and the change is applied during the next + // maintenance window unless the ApplyImmediately parameter is enabled for this + // request. + // + // For major version upgrades, if a nondefault DB parameter group is currently in + // use, a new DB parameter group in the DB parameter group family for the new + // engine version must be specified. The new DB parameter group can be the default + // for that DB parameter group family. + // + // If you specify only a major version, Amazon RDS updates the DB instance to the + // default minor version if the current minor version is lower. For information + // about valid engine versions, see CreateDBInstance , or call + // DescribeDBEngineVersions . + // + // If the instance that you're modifying is acting as a read replica, the engine + // version that you specify must be the same or higher than the version that the + // source DB instance or cluster is running. + // + // In RDS Custom for Oracle, this parameter is supported for read replicas only if + // they are in the PATCH_DB_FAILURE lifecycle. + // + // Constraints: + // + // - If you are upgrading the engine version and modifying the DB instance class + // at the same time, the currently running engine version must be supported on the + // specified DB instance class. Otherwise, the operation returns an error. In this + // case, first run the operation to upgrade the engine version, and then run it + // again to modify the DB instance class. + EngineVersion *string + + // The new Provisioned IOPS (I/O operations per second) value for the RDS instance. + // + // Changing this setting doesn't result in an outage and the change is applied + // during the next maintenance window unless the ApplyImmediately parameter is + // enabled for this request. If you are migrating from Provisioned IOPS to standard + // storage, set this value to 0. The DB instance will require a reboot for the + // change in storage type to take effect. + // + // If you choose to migrate your DB instance from using standard storage to using + // Provisioned IOPS, or from using Provisioned IOPS to using standard storage, the + // process can take time. The duration of the migration depends on several factors + // such as database load, storage size, storage type (standard or Provisioned + // IOPS), amount of IOPS provisioned (if any), and the number of prior scale + // storage operations. Typical migration times are under 24 hours, but the process + // can take up to several days in some cases. During the migration, the DB instance + // is available for use, but might experience performance degradation. While the + // migration takes place, nightly backups for the instance are suspended. No other + // Amazon RDS operations can take place for the instance, including modifying the + // instance, rebooting the instance, deleting the instance, creating a read replica + // for the instance, and creating a DB snapshot of the instance. + // + // Constraints: + // + // - For RDS for MariaDB, RDS for MySQL, RDS for Oracle, and RDS for PostgreSQL + // - The value supplied must be at least 10% greater than the current value. Values + // that are not at least 10% greater than the existing value are rounded up so that + // they are 10% greater than the current value. + // + // - When you increase the Provisioned IOPS, you must also specify the + // AllocatedStorage parameter. You can use the current value for AllocatedStorage + // . + // + // Default: Uses existing setting + Iops *int32 + + // The license model for the DB instance. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + // + // Valid Values: + // + // - RDS for Db2 - bring-your-own-license + // + // - RDS for MariaDB - general-public-license + // + // - RDS for Microsoft SQL Server - license-included + // + // - RDS for MySQL - general-public-license + // + // - RDS for Oracle - bring-your-own-license | license-included + // + // - RDS for PostgreSQL - postgresql-license + LicenseModel *string + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // If the DB instance doesn't manage the master user password with Amazon Web + // Services Secrets Manager, you can turn on this management. In this case, you + // can't specify MasterUserPassword . + // + // If the DB instance already manages the master user password with Amazon Web + // Services Secrets Manager, and you specify that the master user password is not + // managed with Amazon Web Services Secrets Manager, then you must specify + // MasterUserPassword . In this case, Amazon RDS deletes the secret and uses the + // new password for the master user specified by MasterUserPassword . + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide. + // + // Constraints: + // + // - Can't manage the master user password with Amazon Web Services Secrets + // Manager if MasterUserPassword is specified. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The new password for the master user. + // + // Changing this parameter doesn't result in an outage and the change is + // asynchronously applied as soon as possible. Between the time of the request and + // the completion of the request, the MasterUserPassword element exists in the + // PendingModifiedValues element of the operation response. + // + // Amazon RDS API operations never return the password, so this operation provides + // a way to regain access to a primary instance user if the password is lost. This + // includes restoring privileges that might have been accidentally revoked. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (The password for the master user is managed by the DB + // cluster. For more information, see ModifyDBCluster .) + // + // - RDS Custom + // + // Default: Uses existing setting + // + // Constraints: + // + // - Can't be specified if ManageMasterUserPassword is turned on. + // + // - Can include any printable ASCII character except "/", """, or "@". For RDS + // for Oracle, can't include the "&" (ampersand) or the "'" (single quotes) + // character. + // + // Length Constraints: + // + // - RDS for Db2 - Must contain from 8 to 255 characters. + // + // - RDS for MariaDB - Must contain from 8 to 41 characters. + // + // - RDS for Microsoft SQL Server - Must contain from 8 to 128 characters. + // + // - RDS for MySQL - Must contain from 8 to 41 characters. + // + // - RDS for Oracle - Must contain from 8 to 30 characters. + // + // - RDS for PostgreSQL - Must contain from 8 to 128 characters. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if both of the following conditions are met: + // + // - The DB instance doesn't manage the master user password in Amazon Web + // Services Secrets Manager. + // + // If the DB instance already manages the master user password in Amazon Web + // Services Secrets Manager, you can't change the KMS key used to encrypt the + // secret. + // + // - You are turning on ManageMasterUserPassword to manage the master user + // password in Amazon Web Services Secrets Manager. + // + // If you are turning on ManageMasterUserPassword and don't specify + // MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS key is used to + // encrypt the secret. If the secret is in a different Amazon Web Services account, + // then you can't use the aws/secretsmanager KMS key to encrypt the secret, and + // you must use a customer managed KMS key. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + MasterUserSecretKmsKeyId *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + // + // For more information about this setting, including limitations that apply to + // it, see [Managing capacity automatically with Amazon RDS storage autoscaling]in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Managing capacity automatically with Amazon RDS storage autoscaling]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling + MaxAllocatedStorage *int32 + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB instance. To disable collection of Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, set MonitoringInterval to a value other than + // 0 . + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + // to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess . + // For information on creating a monitoring role, see [To create an IAM role for Amazon RDS Enhanced Monitoring]in the Amazon RDS User + // Guide. + // + // If MonitoringInterval is set to a value other than 0 , supply a + // MonitoringRoleArn value. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [To create an IAM role for Amazon RDS Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole + MonitoringRoleArn *string + + // Specifies whether the DB instance is a Multi-AZ deployment. Changing this + // parameter doesn't result in an outage. The change is applied during the next + // maintenance window unless the ApplyImmediately parameter is enabled for this + // request. + // + // This setting doesn't apply to RDS Custom DB instances. + MultiAZ *bool + + // Specifies whether the to convert your DB instance from the single-tenant + // configuration to the multi-tenant configuration. This parameter is supported only + // for RDS for Oracle CDB instances. + // + // During the conversion, RDS creates an initial tenant database and associates + // the DB name, master user name, character set, and national character set + // metadata with this database. The tags associated with the instance also + // propagate to the initial tenant database. You can add more tenant databases to + // your DB instance by using the CreateTenantDatabase operation. + // + // The conversion to the multi-tenant configuration is permanent and irreversible, + // so you can't later convert back to the single-tenant configuration. When you + // specify this parameter, you must also specify ApplyImmediately . + MultiTenant *bool + + // The network type of the DB instance. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The new identifier for the DB instance when renaming a DB instance. When you + // change the DB instance identifier, an instance reboot occurs immediately if you + // enable ApplyImmediately , or will occur during the next maintenance window if + // you disable ApplyImmediately . This value is stored as a lowercase string. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - The first character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: mydbinstance + NewDBInstanceIdentifier *string + + // The option group to associate the DB instance with. + // + // Changing this parameter doesn't result in an outage, with one exception. If the + // parameter change results in an option group that enables OEM, it can cause a + // brief period, lasting less than a second, during which new connections are + // rejected but existing connections aren't interrupted. + // + // The change is applied during the next maintenance window unless the + // ApplyImmediately parameter is enabled for this request. + // + // Permanent options, such as the TDE option for Oracle Advanced Security TDE, + // can't be removed from an option group, and that option group can't be removed + // from a DB instance after it is associated with a DB instance. + // + // This setting doesn't apply to RDS Custom DB instances. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + // + // This setting doesn't apply to RDS Custom DB instances. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // returns an error. + PerformanceInsightsRetentionPeriod *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, as determined by the BackupRetentionPeriod parameter. + // Changing this parameter doesn't result in an outage and the change is + // asynchronously applied as soon as possible. The default is a 30-minute window + // selected at random from an 8-hour block of time for each Amazon Web Services + // Region. For more information, see [Backup window]in the Amazon RDS User Guide. + // + // This setting doesn't apply to Amazon Aurora DB instances. The daily time range + // for creating automated backups is managed by the DB cluster. For more + // information, see ModifyDBCluster . + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur, which might + // result in an outage. Changing this parameter doesn't result in an outage, except + // in the following situation, and the change is asynchronously applied as soon as + // possible. If there are pending actions that cause a reboot, and the maintenance + // window is changed to include the current time, then changing this parameter + // causes a reboot of the DB instance. If you change this window to the current + // time, there must be at least 30 minutes between the current time and end of the + // window to ensure pending changes are applied. + // + // For more information, see [Amazon RDS Maintenance Window] in the Amazon RDS User Guide. + // + // Default: Uses existing setting + // + // Constraints: + // + // - Must be in the format ddd:hh24:mi-ddd:hh24:mi . + // + // - The day values must be mon | tue | wed | thu | fri | sat | sun . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred backup window. + // + // - Must be at least 30 minutes. + // + // [Amazon RDS Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance + PreferredMaintenanceWindow *string + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + // + // This setting doesn't apply to RDS Custom DB instances. + ProcessorFeatures []types.ProcessorFeature + + // The order of priority in which an Aurora Replica is promoted to the primary + // instance after a failure of the existing primary instance. For more information, + // see [Fault Tolerance for an Aurora DB Cluster]in the Amazon Aurora User Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // Default: 1 + // + // Valid Values: 0 - 15 + // + // [Fault Tolerance for an Aurora DB Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora.Managing.FaultTolerance + PromotionTier *int32 + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB instance is publicly accessible and you connect from outside of the + // DB instance's virtual private cloud (VPC), its Domain Name System (DNS) endpoint + // resolves to the public IP address. When you connect from within the same VPC as + // the DB instance, the endpoint resolves to the private IP address. Access to the + // DB instance is ultimately controlled by the security group it uses. That public + // access isn't permitted if the security group assigned to the DB instance doesn't + // permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // PubliclyAccessible only applies to DB instances in a VPC. The DB instance must + // be part of a public subnet and PubliclyAccessible must be enabled for it to be + // publicly accessible. + // + // Changes to the PubliclyAccessible parameter are applied immediately regardless + // of the value of the ApplyImmediately parameter. + PubliclyAccessible *bool + + // A value that sets the open mode of a replica database to either mounted or + // read-only. + // + // Currently, this parameter is only supported for Oracle DB instances. + // + // Mounted DB replicas are included in Oracle Enterprise Edition. The main use + // case for mounted replicas is cross-Region disaster recovery. The primary + // database doesn't use Active Data Guard to transmit information to the mounted + // replica. Because it doesn't accept user connections, a mounted replica can't + // serve a read-only workload. For more information, see [Working with Oracle Read Replicas for Amazon RDS]in the Amazon RDS User + // Guide. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // [Working with Oracle Read Replicas for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html + ReplicaMode types.ReplicaMode + + // The number of minutes to pause the automation. When the time period ends, RDS + // Custom resumes full automation. + // + // Default: 60 + // + // Constraints: + // + // - Must be at least 60. + // + // - Must be no more than 1,440. + ResumeFullAutomationModeMinutes *int32 + + // Specifies whether to rotate the secret managed by Amazon Web Services Secrets + // Manager for the master user password. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB cluster. The secret value + // contains the updated password. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide. + // + // Constraints: + // + // - You must apply the change immediately when rotating the master user + // password. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html + RotateMasterUserPassword *bool + + // The storage throughput value for the DB instance. + // + // This setting applies only to the gp3 storage type. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + StorageThroughput *int32 + + // The storage type to associate with the DB instance. + // + // If you specify io1 , io2 , or gp3 you must also include a value for the Iops + // parameter. + // + // If you choose to migrate your DB instance from using standard storage to using + // Provisioned IOPS, or from using Provisioned IOPS to using standard storage, the + // process can take time. The duration of the migration depends on several factors + // such as database load, storage size, storage type (standard or Provisioned + // IOPS), amount of IOPS provisioned (if any), and the number of prior scale + // storage operations. Typical migration times are under 24 hours, but the process + // can take up to several days in some cases. During the migration, the DB instance + // is available for use, but might experience performance degradation. While the + // migration takes place, nightly backups for the instance are suspended. No other + // Amazon RDS operations can take place for the instance, including modifying the + // instance, rebooting the instance, deleting the instance, creating a read replica + // for the instance, and creating a DB snapshot of the instance. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // Default: io1 , if the Iops parameter is specified. Otherwise, gp2 . + StorageType *string + + // The ARN from the key store with which to associate the instance for TDE + // encryption. + // + // This setting doesn't apply to RDS Custom DB instances. + TdeCredentialArn *string + + // The password for the given ARN from the key store in order to access the device. + // + // This setting doesn't apply to RDS Custom DB instances. + TdeCredentialPassword *string + + // Specifies whether the DB instance class of the DB instance uses its default + // processor features. + // + // This setting doesn't apply to RDS Custom DB instances. + UseDefaultProcessorFeatures *bool + + // A list of Amazon EC2 VPC security groups to associate with this DB instance. + // This change is asynchronously applied as soon as possible. + // + // This setting doesn't apply to the following DB instances: + // + // - Amazon Aurora (The associated list of EC2 VPC security groups is managed by + // the DB cluster. For more information, see ModifyDBCluster .) + // + // - RDS Custom + // + // Constraints: + // + // - If supplied, must match existing VPC security group IDs. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type ModifyDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBParameterGroup.go new file mode 100644 index 00000000..47261644 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBParameterGroup.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the parameters of a DB parameter group. To modify more than one +// parameter, submit a list of the following: ParameterName , ParameterValue , and +// ApplyMethod . A maximum of 20 parameters can be modified in a single request. +// +// After you modify a DB parameter group, you should wait at least 5 minutes +// before creating your first DB instance that uses that DB parameter group as the +// default parameter group. This allows Amazon RDS to fully complete the modify +// operation before the parameter group is used as the default for a new DB +// instance. This is especially important for parameters that are critical when +// creating the default database for a DB instance, such as the character set for +// the default database defined by the character_set_database parameter. You can +// use the Parameter Groups option of the [Amazon RDS console]or the DescribeDBParameters command to +// verify that your DB parameter group has been created or modified. +// +// [Amazon RDS console]: https://console.aws.amazon.com/rds/ +func (c *Client) ModifyDBParameterGroup(ctx context.Context, params *ModifyDBParameterGroupInput, optFns ...func(*Options)) (*ModifyDBParameterGroupOutput, error) { + if params == nil { + params = &ModifyDBParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBParameterGroup", params, optFns, c.addOperationModifyDBParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBParameterGroupInput struct { + + // The name of the DB parameter group. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBParameterGroup . + // + // This member is required. + DBParameterGroupName *string + + // An array of parameter names, values, and the application methods for the + // parameter update. At least one parameter name, value, and application method + // must be supplied; later arguments are optional. A maximum of 20 parameters can + // be modified in a single request. + // + // Valid Values (for the application method): immediate | pending-reboot + // + // You can use the immediate value with dynamic parameters only. You can use the + // pending-reboot value for both dynamic and static parameters. + // + // When the application method is immediate , changes to dynamic parameters are + // applied immediately to the DB instances associated with the parameter group. + // + // When the application method is pending-reboot , changes to dynamic and static + // parameters are applied after a reboot without failover to the DB instances + // associated with the parameter group. + // + // You can't use pending-reboot with dynamic parameters on RDS for SQL Server DB + // instances. Use immediate . + // + // For more information on modifying DB parameters, see [Working with DB parameter groups] in the Amazon RDS User + // Guide. + // + // [Working with DB parameter groups]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html + // + // This member is required. + Parameters []types.Parameter + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the ModifyDBParameterGroup or +// ResetDBParameterGroup operation. +type ModifyDBParameterGroupOutput struct { + + // The name of the DB parameter group. + DBParameterGroupName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxy.go new file mode 100644 index 00000000..59e28adc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxy.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Changes the settings for an existing DB proxy. +func (c *Client) ModifyDBProxy(ctx context.Context, params *ModifyDBProxyInput, optFns ...func(*Options)) (*ModifyDBProxyOutput, error) { + if params == nil { + params = &ModifyDBProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBProxy", params, optFns, c.addOperationModifyDBProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBProxyInput struct { + + // The identifier for the DBProxy to modify. + // + // This member is required. + DBProxyName *string + + // The new authentication settings for the DBProxy . + Auth []types.UserAuthConfig + + // Whether the proxy includes detailed information about SQL statements in its + // logs. This information helps you to debug issues involving SQL behavior or the + // performance and scalability of the proxy connections. The debug information + // includes the text of SQL statements that you submit through the proxy. Thus, + // only enable this setting when needed for debugging, and only when you have + // security measures in place to safeguard any sensitive information that appears + // in the logs. + DebugLogging *bool + + // The number of seconds that a connection to the proxy can be inactive before the + // proxy disconnects it. You can set this value higher or lower than the connection + // timeout limit for the associated database. + IdleClientTimeout *int32 + + // The new identifier for the DBProxy . An identifier must begin with a letter and + // must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen + // or contain two consecutive hyphens. + NewDBProxyName *string + + // Whether Transport Layer Security (TLS) encryption is required for connections + // to the proxy. By enabling this setting, you can enforce encrypted TLS + // connections to the proxy, even if the associated database doesn't use TLS. + RequireTLS *bool + + // The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access + // secrets in Amazon Web Services Secrets Manager. + RoleArn *string + + // The new list of security groups for the DBProxy . + SecurityGroups []string + + noSmithyDocumentSerde +} + +type ModifyDBProxyOutput struct { + + // The DBProxy object representing the new settings for the proxy. + DBProxy *types.DBProxy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBProxy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBProxy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBProxy", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyEndpoint.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyEndpoint.go new file mode 100644 index 00000000..da4bad5f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyEndpoint.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Changes the settings for an existing DB proxy endpoint. +func (c *Client) ModifyDBProxyEndpoint(ctx context.Context, params *ModifyDBProxyEndpointInput, optFns ...func(*Options)) (*ModifyDBProxyEndpointOutput, error) { + if params == nil { + params = &ModifyDBProxyEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBProxyEndpoint", params, optFns, c.addOperationModifyDBProxyEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBProxyEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBProxyEndpointInput struct { + + // The name of the DB proxy sociated with the DB proxy endpoint that you want to + // modify. + // + // This member is required. + DBProxyEndpointName *string + + // The new identifier for the DBProxyEndpoint . An identifier must begin with a + // letter and must contain only ASCII letters, digits, and hyphens; it can't end + // with a hyphen or contain two consecutive hyphens. + NewDBProxyEndpointName *string + + // The VPC security group IDs for the DB proxy endpoint. When the DB proxy + // endpoint uses a different VPC than the original proxy, you also specify a + // different set of security group IDs than for the original proxy. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type ModifyDBProxyEndpointOutput struct { + + // The DBProxyEndpoint object representing the new settings for the DB proxy + // endpoint. + DBProxyEndpoint *types.DBProxyEndpoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBProxyEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBProxyEndpoint{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBProxyEndpoint"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBProxyEndpointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBProxyEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBProxyEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBProxyEndpoint", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyTargetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyTargetGroup.go new file mode 100644 index 00000000..9a786a0d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBProxyTargetGroup.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the properties of a DBProxyTargetGroup . +func (c *Client) ModifyDBProxyTargetGroup(ctx context.Context, params *ModifyDBProxyTargetGroupInput, optFns ...func(*Options)) (*ModifyDBProxyTargetGroupOutput, error) { + if params == nil { + params = &ModifyDBProxyTargetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBProxyTargetGroup", params, optFns, c.addOperationModifyDBProxyTargetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBProxyTargetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBProxyTargetGroupInput struct { + + // The name of the proxy. + // + // This member is required. + DBProxyName *string + + // The name of the target group to modify. + // + // This member is required. + TargetGroupName *string + + // The settings that determine the size and behavior of the connection pool for + // the target group. + ConnectionPoolConfig *types.ConnectionPoolConfiguration + + // The new name for the modified DBProxyTarget . An identifier must begin with a + // letter and must contain only ASCII letters, digits, and hyphens; it can't end + // with a hyphen or contain two consecutive hyphens. + NewName *string + + noSmithyDocumentSerde +} + +type ModifyDBProxyTargetGroupOutput struct { + + // The settings of the modified DBProxyTarget . + DBProxyTargetGroup *types.DBProxyTargetGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBProxyTargetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBProxyTargetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBProxyTargetGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBProxyTargetGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBProxyTargetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBProxyTargetGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBProxyTargetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBProxyTargetGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBRecommendation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBRecommendation.go new file mode 100644 index 00000000..9d8174f7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBRecommendation.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the recommendation status and recommended action status for the +// specified recommendation. +func (c *Client) ModifyDBRecommendation(ctx context.Context, params *ModifyDBRecommendationInput, optFns ...func(*Options)) (*ModifyDBRecommendationOutput, error) { + if params == nil { + params = &ModifyDBRecommendationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBRecommendation", params, optFns, c.addOperationModifyDBRecommendationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBRecommendationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBRecommendationInput struct { + + // The identifier of the recommendation to update. + // + // This member is required. + RecommendationId *string + + // The language of the modified recommendation. + Locale *string + + // The list of recommended action status to update. You can update multiple + // recommended actions at one time. + RecommendedActionUpdates []types.RecommendedActionUpdate + + // The recommendation status to update. + // + // Valid values: + // + // - active + // + // - dismissed + Status *string + + noSmithyDocumentSerde +} + +type ModifyDBRecommendationOutput struct { + + // The recommendation for your DB instances, DB clusters, and DB parameter groups. + DBRecommendation *types.DBRecommendation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBRecommendation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBRecommendation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBRecommendation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBRecommendationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBRecommendation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBRecommendation", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBShardGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBShardGroup.go new file mode 100644 index 00000000..9656182d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBShardGroup.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the settings of an Aurora Limitless Database DB shard group. You can +// change one or more settings by specifying these parameters and the new values in +// the request. +func (c *Client) ModifyDBShardGroup(ctx context.Context, params *ModifyDBShardGroupInput, optFns ...func(*Options)) (*ModifyDBShardGroupOutput, error) { + if params == nil { + params = &ModifyDBShardGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBShardGroup", params, optFns, c.addOperationModifyDBShardGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBShardGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBShardGroupInput struct { + + // The name of the DB shard group to modify. + // + // This member is required. + DBShardGroupIdentifier *string + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB shard group. +type ModifyDBShardGroupOutput struct { + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The name of the primary DB cluster for the DB shard group. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB shard group. + DBShardGroupArn *string + + // The name of the DB shard group. + DBShardGroupIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB shard + // group. + DBShardGroupResourceId *string + + // The connection endpoint for the DB shard group. + Endpoint *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Indicates whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access isn't permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBShardGroup. + // + // This setting is only for Aurora Limitless Database. + PubliclyAccessible *bool + + // The status of the DB shard group. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBShardGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBShardGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBShardGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBShardGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBShardGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBShardGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBShardGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBShardGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshot.go new file mode 100644 index 00000000..51549ca4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshot.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a manual DB snapshot with a new engine version. The snapshot can be +// encrypted or unencrypted, but not shared or public. +// +// Amazon RDS supports upgrading DB snapshots for MySQL, PostgreSQL, and Oracle. +// This operation doesn't apply to RDS Custom or RDS for Db2. +func (c *Client) ModifyDBSnapshot(ctx context.Context, params *ModifyDBSnapshotInput, optFns ...func(*Options)) (*ModifyDBSnapshotOutput, error) { + if params == nil { + params = &ModifyDBSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBSnapshot", params, optFns, c.addOperationModifyDBSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBSnapshotInput struct { + + // The identifier of the DB snapshot to modify. + // + // This member is required. + DBSnapshotIdentifier *string + + // The engine version to upgrade the DB snapshot to. + // + // The following are the database engines and engine versions that are available + // when you upgrade a DB snapshot. + // + // MySQL + // + // For the list of engine versions that are available for upgrading a DB snapshot, + // see [Upgrading a MySQL DB snapshot engine version]in the Amazon RDS User Guide. + // + // Oracle + // + // - 19.0.0.0.ru-2022-01.rur-2022-01.r1 (supported for 12.2.0.1 DB snapshots) + // + // - 19.0.0.0.ru-2022-07.rur-2022-07.r1 (supported for 12.1.0.2 DB snapshots) + // + // - 12.1.0.2.v8 (supported for 12.1.0.1 DB snapshots) + // + // - 11.2.0.4.v12 (supported for 11.2.0.2 DB snapshots) + // + // - 11.2.0.4.v11 (supported for 11.2.0.3 DB snapshots) + // + // PostgreSQL + // + // For the list of engine versions that are available for upgrading a DB snapshot, + // see [Upgrading a PostgreSQL DB snapshot engine version]in the Amazon RDS User Guide. + // + // [Upgrading a PostgreSQL DB snapshot engine version]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBSnapshot.PostgreSQL.html + // [Upgrading a MySQL DB snapshot engine version]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql-upgrade-snapshot.html + EngineVersion *string + + // The option group to identify with the upgraded DB snapshot. + // + // You can specify this parameter when you upgrade an Oracle DB snapshot. The same + // option group considerations apply when upgrading a DB snapshot as when upgrading + // a DB instance. For more information, see [Option group considerations]in the Amazon RDS User Guide. + // + // [Option group considerations]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Oracle.html#USER_UpgradeDBInstance.Oracle.OGPG.OG + OptionGroupName *string + + noSmithyDocumentSerde +} + +type ModifyDBSnapshotOutput struct { + + // Contains the details of an Amazon RDS DB snapshot. + // + // This data type is used as a response element in the DescribeDBSnapshots action. + DBSnapshot *types.DBSnapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshotAttribute.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshotAttribute.go new file mode 100644 index 00000000..adca5633 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSnapshotAttribute.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds an attribute and values to, or removes an attribute and values from, a +// manual DB snapshot. +// +// To share a manual DB snapshot with other Amazon Web Services accounts, specify +// restore as the AttributeName and use the ValuesToAdd parameter to add a list of +// IDs of the Amazon Web Services accounts that are authorized to restore the +// manual DB snapshot. Uses the value all to make the manual DB snapshot public, +// which means it can be copied or restored by all Amazon Web Services accounts. +// +// Don't add the all value for any manual DB snapshots that contain private +// information that you don't want available to all Amazon Web Services accounts. +// +// If the manual DB snapshot is encrypted, it can be shared, but only by +// specifying a list of authorized Amazon Web Services account IDs for the +// ValuesToAdd parameter. You can't use all as a value for that parameter in this +// case. +// +// To view which Amazon Web Services accounts have access to copy or restore a +// manual DB snapshot, or whether a manual DB snapshot public or private, use the DescribeDBSnapshotAttributes +// API operation. The accounts are returned as values for the restore attribute. +func (c *Client) ModifyDBSnapshotAttribute(ctx context.Context, params *ModifyDBSnapshotAttributeInput, optFns ...func(*Options)) (*ModifyDBSnapshotAttributeOutput, error) { + if params == nil { + params = &ModifyDBSnapshotAttributeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBSnapshotAttribute", params, optFns, c.addOperationModifyDBSnapshotAttributeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBSnapshotAttributeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBSnapshotAttributeInput struct { + + // The name of the DB snapshot attribute to modify. + // + // To manage authorization for other Amazon Web Services accounts to copy or + // restore a manual DB snapshot, set this value to restore . + // + // To view the list of attributes available to modify, use the DescribeDBSnapshotAttributes API operation. + // + // This member is required. + AttributeName *string + + // The identifier for the DB snapshot to modify the attributes for. + // + // This member is required. + DBSnapshotIdentifier *string + + // A list of DB snapshot attributes to add to the attribute specified by + // AttributeName . + // + // To authorize other Amazon Web Services accounts to copy or restore a manual + // snapshot, set this list to include one or more Amazon Web Services account IDs, + // or all to make the manual DB snapshot restorable by any Amazon Web Services + // account. Do not add the all value for any manual DB snapshots that contain + // private information that you don't want available to all Amazon Web Services + // accounts. + ValuesToAdd []string + + // A list of DB snapshot attributes to remove from the attribute specified by + // AttributeName . + // + // To remove authorization for other Amazon Web Services accounts to copy or + // restore a manual snapshot, set this list to include one or more Amazon Web + // Services account identifiers, or all to remove authorization for any Amazon Web + // Services account to copy or restore the DB snapshot. If you specify all , an + // Amazon Web Services account whose account ID is explicitly added to the restore + // attribute can still copy or restore the manual DB snapshot. + ValuesToRemove []string + + noSmithyDocumentSerde +} + +type ModifyDBSnapshotAttributeOutput struct { + + // Contains the results of a successful call to the DescribeDBSnapshotAttributes + // API action. + // + // Manual DB snapshot attributes are used to authorize other Amazon Web Services + // accounts to copy or restore a manual DB snapshot. For more information, see the + // ModifyDBSnapshotAttribute API action. + DBSnapshotAttributesResult *types.DBSnapshotAttributesResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBSnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBSnapshotAttribute{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBSnapshotAttribute{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBSnapshotAttribute"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBSnapshotAttributeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBSnapshotAttribute(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBSnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBSnapshotAttribute", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSubnetGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSubnetGroup.go new file mode 100644 index 00000000..4af3706f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyDBSubnetGroup.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an existing DB subnet group. DB subnet groups must contain at least +// one subnet in at least two AZs in the Amazon Web Services Region. +func (c *Client) ModifyDBSubnetGroup(ctx context.Context, params *ModifyDBSubnetGroupInput, optFns ...func(*Options)) (*ModifyDBSubnetGroupOutput, error) { + if params == nil { + params = &ModifyDBSubnetGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyDBSubnetGroup", params, optFns, c.addOperationModifyDBSubnetGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyDBSubnetGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyDBSubnetGroupInput struct { + + // The name for the DB subnet group. This value is stored as a lowercase string. + // You can't modify the default subnet group. + // + // Constraints: Must match the name of an existing DBSubnetGroup. Must not be + // default. + // + // Example: mydbsubnetgroup + // + // This member is required. + DBSubnetGroupName *string + + // The EC2 subnet IDs for the DB subnet group. + // + // This member is required. + SubnetIds []string + + // The description for the DB subnet group. + DBSubnetGroupDescription *string + + noSmithyDocumentSerde +} + +type ModifyDBSubnetGroupOutput struct { + + // Contains the details of an Amazon RDS DB subnet group. + // + // This data type is used as a response element in the DescribeDBSubnetGroups + // action. + DBSubnetGroup *types.DBSubnetGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyDBSubnetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBSubnetGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyDBSubnetGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyDBSubnetGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBSubnetGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyDBSubnetGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyDBSubnetGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyEventSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyEventSubscription.go new file mode 100644 index 00000000..e23d29ef --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyEventSubscription.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an existing RDS event notification subscription. You can't modify the +// source identifiers using this call. To change source identifiers for a +// subscription, use the AddSourceIdentifierToSubscription and +// RemoveSourceIdentifierFromSubscription calls. +// +// You can see a list of the event categories for a given source type ( SourceType +// ) in [Events]in the Amazon RDS User Guide or by using the DescribeEventCategories +// operation. +// +// [Events]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html +func (c *Client) ModifyEventSubscription(ctx context.Context, params *ModifyEventSubscriptionInput, optFns ...func(*Options)) (*ModifyEventSubscriptionOutput, error) { + if params == nil { + params = &ModifyEventSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyEventSubscription", params, optFns, c.addOperationModifyEventSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyEventSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyEventSubscriptionInput struct { + + // The name of the RDS event notification subscription. + // + // This member is required. + SubscriptionName *string + + // Specifies whether to activate the subscription. + Enabled *bool + + // A list of event categories for a source type ( SourceType ) that you want to + // subscribe to. You can see a list of the categories for a given source type in [Events] + // in the Amazon RDS User Guide or by using the DescribeEventCategories operation. + // + // [Events]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html + EventCategories []string + + // The Amazon Resource Name (ARN) of the SNS topic created for event notification. + // The ARN is created by Amazon SNS when you create a topic and subscribe to it. + SnsTopicArn *string + + // The type of source that is generating the events. For example, if you want to + // be notified of events generated by a DB instance, you would set this parameter + // to db-instance. For RDS Proxy events, specify db-proxy . If this value isn't + // specified, all events are returned. + // + // Valid Values: db-instance | db-cluster | db-parameter-group | db-security-group + // | db-snapshot | db-cluster-snapshot | db-proxy | zero-etl | + // custom-engine-version | blue-green-deployment + SourceType *string + + noSmithyDocumentSerde +} + +type ModifyEventSubscriptionOutput struct { + + // Contains the results of a successful invocation of the + // DescribeEventSubscriptions action. + EventSubscription *types.EventSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyEventSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyEventSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyEventSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyEventSubscription"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyEventSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyEventSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyEventSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyEventSubscription", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyGlobalCluster.go new file mode 100644 index 00000000..2943a020 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyGlobalCluster.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies a setting for an Amazon Aurora global database cluster. You can change +// one or more database configuration parameters by specifying these parameters and +// the new values in the request. For more information on Amazon Aurora, see [What is Amazon Aurora?]in +// the Amazon Aurora User Guide. +// +// This operation only applies to Aurora global database clusters. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +func (c *Client) ModifyGlobalCluster(ctx context.Context, params *ModifyGlobalClusterInput, optFns ...func(*Options)) (*ModifyGlobalClusterOutput, error) { + if params == nil { + params = &ModifyGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyGlobalCluster", params, optFns, c.addOperationModifyGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyGlobalClusterInput struct { + + // Specifies whether to allow major version upgrades. + // + // Constraints: Must be enabled if you specify a value for the EngineVersion + // parameter that's a different major version than the global cluster's current + // version. + // + // If you upgrade the major version of a global database, the cluster and DB + // instance parameter groups are set to the default parameter groups for the new + // version. Apply any custom parameter groups after completing the upgrade. + AllowMajorVersionUpgrade *bool + + // Specifies whether to enable deletion protection for the global database + // cluster. The global database cluster can't be deleted when deletion protection + // is enabled. + DeletionProtection *bool + + // The version number of the database engine to which you want to upgrade. + // + // To list all of the available engine versions for aurora-mysql (for MySQL-based + // Aurora global databases), use the following command: + // + // aws rds describe-db-engine-versions --engine aurora-mysql --query + // '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]' + // + // To list all of the available engine versions for aurora-postgresql (for + // PostgreSQL-based Aurora global databases), use the following command: + // + // aws rds describe-db-engine-versions --engine aurora-postgresql --query + // '*[]|[?SupportsGlobalDatabases == `true`].[EngineVersion]' + EngineVersion *string + + // The cluster identifier for the global cluster to modify. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing global database cluster. + GlobalClusterIdentifier *string + + // The new cluster identifier for the global database cluster. This value is + // stored as a lowercase string. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - The first character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster2 + NewGlobalClusterIdentifier *string + + noSmithyDocumentSerde +} + +type ModifyGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyIntegration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyIntegration.go new file mode 100644 index 00000000..58933ba2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyIntegration.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Modifies a zero-ETL integration with Amazon Redshift. +// +// Currently, you can only modify integrations that have Aurora MySQL source DB +// clusters. Integrations with Aurora PostgreSQL and RDS sources currently don't +// support modifying the integration. +func (c *Client) ModifyIntegration(ctx context.Context, params *ModifyIntegrationInput, optFns ...func(*Options)) (*ModifyIntegrationOutput, error) { + if params == nil { + params = &ModifyIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyIntegration", params, optFns, c.addOperationModifyIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyIntegrationInput struct { + + // The unique identifier of the integration to modify. + // + // This member is required. + IntegrationIdentifier *string + + // A new data filter for the integration. For more information, see [Data filtering for Aurora zero-ETL integrations with Amazon Redshift]. + // + // [Data filtering for Aurora zero-ETL integrations with Amazon Redshift]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Zero_ETL_Filtering.html + DataFilter *string + + // A new description for the integration. + Description *string + + // A new name for the integration. + IntegrationName *string + + noSmithyDocumentSerde +} + +// A zero-ETL integration with Amazon Redshift. +type ModifyIntegrationOutput struct { + + // The encryption context for the integration. For more information, see [Encryption context] in the + // Amazon Web Services Key Management Service Developer Guide. + // + // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + AdditionalEncryptionContext map[string]string + + // The time when the integration was created, in Universal Coordinated Time (UTC). + CreateTime *time.Time + + // Data filters for the integration. These filters determine which tables from the + // source database are sent to the target Amazon Redshift data warehouse. + DataFilter *string + + // A description of the integration. + Description *string + + // Any errors associated with the integration. + Errors []types.IntegrationError + + // The ARN of the integration. + IntegrationArn *string + + // The name of the integration. + IntegrationName *string + + // The Amazon Web Services Key Management System (Amazon Web Services KMS) key + // identifier for the key used to to encrypt the integration. + KMSKeyId *string + + // The Amazon Resource Name (ARN) of the database used as the source for + // replication. + SourceArn *string + + // The current status of the integration. + Status types.IntegrationStatus + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The ARN of the Redshift data warehouse used as the target for replication. + TargetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyIntegration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyIntegration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyIntegration", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyOptionGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyOptionGroup.go new file mode 100644 index 00000000..4d04d675 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyOptionGroup.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an existing option group. +func (c *Client) ModifyOptionGroup(ctx context.Context, params *ModifyOptionGroupInput, optFns ...func(*Options)) (*ModifyOptionGroupOutput, error) { + if params == nil { + params = &ModifyOptionGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyOptionGroup", params, optFns, c.addOperationModifyOptionGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyOptionGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyOptionGroupInput struct { + + // The name of the option group to be modified. + // + // Permanent options, such as the TDE option for Oracle Advanced Security TDE, + // can't be removed from an option group, and that option group can't be removed + // from a DB instance once it is associated with a DB instance + // + // This member is required. + OptionGroupName *string + + // Specifies whether to apply the change immediately or during the next + // maintenance window for each instance associated with the option group. + ApplyImmediately *bool + + // Options in this list are added to the option group or, if already present, the + // specified configuration is used to update the existing configuration. + OptionsToInclude []types.OptionConfiguration + + // Options in this list are removed from the option group. + OptionsToRemove []string + + noSmithyDocumentSerde +} + +type ModifyOptionGroupOutput struct { + + // + OptionGroup *types.OptionGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyOptionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyOptionGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyOptionGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyOptionGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyOptionGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyOptionGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyOptionGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyOptionGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyTenantDatabase.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyTenantDatabase.go new file mode 100644 index 00000000..69d61976 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ModifyTenantDatabase.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an existing tenant database in a DB instance. You can change the +// tenant database name or the master user password. This operation is supported +// only for RDS for Oracle CDB instances using the multi-tenant configuration. +func (c *Client) ModifyTenantDatabase(ctx context.Context, params *ModifyTenantDatabaseInput, optFns ...func(*Options)) (*ModifyTenantDatabaseOutput, error) { + if params == nil { + params = &ModifyTenantDatabaseInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyTenantDatabase", params, optFns, c.addOperationModifyTenantDatabaseMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyTenantDatabaseOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyTenantDatabaseInput struct { + + // The identifier of the DB instance that contains the tenant database that you + // are modifying. This parameter isn't case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + // The user-supplied name of the tenant database that you want to modify. This + // parameter isn’t case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing tenant database. + // + // This member is required. + TenantDBName *string + + // The new password for the master user of the specified tenant database in your + // DB instance. + // + // Amazon RDS operations never return the password, so this action provides a way + // to regain access to a tenant database user if the password is lost. This + // includes restoring privileges that might have been accidentally revoked. + // + // Constraints: + // + // - Can include any printable ASCII character except / , " (double quote), @ , & + // (ampersand), and ' (single quote). + // + // Length constraints: + // + // - Must contain between 8 and 30 characters. + MasterUserPassword *string + + // The new name of the tenant database when renaming a tenant database. This + // parameter isn’t case-sensitive. + // + // Constraints: + // + // - Can't be the string null or any other reserved word. + // + // - Can't be longer than 8 characters. + NewTenantDBName *string + + noSmithyDocumentSerde +} + +type ModifyTenantDatabaseOutput struct { + + // A tenant database in the DB instance. This data type is an element in the + // response to the DescribeTenantDatabases action. + TenantDatabase *types.TenantDatabase + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyTenantDatabaseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyTenantDatabase{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyTenantDatabase{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ModifyTenantDatabase"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpModifyTenantDatabaseValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyTenantDatabase(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opModifyTenantDatabase(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ModifyTenantDatabase", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplica.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplica.go new file mode 100644 index 00000000..be369893 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplica.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Promotes a read replica DB instance to a standalone DB instance. +// +// - Backup duration is a function of the amount of changes to the database +// since the previous backup. If you plan to promote a read replica to a standalone +// instance, we recommend that you enable backups and complete at least one backup +// prior to promotion. In addition, a read replica cannot be promoted to a +// standalone instance when it is in the backing-up status. If you have enabled +// backups on your read replica, configure the automated backup window so that +// daily backups do not interfere with read replica promotion. +// +// - This command doesn't apply to Aurora MySQL, Aurora PostgreSQL, or RDS +// Custom. +func (c *Client) PromoteReadReplica(ctx context.Context, params *PromoteReadReplicaInput, optFns ...func(*Options)) (*PromoteReadReplicaOutput, error) { + if params == nil { + params = &PromoteReadReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PromoteReadReplica", params, optFns, c.addOperationPromoteReadReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PromoteReadReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PromoteReadReplicaInput struct { + + // The DB instance identifier. This value is stored as a lowercase string. + // + // Constraints: + // + // - Must match the identifier of an existing read replica DB instance. + // + // Example: mydbinstance + // + // This member is required. + DBInstanceIdentifier *string + + // The number of days for which automated backups are retained. Setting this + // parameter to a positive number enables backups. Setting this parameter to 0 + // disables automated backups. + // + // Default: 1 + // + // Constraints: + // + // - Must be a value from 0 to 35. + // + // - Can't be set to 0 if the DB instance is a source to read replicas. + BackupRetentionPeriod *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, using the BackupRetentionPeriod parameter. + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region. To see the time blocks available, see [Adjusting the Preferred Maintenance Window] + // in the Amazon RDS User Guide. + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Adjusting the Preferred Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html + PreferredBackupWindow *string + + noSmithyDocumentSerde +} + +type PromoteReadReplicaOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPromoteReadReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpPromoteReadReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPromoteReadReplica{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PromoteReadReplica"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPromoteReadReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPromoteReadReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPromoteReadReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PromoteReadReplica", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplicaDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplicaDBCluster.go new file mode 100644 index 00000000..1971d7ef --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PromoteReadReplicaDBCluster.go @@ -0,0 +1,184 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Promotes a read replica DB cluster to a standalone DB cluster. +func (c *Client) PromoteReadReplicaDBCluster(ctx context.Context, params *PromoteReadReplicaDBClusterInput, optFns ...func(*Options)) (*PromoteReadReplicaDBClusterOutput, error) { + if params == nil { + params = &PromoteReadReplicaDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PromoteReadReplicaDBCluster", params, optFns, c.addOperationPromoteReadReplicaDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PromoteReadReplicaDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PromoteReadReplicaDBClusterInput struct { + + // The identifier of the DB cluster read replica to promote. This parameter isn't + // case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing DB cluster read replica. + // + // Example: my-cluster-replica1 + // + // This member is required. + DBClusterIdentifier *string + + noSmithyDocumentSerde +} + +type PromoteReadReplicaDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPromoteReadReplicaDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpPromoteReadReplicaDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPromoteReadReplicaDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PromoteReadReplicaDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPromoteReadReplicaDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPromoteReadReplicaDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPromoteReadReplicaDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PromoteReadReplicaDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PurchaseReservedDBInstancesOffering.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PurchaseReservedDBInstancesOffering.go new file mode 100644 index 00000000..2491fa54 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_PurchaseReservedDBInstancesOffering.go @@ -0,0 +1,179 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Purchases a reserved DB instance offering. +func (c *Client) PurchaseReservedDBInstancesOffering(ctx context.Context, params *PurchaseReservedDBInstancesOfferingInput, optFns ...func(*Options)) (*PurchaseReservedDBInstancesOfferingOutput, error) { + if params == nil { + params = &PurchaseReservedDBInstancesOfferingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PurchaseReservedDBInstancesOffering", params, optFns, c.addOperationPurchaseReservedDBInstancesOfferingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PurchaseReservedDBInstancesOfferingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PurchaseReservedDBInstancesOfferingInput struct { + + // The ID of the Reserved DB instance offering to purchase. + // + // Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706 + // + // This member is required. + ReservedDBInstancesOfferingId *string + + // The number of instances to reserve. + // + // Default: 1 + DBInstanceCount *int32 + + // Customer-specified identifier to track this reservation. + // + // Example: myreservationID + ReservedDBInstanceId *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + noSmithyDocumentSerde +} + +type PurchaseReservedDBInstancesOfferingOutput struct { + + // This data type is used as a response element in the DescribeReservedDBInstances + // and PurchaseReservedDBInstancesOffering actions. + ReservedDBInstance *types.ReservedDBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPurchaseReservedDBInstancesOfferingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpPurchaseReservedDBInstancesOffering{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpPurchaseReservedDBInstancesOffering{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseReservedDBInstancesOffering"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPurchaseReservedDBInstancesOfferingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseReservedDBInstancesOffering(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPurchaseReservedDBInstancesOffering(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PurchaseReservedDBInstancesOffering", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBCluster.go new file mode 100644 index 00000000..3793ee71 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBCluster.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// You might need to reboot your DB cluster, usually for maintenance reasons. For +// example, if you make certain modifications, or if you change the DB cluster +// parameter group associated with the DB cluster, reboot the DB cluster for the +// changes to take effect. +// +// Rebooting a DB cluster restarts the database engine service. Rebooting a DB +// cluster results in a momentary outage, during which the DB cluster status is set +// to rebooting. +// +// Use this operation only for a non-Aurora Multi-AZ DB cluster. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) RebootDBCluster(ctx context.Context, params *RebootDBClusterInput, optFns ...func(*Options)) (*RebootDBClusterOutput, error) { + if params == nil { + params = &RebootDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RebootDBCluster", params, optFns, c.addOperationRebootDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RebootDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RebootDBClusterInput struct { + + // The DB cluster identifier. This parameter is stored as a lowercase string. + // + // Constraints: + // + // - Must match the identifier of an existing DBCluster. + // + // This member is required. + DBClusterIdentifier *string + + noSmithyDocumentSerde +} + +type RebootDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRebootDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRebootDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRebootDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RebootDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRebootDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRebootDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RebootDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBInstance.go new file mode 100644 index 00000000..437c2ace --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBInstance.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// You might need to reboot your DB instance, usually for maintenance reasons. For +// example, if you make certain modifications, or if you change the DB parameter +// group associated with the DB instance, you must reboot the instance for the +// changes to take effect. +// +// Rebooting a DB instance restarts the database engine service. Rebooting a DB +// instance results in a momentary outage, during which the DB instance status is +// set to rebooting. +// +// For more information about rebooting, see [Rebooting a DB Instance] in the Amazon RDS User Guide. +// +// This command doesn't apply to RDS Custom. +// +// If your DB instance is part of a Multi-AZ DB cluster, you can reboot the DB +// cluster with the RebootDBCluster operation. +// +// [Rebooting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RebootInstance.html +func (c *Client) RebootDBInstance(ctx context.Context, params *RebootDBInstanceInput, optFns ...func(*Options)) (*RebootDBInstanceOutput, error) { + if params == nil { + params = &RebootDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RebootDBInstance", params, optFns, c.addOperationRebootDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RebootDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RebootDBInstanceInput struct { + + // The DB instance identifier. This parameter is stored as a lowercase string. + // + // Constraints: + // + // - Must match the identifier of an existing DBInstance. + // + // This member is required. + DBInstanceIdentifier *string + + // Specifies whether the reboot is conducted through a Multi-AZ failover. + // + // Constraint: You can't enable force failover if the instance isn't configured + // for Multi-AZ. + ForceFailover *bool + + noSmithyDocumentSerde +} + +type RebootDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRebootDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRebootDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRebootDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RebootDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRebootDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRebootDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RebootDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBShardGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBShardGroup.go new file mode 100644 index 00000000..f6402250 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RebootDBShardGroup.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// You might need to reboot your DB shard group, usually for maintenance reasons. +// For example, if you make certain modifications, reboot the DB shard group for +// the changes to take effect. +// +// This operation applies only to Aurora Limitless Database DBb shard groups. +func (c *Client) RebootDBShardGroup(ctx context.Context, params *RebootDBShardGroupInput, optFns ...func(*Options)) (*RebootDBShardGroupOutput, error) { + if params == nil { + params = &RebootDBShardGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RebootDBShardGroup", params, optFns, c.addOperationRebootDBShardGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RebootDBShardGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RebootDBShardGroupInput struct { + + // The name of the DB shard group to reboot. + // + // This member is required. + DBShardGroupIdentifier *string + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB shard group. +type RebootDBShardGroupOutput struct { + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The name of the primary DB cluster for the DB shard group. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB shard group. + DBShardGroupArn *string + + // The name of the DB shard group. + DBShardGroupIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB shard + // group. + DBShardGroupResourceId *string + + // The connection endpoint for the DB shard group. + Endpoint *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Indicates whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access isn't permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBShardGroup. + // + // This setting is only for Aurora Limitless Database. + PubliclyAccessible *bool + + // The status of the DB shard group. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRebootDBShardGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRebootDBShardGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRebootDBShardGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RebootDBShardGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRebootDBShardGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootDBShardGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRebootDBShardGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RebootDBShardGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RegisterDBProxyTargets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RegisterDBProxyTargets.go new file mode 100644 index 00000000..5f2530a1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RegisterDBProxyTargets.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associate one or more DBProxyTarget data structures with a DBProxyTargetGroup . +func (c *Client) RegisterDBProxyTargets(ctx context.Context, params *RegisterDBProxyTargetsInput, optFns ...func(*Options)) (*RegisterDBProxyTargetsOutput, error) { + if params == nil { + params = &RegisterDBProxyTargetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterDBProxyTargets", params, optFns, c.addOperationRegisterDBProxyTargetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterDBProxyTargetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterDBProxyTargetsInput struct { + + // The identifier of the DBProxy that is associated with the DBProxyTargetGroup . + // + // This member is required. + DBProxyName *string + + // One or more DB cluster identifiers. + DBClusterIdentifiers []string + + // One or more DB instance identifiers. + DBInstanceIdentifiers []string + + // The identifier of the DBProxyTargetGroup . + TargetGroupName *string + + noSmithyDocumentSerde +} + +type RegisterDBProxyTargetsOutput struct { + + // One or more DBProxyTarget objects that are created when you register targets + // with a target group. + DBProxyTargets []types.DBProxyTarget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterDBProxyTargetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRegisterDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRegisterDBProxyTargets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterDBProxyTargets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRegisterDBProxyTargetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDBProxyTargets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterDBProxyTargets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterDBProxyTargets", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveFromGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveFromGlobalCluster.go new file mode 100644 index 00000000..17aa3d21 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveFromGlobalCluster.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Detaches an Aurora secondary cluster from an Aurora global database cluster. +// The cluster becomes a standalone cluster with read-write capability instead of +// being read-only and receiving data from a primary cluster in a different Region. +// +// This operation only applies to Aurora DB clusters. +func (c *Client) RemoveFromGlobalCluster(ctx context.Context, params *RemoveFromGlobalClusterInput, optFns ...func(*Options)) (*RemoveFromGlobalClusterOutput, error) { + if params == nil { + params = &RemoveFromGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveFromGlobalCluster", params, optFns, c.addOperationRemoveFromGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveFromGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveFromGlobalClusterInput struct { + + // The Amazon Resource Name (ARN) identifying the cluster that was detached from + // the Aurora global database cluster. + DbClusterIdentifier *string + + // The cluster identifier to detach from the Aurora global database cluster. + GlobalClusterIdentifier *string + + noSmithyDocumentSerde +} + +type RemoveFromGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveFromGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveFromGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveFromGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveFromGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveFromGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveFromGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveFromGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBCluster.go new file mode 100644 index 00000000..2656f8b5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBCluster.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the asssociation of an Amazon Web Services Identity and Access +// Management (IAM) role from a DB cluster. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) RemoveRoleFromDBCluster(ctx context.Context, params *RemoveRoleFromDBClusterInput, optFns ...func(*Options)) (*RemoveRoleFromDBClusterOutput, error) { + if params == nil { + params = &RemoveRoleFromDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveRoleFromDBCluster", params, optFns, c.addOperationRemoveRoleFromDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveRoleFromDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveRoleFromDBClusterInput struct { + + // The name of the DB cluster to disassociate the IAM role from. + // + // This member is required. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) of the IAM role to disassociate from the Aurora + // DB cluster, for example arn:aws:iam::123456789012:role/AuroraAccessRole . + // + // This member is required. + RoleArn *string + + // The name of the feature for the DB cluster that the IAM role is to be + // disassociated from. For information about supported feature names, see DBEngineVersion. + FeatureName *string + + noSmithyDocumentSerde +} + +type RemoveRoleFromDBClusterOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveRoleFromDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveRoleFromDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveRoleFromDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveRoleFromDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRemoveRoleFromDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveRoleFromDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveRoleFromDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveRoleFromDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBInstance.go new file mode 100644 index 00000000..b2f64e56 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveRoleFromDBInstance.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates an Amazon Web Services Identity and Access Management (IAM) role +// from a DB instance. +func (c *Client) RemoveRoleFromDBInstance(ctx context.Context, params *RemoveRoleFromDBInstanceInput, optFns ...func(*Options)) (*RemoveRoleFromDBInstanceOutput, error) { + if params == nil { + params = &RemoveRoleFromDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveRoleFromDBInstance", params, optFns, c.addOperationRemoveRoleFromDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveRoleFromDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveRoleFromDBInstanceInput struct { + + // The name of the DB instance to disassociate the IAM role from. + // + // This member is required. + DBInstanceIdentifier *string + + // The name of the feature for the DB instance that the IAM role is to be + // disassociated from. For information about supported feature names, see + // DBEngineVersion . + // + // This member is required. + FeatureName *string + + // The Amazon Resource Name (ARN) of the IAM role to disassociate from the DB + // instance, for example, arn:aws:iam::123456789012:role/AccessRole . + // + // This member is required. + RoleArn *string + + noSmithyDocumentSerde +} + +type RemoveRoleFromDBInstanceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveRoleFromDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveRoleFromDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveRoleFromDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveRoleFromDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRemoveRoleFromDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveRoleFromDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveRoleFromDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveRoleFromDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveSourceIdentifierFromSubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveSourceIdentifierFromSubscription.go new file mode 100644 index 00000000..6e5e0290 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveSourceIdentifierFromSubscription.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a source identifier from an existing RDS event notification +// subscription. +func (c *Client) RemoveSourceIdentifierFromSubscription(ctx context.Context, params *RemoveSourceIdentifierFromSubscriptionInput, optFns ...func(*Options)) (*RemoveSourceIdentifierFromSubscriptionOutput, error) { + if params == nil { + params = &RemoveSourceIdentifierFromSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveSourceIdentifierFromSubscription", params, optFns, c.addOperationRemoveSourceIdentifierFromSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveSourceIdentifierFromSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveSourceIdentifierFromSubscriptionInput struct { + + // The source identifier to be removed from the subscription, such as the DB + // instance identifier for a DB instance or the name of a security group. + // + // This member is required. + SourceIdentifier *string + + // The name of the RDS event notification subscription you want to remove a source + // identifier from. + // + // This member is required. + SubscriptionName *string + + noSmithyDocumentSerde +} + +type RemoveSourceIdentifierFromSubscriptionOutput struct { + + // Contains the results of a successful invocation of the + // DescribeEventSubscriptions action. + EventSubscription *types.EventSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveSourceIdentifierFromSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveSourceIdentifierFromSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveSourceIdentifierFromSubscription{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveSourceIdentifierFromSubscription"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRemoveSourceIdentifierFromSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveSourceIdentifierFromSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveSourceIdentifierFromSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveSourceIdentifierFromSubscription", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveTagsFromResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveTagsFromResource.go new file mode 100644 index 00000000..82419f11 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RemoveTagsFromResource.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes metadata tags from an Amazon RDS resource. +// +// For an overview on tagging an Amazon RDS resource, see [Tagging Amazon RDS Resources] in the Amazon RDS User +// Guide or [Tagging Amazon Aurora and Amazon RDS Resources]in the Amazon Aurora User Guide. +// +// [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html +// [Tagging Amazon Aurora and Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html +func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsFromResourceInput, optFns ...func(*Options)) (*RemoveTagsFromResourceOutput, error) { + if params == nil { + params = &RemoveTagsFromResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RemoveTagsFromResource", params, optFns, c.addOperationRemoveTagsFromResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RemoveTagsFromResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RemoveTagsFromResourceInput struct { + + // The Amazon RDS resource that the tags are removed from. This value is an Amazon + // Resource Name (ARN). For information about creating an ARN, see [Constructing an ARN for Amazon RDS]in the Amazon + // RDS User Guide. + // + // [Constructing an ARN for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing + // + // This member is required. + ResourceName *string + + // The tag key (name) of the tag to be removed. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type RemoveTagsFromResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRemoveTagsFromResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRemoveTagsFromResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRemoveTagsFromResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveTagsFromResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRemoveTagsFromResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTagsFromResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRemoveTagsFromResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RemoveTagsFromResource", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBClusterParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBClusterParameterGroup.go new file mode 100644 index 00000000..52aa768d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBClusterParameterGroup.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the parameters of a DB cluster parameter group to the default value. +// To reset specific parameters submit a list of the following: ParameterName and +// ApplyMethod . To reset the entire DB cluster parameter group, specify the +// DBClusterParameterGroupName and ResetAllParameters parameters. +// +// When resetting the entire group, dynamic parameters are updated immediately and +// static parameters are set to pending-reboot to take effect on the next DB +// instance restart or RebootDBInstance request. You must call RebootDBInstance +// for every DB instance in your DB cluster that you want the updated static +// parameter to apply to. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) ResetDBClusterParameterGroup(ctx context.Context, params *ResetDBClusterParameterGroupInput, optFns ...func(*Options)) (*ResetDBClusterParameterGroupOutput, error) { + if params == nil { + params = &ResetDBClusterParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResetDBClusterParameterGroup", params, optFns, c.addOperationResetDBClusterParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResetDBClusterParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ResetDBClusterParameterGroupInput struct { + + // The name of the DB cluster parameter group to reset. + // + // This member is required. + DBClusterParameterGroupName *string + + // A list of parameter names in the DB cluster parameter group to reset to the + // default values. You can't use this parameter if the ResetAllParameters + // parameter is enabled. + Parameters []types.Parameter + + // Specifies whether to reset all parameters in the DB cluster parameter group to + // their default values. You can't use this parameter if there is a list of + // parameter names specified for the Parameters parameter. + ResetAllParameters *bool + + noSmithyDocumentSerde +} + +type ResetDBClusterParameterGroupOutput struct { + + // The name of the DB cluster parameter group. + // + // Constraints: + // + // - Must be 1 to 255 letters or numbers. + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // This value is stored as a lowercase string. + DBClusterParameterGroupName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationResetDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpResetDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpResetDBClusterParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResetDBClusterParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpResetDBClusterParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetDBClusterParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opResetDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ResetDBClusterParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBParameterGroup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBParameterGroup.go new file mode 100644 index 00000000..1188f565 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_ResetDBParameterGroup.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the parameters of a DB parameter group to the engine/system default +// value. To reset specific parameters, provide a list of the following: +// ParameterName and ApplyMethod . To reset the entire DB parameter group, specify +// the DBParameterGroup name and ResetAllParameters parameters. When resetting the +// entire group, dynamic parameters are updated immediately and static parameters +// are set to pending-reboot to take effect on the next DB instance restart or +// RebootDBInstance request. +func (c *Client) ResetDBParameterGroup(ctx context.Context, params *ResetDBParameterGroupInput, optFns ...func(*Options)) (*ResetDBParameterGroupOutput, error) { + if params == nil { + params = &ResetDBParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResetDBParameterGroup", params, optFns, c.addOperationResetDBParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResetDBParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ResetDBParameterGroupInput struct { + + // The name of the DB parameter group. + // + // Constraints: + // + // - Must match the name of an existing DBParameterGroup . + // + // This member is required. + DBParameterGroupName *string + + // To reset the entire DB parameter group, specify the DBParameterGroup name and + // ResetAllParameters parameters. To reset specific parameters, provide a list of + // the following: ParameterName and ApplyMethod . A maximum of 20 parameters can be + // modified in a single request. + // + // MySQL + // + // Valid Values (for Apply method): immediate | pending-reboot + // + // You can use the immediate value with dynamic parameters only. You can use the + // pending-reboot value for both dynamic and static parameters, and changes are + // applied when DB instance reboots. + // + // MariaDB + // + // Valid Values (for Apply method): immediate | pending-reboot + // + // You can use the immediate value with dynamic parameters only. You can use the + // pending-reboot value for both dynamic and static parameters, and changes are + // applied when DB instance reboots. + // + // Oracle + // + // Valid Values (for Apply method): pending-reboot + Parameters []types.Parameter + + // Specifies whether to reset all parameters in the DB parameter group to default + // values. By default, all parameters in the DB parameter group are reset to + // default values. + ResetAllParameters *bool + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the ModifyDBParameterGroup or +// ResetDBParameterGroup operation. +type ResetDBParameterGroupOutput struct { + + // The name of the DB parameter group. + DBParameterGroupName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationResetDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpResetDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpResetDBParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ResetDBParameterGroup"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpResetDBParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetDBParameterGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opResetDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ResetDBParameterGroup", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromS3.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromS3.go new file mode 100644 index 00000000..0ea3b025 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromS3.go @@ -0,0 +1,551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Aurora DB cluster from MySQL data stored in an Amazon S3 +// bucket. Amazon RDS must be authorized to access the Amazon S3 bucket and the +// data must be created using the Percona XtraBackup utility as described in [Migrating Data from MySQL by Using an Amazon S3 Bucket]in +// the Amazon Aurora User Guide. +// +// This operation only restores the DB cluster, not the DB instances for that DB +// cluster. You must invoke the CreateDBInstance operation to create DB instances +// for the restored DB cluster, specifying the identifier of the restored DB +// cluster in DBClusterIdentifier . You can create DB instances only after the +// RestoreDBClusterFromS3 operation has completed and the DB cluster is available. +// +// For more information on Amazon Aurora, see [What is Amazon Aurora?] in the Amazon Aurora User Guide. +// +// This operation only applies to Aurora DB clusters. The source DB engine must be +// MySQL. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Migrating Data from MySQL by Using an Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Migrating.ExtMySQL.html#AuroraMySQL.Migrating.ExtMySQL.S3 +func (c *Client) RestoreDBClusterFromS3(ctx context.Context, params *RestoreDBClusterFromS3Input, optFns ...func(*Options)) (*RestoreDBClusterFromS3Output, error) { + if params == nil { + params = &RestoreDBClusterFromS3Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBClusterFromS3", params, optFns, c.addOperationRestoreDBClusterFromS3Middlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBClusterFromS3Output) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBClusterFromS3Input struct { + + // The name of the DB cluster to create from the source data in the Amazon S3 + // bucket. This parameter isn't case-sensitive. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-cluster1 + // + // This member is required. + DBClusterIdentifier *string + + // The name of the database engine to be used for this DB cluster. + // + // Valid Values: aurora-mysql (for Aurora MySQL) + // + // This member is required. + Engine *string + + // The name of the master user for the restored DB cluster. + // + // Constraints: + // + // - Must be 1 to 16 letters or numbers. + // + // - First character must be a letter. + // + // - Can't be a reserved word for the chosen database engine. + // + // This member is required. + MasterUsername *string + + // The name of the Amazon S3 bucket that contains the data used to create the + // Amazon Aurora DB cluster. + // + // This member is required. + S3BucketName *string + + // The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access + // Management (IAM) role that authorizes Amazon RDS to access the Amazon S3 bucket + // on your behalf. + // + // This member is required. + S3IngestionRoleArn *string + + // The identifier for the database engine that was backed up to create the files + // stored in the Amazon S3 bucket. + // + // Valid Values: mysql + // + // This member is required. + SourceEngine *string + + // The version of the database that the backup files were created from. + // + // MySQL versions 5.7 and 8.0 are supported. + // + // Example: 5.7.40 , 8.0.28 + // + // This member is required. + SourceEngineVersion *string + + // A list of Availability Zones (AZs) where instances in the restored DB cluster + // can be created. + AvailabilityZones []string + + // The target backtrack window, in seconds. To disable backtracking, set this + // value to 0. + // + // Currently, Backtrack is only supported for Aurora MySQL DB clusters. + // + // Default: 0 + // + // Constraints: + // + // - If specified, this value must be set to a number from 0 to 259,200 (72 + // hours). + BacktrackWindow *int64 + + // The number of days for which automated backups of the restored DB cluster are + // retained. You must specify a minimum value of 1. + // + // Default: 1 + // + // Constraints: + // + // - Must be a value from 1 to 35 + BackupRetentionPeriod *int32 + + // A value that indicates that the restored DB cluster should be associated with + // the specified CharacterSet. + CharacterSetName *string + + // Specifies whether to copy all tags from the restored DB cluster to snapshots of + // the restored DB cluster. The default is not to copy them. + CopyTagsToSnapshot *bool + + // The name of the DB cluster parameter group to associate with the restored DB + // cluster. If this argument is omitted, the default parameter group for the engine + // version is used. + // + // Constraints: + // + // - If supplied, must match the name of an existing DBClusterParameterGroup. + DBClusterParameterGroupName *string + + // A DB subnet group to associate with the restored DB cluster. + // + // Constraints: If supplied, must match the name of an existing DBSubnetGroup. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // The database name for the restored DB cluster. + DatabaseName *string + + // Specifies whether to enable deletion protection for the DB cluster. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. + DeletionProtection *bool + + // Specify the Active Directory directory ID to restore the DB cluster in. The + // domain must be created prior to this operation. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to + // authenticate users that connect to the DB cluster. For more information, see [Kerberos Authentication]in + // the Amazon Aurora User Guide. + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html + Domain *string + + // Specify the name of the IAM role to be used when making API calls to the + // Directory Service. + DomainIAMRoleName *string + + // The list of logs that the restored DB cluster is to export to CloudWatch Logs. + // The values in the list depend on the DB engine being used. + // + // Aurora MySQL + // + // Possible values are audit , error , general , and slowquery . + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication] in the Amazon Aurora User Guide. + // + // [IAM Database Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // The life cycle type for this DB cluster. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard + // support, you can avoid charges for Extended Support by setting the value to + // open-source-rds-extended-support-disabled . In this case, RDS automatically + // upgrades your restored DB cluster to a higher engine version, if the major + // engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB cluster into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB cluster past the end of standard support for that engine + // version. For more information, see the following sections: + // + // - Amazon Aurora - [Using Amazon RDS Extended Support]in the Amazon Aurora User Guide + // + // - Amazon RDS - [Using Amazon RDS Extended Support]in the Amazon RDS User Guide + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The version number of the database engine to use. + // + // To list all of the available engine versions for aurora-mysql (Aurora MySQL), + // use the following command: + // + // aws rds describe-db-engine-versions --engine aurora-mysql --query + // "DBEngineVersions[].EngineVersion" + // + // Aurora MySQL + // + // Examples: 5.7.mysql_aurora.2.12.0 , 8.0.mysql_aurora.3.04.0 + EngineVersion *string + + // The Amazon Web Services KMS key identifier for an encrypted DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If the StorageEncrypted parameter is enabled, and you do not specify a value + // for the KmsKeyId parameter, then Amazon RDS will use your default KMS key. + // There is a default KMS key for your Amazon Web Services account. Your Amazon Web + // Services account has a different default KMS key for each Amazon Web Services + // Region. + KmsKeyId *string + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon + // Aurora User Guide. + // + // Constraints: + // + // - Can't manage the master user password with Amazon Web Services Secrets + // Manager if MasterUserPassword is specified. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The password for the master database user. This password can contain any + // printable ASCII character except "/", """, or "@". + // + // Constraints: + // + // - Must contain from 8 to 41 characters. + // + // - Can't be specified if ManageMasterUserPassword is turned on. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If you don't specify MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS + // key is used to encrypt the secret. If the secret is in a different Amazon Web + // Services account, then you can't use the aws/secretsmanager KMS key to encrypt + // the secret, and you must use a customer managed KMS key. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + MasterUserSecretKmsKeyId *string + + // The network type of the DB cluster. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // A value that indicates that the restored DB cluster should be associated with + // the specified option group. + // + // Permanent options can't be removed from an option group. An option group can't + // be removed from a DB cluster once it is associated with a DB cluster. + OptionGroupName *string + + // The port number on which the instances in the restored DB cluster accept + // connections. + // + // Default: 3306 + Port *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled using the BackupRetentionPeriod parameter. + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region. To view the time blocks available, see + // [Backup window]in the Amazon Aurora User Guide. + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.Backups.BackupWindow + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur, in Universal + // Coordinated Time (UTC). + // + // Format: ddd:hh24:mi-ddd:hh24:mi + // + // The default is a 30-minute window selected at random from an 8-hour block of + // time for each Amazon Web Services Region, occurring on a random day of the week. + // To see the time blocks available, see [Adjusting the Preferred Maintenance Window]in the Amazon Aurora User Guide. + // + // Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. + // + // Constraints: Minimum 30-minute window. + // + // [Adjusting the Preferred Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora + PreferredMaintenanceWindow *string + + // The prefix for all of the file names that contain the data used to create the + // Amazon Aurora DB cluster. If you do not specify a SourceS3Prefix value, then the + // Amazon Aurora DB cluster is created by using all of the files in the Amazon S3 + // bucket. + S3Prefix *string + + // Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration + + // Specifies whether the restored DB cluster is encrypted. + StorageEncrypted *bool + + // Specifies the storage type to be associated with the DB cluster. + // + // Valid Values: aurora , aurora-iopt1 + // + // Default: aurora + // + // Valid for: Aurora DB clusters only + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // A list of EC2 VPC security groups to associate with the restored DB cluster. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBClusterFromS3Output struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBClusterFromS3Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBClusterFromS3{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBClusterFromS3{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBClusterFromS3"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBClusterFromS3ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBClusterFromS3(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBClusterFromS3(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBClusterFromS3", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromSnapshot.go new file mode 100644 index 00000000..9e8d5ecb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterFromSnapshot.go @@ -0,0 +1,656 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB cluster from a DB snapshot or DB cluster snapshot. +// +// The target DB cluster is created from the source snapshot with a default +// configuration. If you don't specify a security group, the new DB cluster is +// associated with the default security group. +// +// This operation only restores the DB cluster, not the DB instances for that DB +// cluster. You must invoke the CreateDBInstance operation to create DB instances +// for the restored DB cluster, specifying the identifier of the restored DB +// cluster in DBClusterIdentifier . You can create DB instances only after the +// RestoreDBClusterFromSnapshot operation has completed and the DB cluster is +// available. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) RestoreDBClusterFromSnapshot(ctx context.Context, params *RestoreDBClusterFromSnapshotInput, optFns ...func(*Options)) (*RestoreDBClusterFromSnapshotOutput, error) { + if params == nil { + params = &RestoreDBClusterFromSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBClusterFromSnapshot", params, optFns, c.addOperationRestoreDBClusterFromSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBClusterFromSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBClusterFromSnapshotInput struct { + + // The name of the DB cluster to create from the DB snapshot or DB cluster + // snapshot. This parameter isn't case-sensitive. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Example: my-snapshot-id + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // This member is required. + DBClusterIdentifier *string + + // The database engine to use for the new DB cluster. + // + // Default: The same as source + // + // Constraint: Must be compatible with the engine of the source + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // This member is required. + Engine *string + + // The identifier for the DB snapshot or DB cluster snapshot to restore from. + // + // You can use either the name or the Amazon Resource Name (ARN) to specify a DB + // cluster snapshot. However, you can use only the ARN to specify a DB snapshot. + // + // Constraints: + // + // - Must match the identifier of an existing Snapshot. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // This member is required. + SnapshotIdentifier *string + + // Provides the list of Availability Zones (AZs) where instances in the restored + // DB cluster can be created. + // + // Valid for: Aurora DB clusters only + AvailabilityZones []string + + // The target backtrack window, in seconds. To disable backtracking, set this + // value to 0. + // + // Currently, Backtrack is only supported for Aurora MySQL DB clusters. + // + // Default: 0 + // + // Constraints: + // + // - If specified, this value must be set to a number from 0 to 259,200 (72 + // hours). + // + // Valid for: Aurora DB clusters only + BacktrackWindow *int64 + + // Specifies whether to copy all tags from the restored DB cluster to snapshots of + // the restored DB cluster. The default is not to copy them. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + CopyTagsToSnapshot *bool + + // The compute and memory capacity of the each DB instance in the Multi-AZ DB + // cluster, for example db.m6gd.xlarge. Not all DB instance classes are available + // in all Amazon Web Services Regions, or for all database engines. + // + // For the full list of DB instance classes, and availability for your engine, see [DB Instance Class] + // in the Amazon RDS User Guide. + // + // Valid for: Multi-AZ DB clusters only + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBClusterInstanceClass *string + + // The name of the DB cluster parameter group to associate with this DB cluster. + // If this argument is omitted, the default DB cluster parameter group for the + // specified engine is used. + // + // Constraints: + // + // - If supplied, must match the name of an existing default DB cluster + // parameter group. + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DBClusterParameterGroupName *string + + // The name of the DB subnet group to use for the new DB cluster. + // + // Constraints: If supplied, must match the name of an existing DB subnet group. + // + // Example: mydbsubnetgroup + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DBSubnetGroupName *string + + // The database name for the restored DB cluster. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DatabaseName *string + + // Specifies whether to enable deletion protection for the DB cluster. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DeletionProtection *bool + + // The Active Directory directory ID to restore the DB cluster in. The domain must + // be created prior to this operation. Currently, only MySQL, Microsoft SQL Server, + // Oracle, and PostgreSQL DB instances can be created in an Active Directory + // Domain. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // Valid for: Aurora DB clusters only + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The name of the IAM role to be used when making API calls to the Directory + // Service. + // + // Valid for: Aurora DB clusters only + DomainIAMRoleName *string + + // The list of logs that the restored DB cluster is to export to Amazon CloudWatch + // Logs. The values in the list depend on the DB engine being used. + // + // RDS for MySQL + // + // Possible values are error , general , and slowquery . + // + // RDS for PostgreSQL + // + // Possible values are postgresql and upgrade . + // + // Aurora MySQL + // + // Possible values are audit , error , general , and slowquery . + // + // Aurora PostgreSQL + // + // Possible value is postgresql . + // + // For more information about exporting CloudWatch Logs for Amazon RDS, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon RDS User Guide. + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication] in the Amazon Aurora User Guide or [IAM database authentication for MariaDB, MySQL, and PostgreSQL] in the Amazon + // RDS User Guide. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [IAM Database Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html + // [IAM database authentication for MariaDB, MySQL, and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to turn on Performance Insights for the DB cluster. + EnablePerformanceInsights *bool + + // The life cycle type for this DB cluster. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard + // support, you can avoid charges for Extended Support by setting the value to + // open-source-rds-extended-support-disabled . In this case, RDS automatically + // upgrades your restored DB cluster to a higher engine version, if the major + // engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB cluster into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB cluster past the end of standard support for that engine + // version. For more information, see the following sections: + // + // - Amazon Aurora - [Using Amazon RDS Extended Support]in the Amazon Aurora User Guide + // + // - Amazon RDS - [Using Amazon RDS Extended Support]in the Amazon RDS User Guide + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The DB engine mode of the DB cluster, either provisioned or serverless . + // + // For more information, see [CreateDBCluster]. + // + // Valid for: Aurora DB clusters only + // + // [CreateDBCluster]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBCluster.html + EngineMode *string + + // The version of the database engine to use for the new DB cluster. If you don't + // specify an engine version, the default version for the database engine in the + // Amazon Web Services Region is used. + // + // To list all of the available engine versions for Aurora MySQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine aurora-mysql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for Aurora PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine aurora-postgresql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for MySQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine mysql --query + // "DBEngineVersions[].EngineVersion" + // + // To list all of the available engine versions for RDS for PostgreSQL, use the + // following command: + // + // aws rds describe-db-engine-versions --engine postgres --query + // "DBEngineVersions[].EngineVersion" + // + // Aurora MySQL + // + // See [Database engine updates for Amazon Aurora MySQL] in the Amazon Aurora User Guide. + // + // Aurora PostgreSQL + // + // See [Amazon Aurora PostgreSQL releases and engine versions] in the Amazon Aurora User Guide. + // + // MySQL + // + // See [Amazon RDS for MySQL] in the Amazon RDS User Guide. + // + // PostgreSQL + // + // See [Amazon RDS for PostgreSQL versions and extensions] in the Amazon RDS User Guide. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [Database engine updates for Amazon Aurora MySQL]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html + // [Amazon RDS for PostgreSQL versions and extensions]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts + // [Amazon RDS for MySQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.VersionMgmt + // [Amazon Aurora PostgreSQL releases and engine versions]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.20180305.html + EngineVersion *string + + // The amount of Provisioned IOPS (input/output operations per second) to be + // initially allocated for each DB instance in the Multi-AZ DB cluster. + // + // For information about valid IOPS values, see [Amazon RDS Provisioned IOPS storage] in the Amazon RDS User Guide. + // + // Constraints: Must be a multiple between .5 and 50 of the storage amount for the + // DB instance. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [Amazon RDS Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // The Amazon Web Services KMS key identifier to use when restoring an encrypted + // DB cluster from a DB snapshot or DB cluster snapshot. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // When you don't specify a value for the KmsKeyId parameter, then the following + // occurs: + // + // - If the DB snapshot or DB cluster snapshot in SnapshotIdentifier is + // encrypted, then the restored DB cluster is encrypted using the KMS key that was + // used to encrypt the DB snapshot or DB cluster snapshot. + // + // - If the DB snapshot or DB cluster snapshot in SnapshotIdentifier isn't + // encrypted, then the restored DB cluster isn't encrypted. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + KmsKeyId *string + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB cluster. To turn off collecting Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, also set MonitoringInterval to a value other + // than 0 . + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + // Enhanced Monitoring metrics to Amazon CloudWatch Logs. An example is + // arn:aws:iam:123456789012:role/emaccess . + // + // If MonitoringInterval is set to a value other than 0 , supply a + // MonitoringRoleArn value. + MonitoringRoleArn *string + + // The network type of the DB cluster. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // Valid for: Aurora DB clusters only + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The name of the option group to use for the restored DB cluster. + // + // DB clusters are associated with a default option group that can't be modified. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // issues an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the new DB cluster accepts connections. + // + // Constraints: This value must be 1150-65535 + // + // Default: The same port as the original DB cluster. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + Port *int32 + + // Specifies whether the DB cluster is publicly accessible. + // + // When the DB cluster is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB cluster's virtual + // private cloud (VPC). It resolves to the public IP address from outside of the DB + // cluster's VPC. Access to the DB cluster is ultimately controlled by the security + // group it uses. That public access is not permitted if the security group + // assigned to the DB cluster doesn't permit it. + // + // When the DB cluster isn't publicly accessible, it is an internal DB cluster + // with a DNS name that resolves to a private IP address. + // + // Default: The default behavior varies depending on whether DBSubnetGroupName is + // specified. + // + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, + // the following applies: + // + // - If the default VPC in the target Region doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the default VPC in the target Region has an internet gateway attached to + // it, the DB cluster is public. + // + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the + // following applies: + // + // - If the subnets are part of a VPC that doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the subnets are part of a VPC that has an internet gateway attached to + // it, the DB cluster is public. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + PubliclyAccessible *bool + + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + + // For DB clusters in serverless DB engine mode, the scaling properties of the DB + // cluster. + // + // Valid for: Aurora DB clusters only + ScalingConfiguration *types.ScalingConfiguration + + // Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration + + // Specifies the storage type to be associated with the DB cluster. + // + // When specified for a Multi-AZ DB cluster, a value for the Iops parameter is + // required. + // + // Valid Values: aurora , aurora-iopt1 (Aurora DB clusters); io1 (Multi-AZ DB + // clusters) + // + // Default: aurora (Aurora DB clusters); io1 (Multi-AZ DB clusters) + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + StorageType *string + + // The tags to be assigned to the restored DB cluster. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + Tags []types.Tag + + // A list of VPC security groups that the new DB cluster will belong to. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBClusterFromSnapshotOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBClusterFromSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBClusterFromSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBClusterFromSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBClusterFromSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBClusterFromSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBClusterFromSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBClusterFromSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBClusterFromSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterToPointInTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterToPointInTime.go new file mode 100644 index 00000000..b34bcbdc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBClusterToPointInTime.go @@ -0,0 +1,632 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Restores a DB cluster to an arbitrary point in time. Users can restore to any +// point in time before LatestRestorableTime for up to BackupRetentionPeriod days. +// The target DB cluster is created from the source DB cluster with the same +// configuration as the original DB cluster, except that the new DB cluster is +// created with the default DB security group. +// +// For Aurora, this operation only restores the DB cluster, not the DB instances +// for that DB cluster. You must invoke the CreateDBInstance operation to create +// DB instances for the restored DB cluster, specifying the identifier of the +// restored DB cluster in DBClusterIdentifier . You can create DB instances only +// after the RestoreDBClusterToPointInTime operation has completed and the DB +// cluster is available. +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User +// Guide. +// +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +// [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +func (c *Client) RestoreDBClusterToPointInTime(ctx context.Context, params *RestoreDBClusterToPointInTimeInput, optFns ...func(*Options)) (*RestoreDBClusterToPointInTimeOutput, error) { + if params == nil { + params = &RestoreDBClusterToPointInTimeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBClusterToPointInTime", params, optFns, c.addOperationRestoreDBClusterToPointInTimeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBClusterToPointInTimeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBClusterToPointInTimeInput struct { + + // The name of the new DB cluster to be created. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens + // + // - First character must be a letter + // + // - Can't end with a hyphen or contain two consecutive hyphens + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // This member is required. + DBClusterIdentifier *string + + // The target backtrack window, in seconds. To disable backtracking, set this + // value to 0. + // + // Default: 0 + // + // Constraints: + // + // - If specified, this value must be set to a number from 0 to 259,200 (72 + // hours). + // + // Valid for: Aurora MySQL DB clusters only + BacktrackWindow *int64 + + // Specifies whether to copy all tags from the restored DB cluster to snapshots of + // the restored DB cluster. The default is not to copy them. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + CopyTagsToSnapshot *bool + + // The compute and memory capacity of the each DB instance in the Multi-AZ DB + // cluster, for example db.m6gd.xlarge. Not all DB instance classes are available + // in all Amazon Web Services Regions, or for all database engines. + // + // For the full list of DB instance classes, and availability for your engine, see [DB instance class] + // in the Amazon RDS User Guide. + // + // Valid for: Multi-AZ DB clusters only + // + // [DB instance class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBClusterInstanceClass *string + + // The name of the custom DB cluster parameter group to associate with this DB + // cluster. + // + // If the DBClusterParameterGroupName parameter is omitted, the default DB cluster + // parameter group for the specified engine is used. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB cluster parameter group. + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DBClusterParameterGroupName *string + + // The DB subnet group name to use for the new DB cluster. + // + // Constraints: If supplied, must match the name of an existing DBSubnetGroup. + // + // Example: mydbsubnetgroup + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DBSubnetGroupName *string + + // Specifies whether to enable deletion protection for the DB cluster. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + DeletionProtection *bool + + // The Active Directory directory ID to restore the DB cluster in. The domain must + // be created prior to this operation. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to + // authenticate users that connect to the DB cluster. For more information, see [Kerberos Authentication]in + // the Amazon Aurora User Guide. + // + // Valid for: Aurora DB clusters only + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html + Domain *string + + // The name of the IAM role to be used when making API calls to the Directory + // Service. + // + // Valid for: Aurora DB clusters only + DomainIAMRoleName *string + + // The list of logs that the restored DB cluster is to export to CloudWatch Logs. + // The values in the list depend on the DB engine being used. + // + // RDS for MySQL + // + // Possible values are error , general , and slowquery . + // + // RDS for PostgreSQL + // + // Possible values are postgresql and upgrade . + // + // Aurora MySQL + // + // Possible values are audit , error , general , and slowquery . + // + // Aurora PostgreSQL + // + // Possible value is postgresql . + // + // For more information about exporting CloudWatch Logs for Amazon RDS, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon RDS User Guide. + // + // For more information about exporting CloudWatch Logs for Amazon Aurora, see [Publishing Database Logs to Amazon CloudWatch Logs] in + // the Amazon Aurora User Guide. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information, see [IAM Database Authentication] in the Amazon Aurora User Guide or [IAM database authentication for MariaDB, MySQL, and PostgreSQL] in the Amazon + // RDS User Guide. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + // + // [IAM Database Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html + // [IAM database authentication for MariaDB, MySQL, and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to turn on Performance Insights for the DB cluster. + EnablePerformanceInsights *bool + + // The life cycle type for this DB cluster. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB cluster into Amazon RDS Extended Support. At the end of standard + // support, you can avoid charges for Extended Support by setting the value to + // open-source-rds-extended-support-disabled . In this case, RDS automatically + // upgrades your restored DB cluster to a higher engine version, if the major + // engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB cluster into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB cluster past the end of standard support for that engine + // version. For more information, see the following sections: + // + // - Amazon Aurora - [Using Amazon RDS Extended Support]in the Amazon Aurora User Guide + // + // - Amazon RDS - [Using Amazon RDS Extended Support]in the Amazon RDS User Guide + // + // Valid for Cluster Type: Aurora DB clusters and Multi-AZ DB clusters + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The engine mode of the new cluster. Specify provisioned or serverless , + // depending on the type of the cluster you are creating. You can create an Aurora + // Serverless v1 clone from a provisioned cluster, or a provisioned clone from an + // Aurora Serverless v1 cluster. To create a clone that is an Aurora Serverless v1 + // cluster, the original cluster must be an Aurora Serverless v1 cluster or an + // encrypted provisioned cluster. + // + // Valid for: Aurora DB clusters only + EngineMode *string + + // The amount of Provisioned IOPS (input/output operations per second) to be + // initially allocated for each DB instance in the Multi-AZ DB cluster. + // + // For information about valid IOPS values, see [Amazon RDS Provisioned IOPS storage] in the Amazon RDS User Guide. + // + // Constraints: Must be a multiple between .5 and 50 of the storage amount for the + // DB instance. + // + // Valid for: Multi-AZ DB clusters only + // + // [Amazon RDS Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // The Amazon Web Services KMS key identifier to use when restoring an encrypted + // DB cluster from an encrypted DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // You can restore to a new DB cluster and encrypt the new DB cluster with a KMS + // key that is different from the KMS key used to encrypt the source DB cluster. + // The new DB cluster is encrypted with the KMS key identified by the KmsKeyId + // parameter. + // + // If you don't specify a value for the KmsKeyId parameter, then the following + // occurs: + // + // - If the DB cluster is encrypted, then the restored DB cluster is encrypted + // using the KMS key that was used to encrypt the source DB cluster. + // + // - If the DB cluster isn't encrypted, then the restored DB cluster isn't + // encrypted. + // + // If DBClusterIdentifier refers to a DB cluster that isn't encrypted, then the + // restore request is rejected. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + KmsKeyId *string + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB cluster. To turn off collecting Enhanced Monitoring + // metrics, specify 0 . + // + // If MonitoringRoleArn is specified, also set MonitoringInterval to a value other + // than 0 . + // + // Valid Values: 0 | 1 | 5 | 10 | 15 | 30 | 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + // Enhanced Monitoring metrics to Amazon CloudWatch Logs. An example is + // arn:aws:iam:123456789012:role/emaccess . + // + // If MonitoringInterval is set to a value other than 0 , supply a + // MonitoringRoleArn value. + MonitoringRoleArn *string + + // The network type of the DB cluster. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // Valid for: Aurora DB clusters only + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The name of the option group for the new DB cluster. + // + // DB clusters are associated with a default option group that can't be modified. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you don't specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + // + // If you specify a retention period that isn't valid, such as 94 , Amazon RDS + // issues an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the new DB cluster accepts connections. + // + // Constraints: A value from 1150-65535 . + // + // Default: The default port for the engine. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + Port *int32 + + // Specifies whether the DB cluster is publicly accessible. + // + // When the DB cluster is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB cluster's virtual + // private cloud (VPC). It resolves to the public IP address from outside of the DB + // cluster's VPC. Access to the DB cluster is ultimately controlled by the security + // group it uses. That public access is not permitted if the security group + // assigned to the DB cluster doesn't permit it. + // + // When the DB cluster isn't publicly accessible, it is an internal DB cluster + // with a DNS name that resolves to a private IP address. + // + // Default: The default behavior varies depending on whether DBSubnetGroupName is + // specified. + // + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, + // the following applies: + // + // - If the default VPC in the target Region doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the default VPC in the target Region has an internet gateway attached to + // it, the DB cluster is public. + // + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the + // following applies: + // + // - If the subnets are part of a VPC that doesn’t have an internet gateway + // attached to it, the DB cluster is private. + // + // - If the subnets are part of a VPC that has an internet gateway attached to + // it, the DB cluster is public. + // + // Valid for: Multi-AZ DB clusters only + PubliclyAccessible *bool + + // Reserved for future use. + RdsCustomClusterConfiguration *types.RdsCustomClusterConfiguration + + // The date and time to restore the DB cluster to. + // + // Valid Values: Value must be a time in Universal Coordinated Time (UTC) format + // + // Constraints: + // + // - Must be before the latest restorable time for the DB instance + // + // - Must be specified if UseLatestRestorableTime parameter isn't provided + // + // - Can't be specified if the UseLatestRestorableTime parameter is enabled + // + // - Can't be specified if the RestoreType parameter is copy-on-write + // + // Example: 2015-03-07T23:45:00Z + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + RestoreToTime *time.Time + + // The type of restore to be performed. You can specify one of the following + // values: + // + // - full-copy - The new DB cluster is restored as a full copy of the source DB + // cluster. + // + // - copy-on-write - The new DB cluster is restored as a clone of the source DB + // cluster. + // + // If you don't specify a RestoreType value, then the new DB cluster is restored + // as a full copy of the source DB cluster. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + RestoreType *string + + // For DB clusters in serverless DB engine mode, the scaling properties of the DB + // cluster. + // + // Valid for: Aurora DB clusters only + ScalingConfiguration *types.ScalingConfiguration + + // Contains the scaling configuration of an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration + + // The identifier of the source DB cluster from which to restore. + // + // Constraints: + // + // - Must match the identifier of an existing DBCluster. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + SourceDBClusterIdentifier *string + + // The resource ID of the source DB cluster from which to restore. + SourceDbClusterResourceId *string + + // Specifies the storage type to be associated with the DB cluster. + // + // When specified for a Multi-AZ DB cluster, a value for the Iops parameter is + // required. + // + // Valid Values: aurora , aurora-iopt1 (Aurora DB clusters); io1 (Multi-AZ DB + // clusters) + // + // Default: aurora (Aurora DB clusters); io1 (Multi-AZ DB clusters) + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // Specifies whether to restore the DB cluster to the latest restorable backup + // time. By default, the DB cluster isn't restored to the latest restorable backup + // time. + // + // Constraints: Can't be specified if RestoreToTime parameter is provided. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + UseLatestRestorableTime *bool + + // A list of VPC security groups that the new DB cluster belongs to. + // + // Valid for: Aurora DB clusters and Multi-AZ DB clusters + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBClusterToPointInTimeOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBClusterToPointInTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBClusterToPointInTime{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBClusterToPointInTime{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBClusterToPointInTime"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBClusterToPointInTimeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBClusterToPointInTime(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBClusterToPointInTime(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBClusterToPointInTime", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go new file mode 100644 index 00000000..cc87245e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go @@ -0,0 +1,684 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new DB instance from a DB snapshot. The target database is created +// from the source database restore point with most of the source's original +// configuration, including the default security group and DB parameter group. By +// default, the new DB instance is created as a Single-AZ deployment, except when +// the instance is a SQL Server instance that has an option group associated with +// mirroring. In this case, the instance becomes a Multi-AZ deployment, not a +// Single-AZ deployment. +// +// If you want to replace your original DB instance with the new, restored DB +// instance, then rename your original DB instance before you call the +// RestoreDBInstanceFromDBSnapshot operation. RDS doesn't allow two DB instances +// with the same name. After you have renamed your original DB instance with a +// different identifier, then you can pass the original name of the DB instance as +// the DBInstanceIdentifier in the call to the RestoreDBInstanceFromDBSnapshot +// operation. The result is that you replace the original DB instance with the DB +// instance created from the snapshot. +// +// If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier +// must be the ARN of the shared DB snapshot. +// +// To restore from a DB snapshot with an unsupported engine version, you must +// first upgrade the engine version of the snapshot. For more information about +// upgrading a RDS for MySQL DB snapshot engine version, see [Upgrading a MySQL DB snapshot engine version]. For more +// information about upgrading a RDS for PostgreSQL DB snapshot engine version, [Upgrading a PostgreSQL DB snapshot engine version]. +// +// This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, +// use RestoreDBClusterFromSnapshot . +// +// [Upgrading a PostgreSQL DB snapshot engine version]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBSnapshot.PostgreSQL.html +// [Upgrading a MySQL DB snapshot engine version]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/mysql-upgrade-snapshot.html +func (c *Client) RestoreDBInstanceFromDBSnapshot(ctx context.Context, params *RestoreDBInstanceFromDBSnapshotInput, optFns ...func(*Options)) (*RestoreDBInstanceFromDBSnapshotOutput, error) { + if params == nil { + params = &RestoreDBInstanceFromDBSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBInstanceFromDBSnapshot", params, optFns, c.addOperationRestoreDBInstanceFromDBSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBInstanceFromDBSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBInstanceFromDBSnapshotInput struct { + + // The name of the DB instance to create from the DB snapshot. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must contain from 1 to 63 numbers, letters, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: my-snapshot-id + // + // This member is required. + DBInstanceIdentifier *string + + // The amount of storage (in gibibytes) to allocate initially for the DB instance. + // Follow the allocation rules specified in CreateDBInstance. + // + // This setting isn't valid for RDS for SQL Server. + // + // Be sure to allocate enough storage for your new DB instance so that the restore + // operation can succeed. You can also allocate additional storage for future + // growth. + AllocatedStorage *int32 + + // Specifies whether to automatically apply minor version upgrades to the DB + // instance during the maintenance window. + // + // If you restore an RDS Custom DB instance, you must disable this parameter. + AutoMinorVersionUpgrade *bool + + // The Availability Zone (AZ) where the DB instance will be created. + // + // Default: A random, system-chosen Availability Zone. + // + // Constraint: You can't specify the AvailabilityZone parameter if the DB instance + // is a Multi-AZ deployment. + // + // Example: us-east-1a + AvailabilityZone *string + + // Specifies where automated backups and manual snapshots are stored for the + // restored DB instance. + // + // Possible values are outposts (Amazon Web Services Outposts) and region (Amazon + // Web Services Region). The default is region . + // + // For more information, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + BackupTarget *string + + // The CA certificate identifier to use for the DB instance's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // Specifies whether to copy all tags from the restored DB instance to snapshots + // of the DB instance. + // + // In most cases, tags aren't copied by default. However, when you restore a DB + // instance from a DB snapshot, RDS checks whether you specify new tags. If yes, + // the new tags are added to the restored DB instance. If there are no new tags, + // RDS looks for the tags from the source DB instance for the DB snapshot, and then + // adds those tags to the restored DB instance. + // + // For more information, see [Copying tags to DB instance snapshots] in the Amazon RDS User Guide. + // + // [Copying tags to DB instance snapshots]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.CopyTags + CopyTagsToSnapshot *bool + + // The instance profile associated with the underlying Amazon EC2 instance of an + // RDS Custom DB instance. The instance profile must meet the following + // requirements: + // + // - The profile must exist in your account. + // + // - The profile must have an IAM role that Amazon EC2 has permissions to assume. + // + // - The instance profile name and the associated IAM role name must start with + // the prefix AWSRDSCustom . + // + // For the list of permissions required for the IAM role, see [Configure IAM and your VPC] in the Amazon RDS + // User Guide. + // + // This setting is required for RDS Custom. + // + // [Configure IAM and your VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc + CustomIamInstanceProfile *string + + // The identifier for the Multi-AZ DB cluster snapshot to restore from. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ DB cluster deployments] in the Amazon RDS User Guide. + // + // Constraints: + // + // - Must match the identifier of an existing Multi-AZ DB cluster snapshot. + // + // - Can't be specified when DBSnapshotIdentifier is specified. + // + // - Must be specified when DBSnapshotIdentifier isn't specified. + // + // - If you are restoring from a shared manual Multi-AZ DB cluster snapshot, the + // DBClusterSnapshotIdentifier must be the ARN of the shared snapshot. + // + // - Can't be the identifier of an Aurora DB cluster snapshot. + // + // [Multi-AZ DB cluster deployments]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + DBClusterSnapshotIdentifier *string + + // The compute and memory capacity of the Amazon RDS DB instance, for example + // db.m4.large. Not all DB instance classes are available in all Amazon Web + // Services Regions, or for all database engines. For the full list of DB instance + // classes, and availability for your engine, see [DB Instance Class]in the Amazon RDS User Guide. + // + // Default: The same DBInstanceClass as the original DB instance. + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBInstanceClass *string + + // The name of the database for the restored DB instance. + // + // This parameter only applies to RDS for Oracle and RDS for SQL Server DB + // instances. It doesn't apply to the other engines or to RDS Custom DB instances. + DBName *string + + // The name of the DB parameter group to associate with this DB instance. + // + // If you don't specify a value for DBParameterGroupName , then RDS uses the + // default DBParameterGroup for the specified DB engine. + // + // This setting doesn't apply to RDS Custom. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB parameter group. + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + DBParameterGroupName *string + + // The identifier for the DB snapshot to restore from. + // + // Constraints: + // + // - Must match the identifier of an existing DB snapshot. + // + // - Can't be specified when DBClusterSnapshotIdentifier is specified. + // + // - Must be specified when DBClusterSnapshotIdentifier isn't specified. + // + // - If you are restoring from a shared manual DB snapshot, the + // DBSnapshotIdentifier must be the ARN of the shared DB snapshot. + DBSnapshotIdentifier *string + + // The name of the DB subnet group to use for the new instance. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB subnet group. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + + // Specifies whether to enable deletion protection for the DB instance. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The Active Directory directory ID to restore the DB instance in. The domain/ + // must be created prior to this operation. Currently, you can create only Db2, + // MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances in an Active + // Directory Domain. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom. + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The ARN for the Secrets Manager secret with the credentials for the user + // joining the domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: + // arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 + DomainAuthSecretArn *string + + // The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + // controllers. + // + // Constraints: + // + // - Two IP addresses must be provided. If there isn't a secondary domain + // controller, use the IP address of the primary domain controller for both entries + // in the list. + // + // Example: 123.124.125.126,234.235.236.237 + DomainDnsIps []string + + // The fully qualified domain name (FQDN) of an Active Directory domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: mymanagedADtest.mymanagedAD.mydomain + DomainFqdn *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // This setting doesn't apply to RDS Custom DB instances. + DomainIAMRoleName *string + + // The Active Directory organizational unit for your DB instance to join. + // + // Constraints: + // + // - Must be in the distinguished name format. + // + // - Can't be longer than 64 characters. + // + // Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain + DomainOu *string + + // The list of logs for the restored DB instance to export to CloudWatch Logs. The + // values in the list depend on the DB engine. For more information, see [Publishing Database Logs to Amazon CloudWatch Logs]in the + // Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts DB instance. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the DB instance from outside of its virtual + // private cloud (VPC) on your local network. + // + // This setting doesn't apply to RDS Custom. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + EnableCustomerOwnedIp *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping is disabled. + // + // For more information about IAM database authentication, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS + // User Guide. + // + // This setting doesn't apply to RDS Custom. + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // The database engine to use for the new instance. + // + // This setting doesn't apply to RDS Custom. + // + // Default: The same as source + // + // Constraint: Must be compatible with the engine of the source. For example, you + // can restore a MariaDB 10.1 DB instance from a MySQL 5.6 snapshot. + // + // Valid Values: + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + Engine *string + + // The life cycle type for this DB instance. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB instance into Amazon RDS Extended Support. At the end of + // standard support, you can avoid charges for Extended Support by setting the + // value to open-source-rds-extended-support-disabled . In this case, RDS + // automatically upgrades your restored DB instance to a higher engine version, if + // the major engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB instance into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB instance past the end of standard support for that engine + // version. For more information, see [Using Amazon RDS Extended Support]in the Amazon RDS User Guide. + // + // This setting applies only to RDS for MySQL and RDS for PostgreSQL. For Amazon + // Aurora DB instances, the life cycle type is managed by the DB cluster. + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // Specifies the amount of provisioned IOPS for the DB instance, expressed in I/O + // operations per second. If this parameter isn't specified, the IOPS value is + // taken from the backup. If this parameter is set to 0, the new instance is + // converted to a non-PIOPS instance. The conversion takes additional time, though + // your DB instance is available for connections before the conversion starts. + // + // The provisioned IOPS value must follow the requirements for your database + // engine. For more information, see [Amazon RDS Provisioned IOPS storage]in the Amazon RDS User Guide. + // + // Constraints: Must be an integer greater than 1000. + // + // [Amazon RDS Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // License model information for the restored DB instance. + // + // License models for RDS for Db2 require additional configuration. The Bring Your + // Own License (BYOL) model requires a custom parameter group and an Amazon Web + // Services License Manager self-managed license. The Db2 license through Amazon + // Web Services Marketplace model requires an Amazon Web Services Marketplace + // subscription. For more information, see [Amazon RDS for Db2 licensing options]in the Amazon RDS User Guide. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + // + // Valid Values: + // + // - RDS for Db2 - bring-your-own-license | marketplace-license + // + // - RDS for MariaDB - general-public-license + // + // - RDS for Microsoft SQL Server - license-included + // + // - RDS for MySQL - general-public-license + // + // - RDS for Oracle - bring-your-own-license | license-included + // + // - RDS for PostgreSQL - postgresql-license + // + // Default: Same as the source. + // + // [Amazon RDS for Db2 licensing options]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html + LicenseModel *string + + // Specifies whether the DB instance is a Multi-AZ deployment. + // + // This setting doesn't apply to RDS Custom. + // + // Constraint: You can't specify the AvailabilityZone parameter if the DB instance + // is a Multi-AZ deployment. + MultiAZ *bool + + // The network type of the DB instance. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The name of the option group to be used for the restored DB instance. + // + // Permanent options, such as the TDE option for Oracle Advanced Security TDE, + // can't be removed from an option group, and that option group can't be removed + // from a DB instance after it is associated with a DB instance. + // + // This setting doesn't apply to RDS Custom. + OptionGroupName *string + + // The port number on which the database accepts connections. + // + // Default: The same port as the original DB instance + // + // Constraints: Value must be 1150-65535 + Port *int32 + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + // + // This setting doesn't apply to RDS Custom. + ProcessorFeatures []types.ProcessorFeature + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB instance is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB instance's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB instance's VPC. Access to the DB instance is ultimately controlled by + // the security group it uses. That public access is not permitted if the security + // group assigned to the DB instance doesn't permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBInstance. + PubliclyAccessible *bool + + // Specifies the storage throughput value for the DB instance. + // + // This setting doesn't apply to RDS Custom or Amazon Aurora. + StorageThroughput *int32 + + // Specifies the storage type to be associated with the DB instance. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // If you specify io1 , io2 , or gp3 , you must also include a value for the Iops + // parameter. + // + // Default: io1 if the Iops parameter is specified, otherwise gp2 + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The ARN from the key store with which to associate the instance for TDE + // encryption. + // + // This setting doesn't apply to RDS Custom. + TdeCredentialArn *string + + // The password for the given ARN from the key store in order to access the device. + // + // This setting doesn't apply to RDS Custom. + TdeCredentialPassword *string + + // Specifies whether the DB instance class of the DB instance uses its default + // processor features. + // + // This setting doesn't apply to RDS Custom. + UseDefaultProcessorFeatures *bool + + // A list of EC2 VPC security groups to associate with this DB instance. + // + // Default: The default EC2 VPC security group for the DB subnet group's VPC. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBInstanceFromDBSnapshotOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBInstanceFromDBSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBInstanceFromDBSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBInstanceFromDBSnapshot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBInstanceFromDBSnapshot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBInstanceFromDBSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBInstanceFromDBSnapshot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBInstanceFromDBSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBInstanceFromDBSnapshot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromS3.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromS3.go new file mode 100644 index 00000000..f85ff8a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceFromS3.go @@ -0,0 +1,655 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Amazon Relational Database Service (Amazon RDS) supports importing MySQL +// databases by using backup files. You can create a backup of your on-premises +// database, store it on Amazon Simple Storage Service (Amazon S3), and then +// restore the backup file onto a new Amazon RDS DB instance running MySQL. For +// more information, see [Importing Data into an Amazon RDS MySQL DB Instance]in the Amazon RDS User Guide. +// +// This operation doesn't apply to RDS Custom. +// +// [Importing Data into an Amazon RDS MySQL DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html +func (c *Client) RestoreDBInstanceFromS3(ctx context.Context, params *RestoreDBInstanceFromS3Input, optFns ...func(*Options)) (*RestoreDBInstanceFromS3Output, error) { + if params == nil { + params = &RestoreDBInstanceFromS3Input{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBInstanceFromS3", params, optFns, c.addOperationRestoreDBInstanceFromS3Middlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBInstanceFromS3Output) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBInstanceFromS3Input struct { + + // The compute and memory capacity of the DB instance, for example db.m4.large. + // Not all DB instance classes are available in all Amazon Web Services Regions, or + // for all database engines. For the full list of DB instance classes, and + // availability for your engine, see [DB Instance Class]in the Amazon RDS User Guide. + // + // Importing from Amazon S3 isn't supported on the db.t2.micro DB instance class. + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + // + // This member is required. + DBInstanceClass *string + + // The DB instance identifier. This parameter is stored as a lowercase string. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // Example: mydbinstance + // + // This member is required. + DBInstanceIdentifier *string + + // The name of the database engine to be used for this instance. + // + // Valid Values: mysql + // + // This member is required. + Engine *string + + // The name of your Amazon S3 bucket that contains your database backup file. + // + // This member is required. + S3BucketName *string + + // An Amazon Web Services Identity and Access Management (IAM) role with a trust + // policy and a permissions policy that allows Amazon RDS to access your Amazon S3 + // bucket. For information about this role, see [Creating an IAM role manually]in the Amazon RDS User Guide. + // + // [Creating an IAM role manually]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html#MySQL.Procedural.Importing.Enabling.IAM + // + // This member is required. + S3IngestionRoleArn *string + + // The name of the engine of your source database. + // + // Valid Values: mysql + // + // This member is required. + SourceEngine *string + + // The version of the database that the backup files were created from. + // + // MySQL versions 5.6 and 5.7 are supported. + // + // Example: 5.6.40 + // + // This member is required. + SourceEngineVersion *string + + // The amount of storage (in gibibytes) to allocate initially for the DB instance. + // Follow the allocation rules specified in CreateDBInstance . + // + // This setting isn't valid for RDS for SQL Server. + // + // Be sure to allocate enough storage for your new DB instance so that the restore + // operation can succeed. You can also allocate additional storage for future + // growth. + AllocatedStorage *int32 + + // Specifies whether to automatically apply minor engine upgrades to the DB + // instance during the maintenance window. By default, minor engine upgrades are + // not applied automatically. + AutoMinorVersionUpgrade *bool + + // The Availability Zone that the DB instance is created in. For information about + // Amazon Web Services Regions and Availability Zones, see [Regions and Availability Zones]in the Amazon RDS User + // Guide. + // + // Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web + // Services Region. + // + // Example: us-east-1d + // + // Constraint: The AvailabilityZone parameter can't be specified if the DB + // instance is a Multi-AZ deployment. The specified Availability Zone must be in + // the same Amazon Web Services Region as the current endpoint. + // + // [Regions and Availability Zones]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html + AvailabilityZone *string + + // The number of days for which automated backups are retained. Setting this + // parameter to a positive number enables backups. For more information, see + // CreateDBInstance . + BackupRetentionPeriod *int32 + + // The CA certificate identifier to use for the DB instance's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // Specifies whether to copy all tags from the DB instance to snapshots of the DB + // instance. By default, tags are not copied. + CopyTagsToSnapshot *bool + + // The name of the database to create when the DB instance is created. Follow the + // naming rules specified in CreateDBInstance . + DBName *string + + // The name of the DB parameter group to associate with this DB instance. + // + // If you do not specify a value for DBParameterGroupName , then the default + // DBParameterGroup for the specified DB engine is used. + DBParameterGroupName *string + + // A list of DB security groups to associate with this DB instance. + // + // Default: The default DB security group for the database engine. + DBSecurityGroups []string + + // A DB subnet group to associate with this DB instance. + // + // Constraints: If supplied, must match the name of an existing DBSubnetGroup. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // Specifies the mode of Database Insights to enable for the DB instance. + // + // This setting only applies to Amazon Aurora DB instances. + // + // Currently, this value is inherited from the DB cluster and can't be changed. + DatabaseInsightsMode types.DatabaseInsightsMode + + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + + // Specifies whether to enable deletion protection for the DB instance. The + // database can't be deleted when deletion protection is enabled. By default, + // deletion protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The list of logs that the restored DB instance is to export to CloudWatch Logs. + // The values in the list depend on the DB engine being used. For more information, + // see [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon RDS User Guide. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // For more information about IAM database authentication, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS + // User Guide. + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // Specifies whether to enable Performance Insights for the DB instance. + // + // For more information, see [Using Amazon Performance Insights] in the Amazon RDS User Guide. + // + // [Using Amazon Performance Insights]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html + EnablePerformanceInsights *bool + + // The life cycle type for this DB instance. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB instance into Amazon RDS Extended Support. At the end of + // standard support, you can avoid charges for Extended Support by setting the + // value to open-source-rds-extended-support-disabled . In this case, RDS + // automatically upgrades your restored DB instance to a higher engine version, if + // the major engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB instance into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB instance past the end of standard support for that engine + // version. For more information, see [Using Amazon RDS Extended Support]in the Amazon RDS User Guide. + // + // This setting applies only to RDS for MySQL and RDS for PostgreSQL. For Amazon + // Aurora DB instances, the life cycle type is managed by the DB cluster. + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The version number of the database engine to use. Choose the latest minor + // version of your database engine. For information about engine versions, see + // CreateDBInstance , or call DescribeDBEngineVersions . + EngineVersion *string + + // The amount of Provisioned IOPS (input/output operations per second) to allocate + // initially for the DB instance. For information about valid IOPS values, see [Amazon RDS Provisioned IOPS storage]in + // the Amazon RDS User Guide. + // + // [Amazon RDS Provisioned IOPS storage]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS + Iops *int32 + + // The Amazon Web Services KMS key identifier for an encrypted DB instance. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If the StorageEncrypted parameter is enabled, and you do not specify a value + // for the KmsKeyId parameter, then Amazon RDS will use your default KMS key. + // There is a default KMS key for your Amazon Web Services account. Your Amazon Web + // Services account has a different default KMS key for each Amazon Web Services + // Region. + KmsKeyId *string + + // The license model for this DB instance. Use general-public-license . + LicenseModel *string + + // Specifies whether to manage the master user password with Amazon Web Services + // Secrets Manager. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide. + // + // Constraints: + // + // - Can't manage the master user password with Amazon Web Services Secrets + // Manager if MasterUserPassword is specified. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html + ManageMasterUserPassword *bool + + // The password for the master user. + // + // Constraints: + // + // - Can't be specified if ManageMasterUserPassword is turned on. + // + // - Can include any printable ASCII character except "/", """, or "@". For RDS + // for Oracle, can't include the "&" (ampersand) or the "'" (single quotes) + // character. + // + // Length Constraints: + // + // - RDS for Db2 - Must contain from 8 to 128 characters. + // + // - RDS for MariaDB - Must contain from 8 to 41 characters. + // + // - RDS for Microsoft SQL Server - Must contain from 8 to 128 characters. + // + // - RDS for MySQL - Must contain from 8 to 41 characters. + // + // - RDS for Oracle - Must contain from 8 to 30 characters. + // + // - RDS for PostgreSQL - Must contain from 8 to 128 characters. + MasterUserPassword *string + + // The Amazon Web Services KMS key identifier to encrypt a secret that is + // automatically generated and managed in Amazon Web Services Secrets Manager. + // + // This setting is valid only if the master user password is managed by RDS in + // Amazon Web Services Secrets Manager for the DB instance. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. To use a KMS key in a different Amazon Web + // Services account, specify the key ARN or alias ARN. + // + // If you don't specify MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS + // key is used to encrypt the secret. If the secret is in a different Amazon Web + // Services account, then you can't use the aws/secretsmanager KMS key to encrypt + // the secret, and you must use a customer managed KMS key. + // + // There is a default KMS key for your Amazon Web Services account. Your Amazon + // Web Services account has a different default KMS key for each Amazon Web + // Services Region. + MasterUserSecretKmsKeyId *string + + // The name for the master user. + // + // Constraints: + // + // - Must be 1 to 16 letters or numbers. + // + // - First character must be a letter. + // + // - Can't be a reserved word for the chosen database engine. + MasterUsername *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + // + // For more information about this setting, including limitations that apply to + // it, see [Managing capacity automatically with Amazon RDS storage autoscaling]in the Amazon RDS User Guide. + // + // [Managing capacity automatically with Amazon RDS storage autoscaling]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling + MaxAllocatedStorage *int32 + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB instance. To disable collecting Enhanced Monitoring + // metrics, specify 0. + // + // If MonitoringRoleArn is specified, then you must also set MonitoringInterval to + // a value other than 0. + // + // Valid Values: 0, 1, 5, 10, 15, 30, 60 + // + // Default: 0 + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send enhanced monitoring metrics + // to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess . + // For information on creating a monitoring role, see [Setting Up and Enabling Enhanced Monitoring]in the Amazon RDS User + // Guide. + // + // If MonitoringInterval is set to a value other than 0, then you must supply a + // MonitoringRoleArn value. + // + // [Setting Up and Enabling Enhanced Monitoring]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.OS.html#USER_Monitoring.OS.Enabling + MonitoringRoleArn *string + + // Specifies whether the DB instance is a Multi-AZ deployment. If the DB instance + // is a Multi-AZ deployment, you can't set the AvailabilityZone parameter. + MultiAZ *bool + + // The network type of the DB instance. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The name of the option group to associate with this DB instance. If this + // argument is omitted, the default option group for the specified engine is used. + OptionGroupName *string + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // If you do not specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS + // uses your default KMS key. There is a default KMS key for your Amazon Web + // Services account. Your Amazon Web Services account has a different default KMS + // key for each Amazon Web Services Region. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. The default is 7 days. + // The following values are valid: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23 + // + // - 731 + // + // For example, the following values are valid: + // + // - 93 (3 months * 31) + // + // - 341 (11 months * 31) + // + // - 589 (19 months * 31) + // + // - 731 + // + // If you specify a retention period such as 94, which isn't a valid value, RDS + // issues an error. + PerformanceInsightsRetentionPeriod *int32 + + // The port number on which the database accepts connections. + // + // Type: Integer + // + // Valid Values: 1150 - 65535 + // + // Default: 3306 + Port *int32 + + // The time range each day during which automated backups are created if automated + // backups are enabled. For more information, see [Backup window]in the Amazon RDS User Guide. + // + // Constraints: + // + // - Must be in the format hh24:mi-hh24:mi . + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred maintenance window. + // + // - Must be at least 30 minutes. + // + // [Backup window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow + PreferredBackupWindow *string + + // The time range each week during which system maintenance can occur, in + // Universal Coordinated Time (UTC). For more information, see [Amazon RDS Maintenance Window]in the Amazon RDS + // User Guide. + // + // Constraints: + // + // - Must be in the format ddd:hh24:mi-ddd:hh24:mi . + // + // - Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. + // + // - Must be in Universal Coordinated Time (UTC). + // + // - Must not conflict with the preferred backup window. + // + // - Must be at least 30 minutes. + // + // [Amazon RDS Maintenance Window]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance + PreferredMaintenanceWindow *string + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + ProcessorFeatures []types.ProcessorFeature + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB instance is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB instance's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB instance's VPC. Access to the DB instance is ultimately controlled by + // the security group it uses. That public access is not permitted if the security + // group assigned to the DB instance doesn't permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBInstance. + PubliclyAccessible *bool + + // The prefix of your Amazon S3 bucket. + S3Prefix *string + + // Specifies whether the new DB instance is encrypted or not. + StorageEncrypted *bool + + // Specifies the storage throughput value for the DB instance. + // + // This setting doesn't apply to RDS Custom or Amazon Aurora. + StorageThroughput *int32 + + // Specifies the storage type to be associated with the DB instance. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // If you specify io1 , io2 , or gp3 , you must also include a value for the Iops + // parameter. + // + // Default: io1 if the Iops parameter is specified; otherwise gp2 + StorageType *string + + // A list of tags to associate with this DB instance. For more information, see [Tagging Amazon RDS Resources] + // in the Amazon RDS User Guide. + // + // [Tagging Amazon RDS Resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + Tags []types.Tag + + // Specifies whether the DB instance class of the DB instance uses its default + // processor features. + UseDefaultProcessorFeatures *bool + + // A list of VPC security groups to associate with this DB instance. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBInstanceFromS3Output struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBInstanceFromS3Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBInstanceFromS3{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBInstanceFromS3{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBInstanceFromS3"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBInstanceFromS3ValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBInstanceFromS3(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBInstanceFromS3(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBInstanceFromS3", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceToPointInTime.go new file mode 100644 index 00000000..ca702f56 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -0,0 +1,690 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Restores a DB instance to an arbitrary point in time. You can restore to any +// point in time before the time identified by the LatestRestorableTime property. +// You can restore to a point up to the number of days specified by the +// BackupRetentionPeriod property. +// +// The target database is created with most of the original configuration, but in +// a system-selected Availability Zone, with the default security group, the +// default subnet group, and the default DB parameter group. By default, the new DB +// instance is created as a single-AZ deployment except when the instance is a SQL +// Server instance that has an option group that is associated with mirroring; in +// this case, the instance becomes a mirrored deployment and not a single-AZ +// deployment. +// +// This operation doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, +// use RestoreDBClusterToPointInTime . +func (c *Client) RestoreDBInstanceToPointInTime(ctx context.Context, params *RestoreDBInstanceToPointInTimeInput, optFns ...func(*Options)) (*RestoreDBInstanceToPointInTimeOutput, error) { + if params == nil { + params = &RestoreDBInstanceToPointInTimeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreDBInstanceToPointInTime", params, optFns, c.addOperationRestoreDBInstanceToPointInTimeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreDBInstanceToPointInTimeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreDBInstanceToPointInTimeInput struct { + + // The name of the new DB instance to create. + // + // Constraints: + // + // - Must contain from 1 to 63 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + // + // This member is required. + TargetDBInstanceIdentifier *string + + // The amount of storage (in gibibytes) to allocate initially for the DB instance. + // Follow the allocation rules specified in CreateDBInstance . + // + // This setting isn't valid for RDS for SQL Server. + // + // Be sure to allocate enough storage for your new DB instance so that the restore + // operation can succeed. You can also allocate additional storage for future + // growth. + AllocatedStorage *int32 + + // Specifies whether minor version upgrades are applied automatically to the DB + // instance during the maintenance window. + // + // This setting doesn't apply to RDS Custom. + AutoMinorVersionUpgrade *bool + + // The Availability Zone (AZ) where the DB instance will be created. + // + // Default: A random, system-chosen Availability Zone. + // + // Constraints: + // + // - You can't specify the AvailabilityZone parameter if the DB instance is a + // Multi-AZ deployment. + // + // Example: us-east-1a + AvailabilityZone *string + + // The location for storing automated backups and manual snapshots for the + // restored DB instance. + // + // Valid Values: + // + // - outposts (Amazon Web Services Outposts) + // + // - region (Amazon Web Services Region) + // + // Default: region + // + // For more information, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + BackupTarget *string + + // The CA certificate identifier to use for the DB instance's server certificate. + // + // This setting doesn't apply to RDS Custom DB instances. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // Specifies whether to copy all tags from the restored DB instance to snapshots + // of the DB instance. By default, tags are not copied. + CopyTagsToSnapshot *bool + + // The instance profile associated with the underlying Amazon EC2 instance of an + // RDS Custom DB instance. The instance profile must meet the following + // requirements: + // + // - The profile must exist in your account. + // + // - The profile must have an IAM role that Amazon EC2 has permissions to assume. + // + // - The instance profile name and the associated IAM role name must start with + // the prefix AWSRDSCustom . + // + // For the list of permissions required for the IAM role, see [Configure IAM and your VPC] in the Amazon RDS + // User Guide. + // + // This setting is required for RDS Custom. + // + // [Configure IAM and your VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc + CustomIamInstanceProfile *string + + // The compute and memory capacity of the Amazon RDS DB instance, for example + // db.m4.large. Not all DB instance classes are available in all Amazon Web + // Services Regions, or for all database engines. For the full list of DB instance + // classes, and availability for your engine, see [DB Instance Class]in the Amazon RDS User Guide. + // + // Default: The same DB instance class as the original DB instance. + // + // [DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html + DBInstanceClass *string + + // The database name for the restored DB instance. + // + // This parameter doesn't apply to the following DB instances: + // + // - RDS Custom + // + // - RDS for Db2 + // + // - RDS for MariaDB + // + // - RDS for MySQL + DBName *string + + // The name of the DB parameter group to associate with this DB instance. + // + // If you do not specify a value for DBParameterGroupName , then the default + // DBParameterGroup for the specified DB engine is used. + // + // This setting doesn't apply to RDS Custom. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB parameter group. + // + // - Must be 1 to 255 letters, numbers, or hyphens. + // + // - First character must be a letter. + // + // - Can't end with a hyphen or contain two consecutive hyphens. + DBParameterGroupName *string + + // The DB subnet group name to use for the new instance. + // + // Constraints: + // + // - If supplied, must match the name of an existing DB subnet group. + // + // Example: mydbsubnetgroup + DBSubnetGroupName *string + + // Specifies whether to enable a dedicated log volume (DLV) for the DB instance. + DedicatedLogVolume *bool + + // Specifies whether the DB instance has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. By default, deletion + // protection isn't enabled. For more information, see [Deleting a DB Instance]. + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The Active Directory directory ID to restore the DB instance in. Create the + // domain before running this command. Currently, you can create only the MySQL, + // Microsoft SQL Server, Oracle, and PostgreSQL DB instances in an Active Directory + // Domain. + // + // This setting doesn't apply to RDS Custom. + // + // For more information, see [Kerberos Authentication] in the Amazon RDS User Guide. + // + // [Kerberos Authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html + Domain *string + + // The ARN for the Secrets Manager secret with the credentials for the user + // joining the domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: + // arn:aws:secretsmanager:region:account-number:secret:myselfmanagedADtestsecret-123456 + DomainAuthSecretArn *string + + // The IPv4 DNS IP addresses of your primary and secondary Active Directory domain + // controllers. + // + // Constraints: + // + // - Two IP addresses must be provided. If there isn't a secondary domain + // controller, use the IP address of the primary domain controller for both entries + // in the list. + // + // Example: 123.124.125.126,234.235.236.237 + DomainDnsIps []string + + // The fully qualified domain name (FQDN) of an Active Directory domain. + // + // Constraints: + // + // - Can't be longer than 64 characters. + // + // Example: mymanagedADtest.mymanagedAD.mydomain + DomainFqdn *string + + // The name of the IAM role to use when making API calls to the Directory Service. + // + // This setting doesn't apply to RDS Custom DB instances. + DomainIAMRoleName *string + + // The Active Directory organizational unit for your DB instance to join. + // + // Constraints: + // + // - Must be in the distinguished name format. + // + // - Can't be longer than 64 characters. + // + // Example: OU=mymanagedADtestOU,DC=mymanagedADtest,DC=mymanagedAD,DC=mydomain + DomainOu *string + + // The list of logs that the restored DB instance is to export to CloudWatch Logs. + // The values in the list depend on the DB engine being used. For more information, + // see [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom. + // + // [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch + EnableCloudwatchLogsExports []string + + // Specifies whether to enable a customer-owned IP address (CoIP) for an RDS on + // Outposts DB instance. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the DB instance from outside of its virtual + // private cloud (VPC) on your local network. + // + // This setting doesn't apply to RDS Custom. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + EnableCustomerOwnedIp *bool + + // Specifies whether to enable mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts. By default, mapping isn't + // enabled. + // + // This setting doesn't apply to RDS Custom. + // + // For more information about IAM database authentication, see [IAM Database Authentication for MySQL and PostgreSQL] in the Amazon RDS + // User Guide. + // + // [IAM Database Authentication for MySQL and PostgreSQL]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html + EnableIAMDatabaseAuthentication *bool + + // The database engine to use for the new instance. + // + // This setting doesn't apply to RDS Custom. + // + // Valid Values: + // + // - db2-ae + // + // - db2-se + // + // - mariadb + // + // - mysql + // + // - oracle-ee + // + // - oracle-ee-cdb + // + // - oracle-se2 + // + // - oracle-se2-cdb + // + // - postgres + // + // - sqlserver-ee + // + // - sqlserver-se + // + // - sqlserver-ex + // + // - sqlserver-web + // + // Default: The same as source + // + // Constraints: + // + // - Must be compatible with the engine of the source. + Engine *string + + // The life cycle type for this DB instance. + // + // By default, this value is set to open-source-rds-extended-support , which + // enrolls your DB instance into Amazon RDS Extended Support. At the end of + // standard support, you can avoid charges for Extended Support by setting the + // value to open-source-rds-extended-support-disabled . In this case, RDS + // automatically upgrades your restored DB instance to a higher engine version, if + // the major engine version is past its end of standard support date. + // + // You can use this setting to enroll your DB instance into Amazon RDS Extended + // Support. With RDS Extended Support, you can run the selected major engine + // version on your DB instance past the end of standard support for that engine + // version. For more information, see [Using Amazon RDS Extended Support]in the Amazon RDS User Guide. + // + // This setting applies only to RDS for MySQL and RDS for PostgreSQL. For Amazon + // Aurora DB instances, the life cycle type is managed by the DB cluster. + // + // Valid Values: open-source-rds-extended-support | + // open-source-rds-extended-support-disabled + // + // Default: open-source-rds-extended-support + // + // [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html + EngineLifecycleSupport *string + + // The amount of Provisioned IOPS (input/output operations per second) to + // initially allocate for the DB instance. + // + // This setting doesn't apply to SQL Server. + // + // Constraints: + // + // - Must be an integer greater than 1000. + Iops *int32 + + // The license model information for the restored DB instance. + // + // License models for RDS for Db2 require additional configuration. The Bring Your + // Own License (BYOL) model requires a custom parameter group and an Amazon Web + // Services License Manager self-managed license. The Db2 license through Amazon + // Web Services Marketplace model requires an Amazon Web Services Marketplace + // subscription. For more information, see [Amazon RDS for Db2 licensing options]in the Amazon RDS User Guide. + // + // This setting doesn't apply to Amazon Aurora or RDS Custom DB instances. + // + // Valid Values: + // + // - RDS for Db2 - bring-your-own-license | marketplace-license + // + // - RDS for MariaDB - general-public-license + // + // - RDS for Microsoft SQL Server - license-included + // + // - RDS for MySQL - general-public-license + // + // - RDS for Oracle - bring-your-own-license | license-included + // + // - RDS for PostgreSQL - postgresql-license + // + // Default: Same as the source. + // + // [Amazon RDS for Db2 licensing options]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/db2-licensing.html + LicenseModel *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + // + // For more information about this setting, including limitations that apply to + // it, see [Managing capacity automatically with Amazon RDS storage autoscaling]in the Amazon RDS User Guide. + // + // This setting doesn't apply to RDS Custom. + // + // [Managing capacity automatically with Amazon RDS storage autoscaling]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling + MaxAllocatedStorage *int32 + + // Secifies whether the DB instance is a Multi-AZ deployment. + // + // This setting doesn't apply to RDS Custom. + // + // Constraints: + // + // - You can't specify the AvailabilityZone parameter if the DB instance is a + // Multi-AZ deployment. + MultiAZ *bool + + // The network type of the DB instance. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // Valid Values: + // + // - IPV4 + // + // - DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The name of the option group to use for the restored DB instance. + // + // Permanent options, such as the TDE option for Oracle Advanced Security TDE, + // can't be removed from an option group, and that option group can't be removed + // from a DB instance after it is associated with a DB instance + // + // This setting doesn't apply to RDS Custom. + OptionGroupName *string + + // The port number on which the database accepts connections. + // + // Default: The same port as the original DB instance. + // + // Constraints: + // + // - The value must be 1150-65535 . + Port *int32 + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + // + // This setting doesn't apply to RDS Custom. + ProcessorFeatures []types.ProcessorFeature + + // Specifies whether the DB instance is publicly accessible. + // + // When the DB cluster is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB cluster's virtual + // private cloud (VPC). It resolves to the public IP address from outside of the DB + // cluster's VPC. Access to the DB cluster is ultimately controlled by the security + // group it uses. That public access isn't permitted if the security group assigned + // to the DB cluster doesn't permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBInstance. + PubliclyAccessible *bool + + // The date and time to restore from. + // + // Constraints: + // + // - Must be a time in Universal Coordinated Time (UTC) format. + // + // - Must be before the latest restorable time for the DB instance. + // + // - Can't be specified if the UseLatestRestorableTime parameter is enabled. + // + // Example: 2009-09-07T23:45:00Z + RestoreTime *time.Time + + // The Amazon Resource Name (ARN) of the replicated automated backups from which + // to restore, for example, + // arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE . + // + // This setting doesn't apply to RDS Custom. + SourceDBInstanceAutomatedBackupsArn *string + + // The identifier of the source DB instance from which to restore. + // + // Constraints: + // + // - Must match the identifier of an existing DB instance. + SourceDBInstanceIdentifier *string + + // The resource ID of the source DB instance from which to restore. + SourceDbiResourceId *string + + // The storage throughput value for the DB instance. + // + // This setting doesn't apply to RDS Custom or Amazon Aurora. + StorageThroughput *int32 + + // The storage type to associate with the DB instance. + // + // Valid Values: gp2 | gp3 | io1 | io2 | standard + // + // Default: io1 , if the Iops parameter is specified. Otherwise, gp2 . + // + // Constraints: + // + // - If you specify io1 , io2 , or gp3 , you must also include a value for the + // Iops parameter. + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []types.Tag + + // The ARN from the key store with which to associate the instance for TDE + // encryption. + // + // This setting doesn't apply to RDS Custom. + TdeCredentialArn *string + + // The password for the given ARN from the key store in order to access the device. + // + // This setting doesn't apply to RDS Custom. + TdeCredentialPassword *string + + // Specifies whether the DB instance class of the DB instance uses its default + // processor features. + // + // This setting doesn't apply to RDS Custom. + UseDefaultProcessorFeatures *bool + + // Specifies whether the DB instance is restored from the latest backup time. By + // default, the DB instance isn't restored from the latest backup time. + // + // Constraints: + // + // - Can't be specified if the RestoreTime parameter is provided. + UseLatestRestorableTime *bool + + // A list of EC2 VPC security groups to associate with this DB instance. + // + // Default: The default EC2 VPC security group for the DB subnet group's VPC. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type RestoreDBInstanceToPointInTimeOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreDBInstanceToPointInTimeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRestoreDBInstanceToPointInTime{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRestoreDBInstanceToPointInTime{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreDBInstanceToPointInTime"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRestoreDBInstanceToPointInTimeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreDBInstanceToPointInTime(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreDBInstanceToPointInTime(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RestoreDBInstanceToPointInTime", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RevokeDBSecurityGroupIngress.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RevokeDBSecurityGroupIngress.go new file mode 100644 index 00000000..f38f8760 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_RevokeDBSecurityGroupIngress.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or +// EC2 or VPC security groups. Required parameters for this API are one of CIDRIP, +// EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either +// EC2SecurityGroupName or EC2SecurityGroupId). +// +// EC2-Classic was retired on August 15, 2022. If you haven't migrated from +// EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For +// more information, see [Migrate from EC2-Classic to a VPC]in the Amazon EC2 User Guide, the blog [EC2-Classic Networking is Retiring – Here’s How to Prepare], and [Moving a DB instance not in a VPC into a VPC] in the +// Amazon RDS User Guide. +// +// [Migrate from EC2-Classic to a VPC]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html +// [EC2-Classic Networking is Retiring – Here’s How to Prepare]: http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/ +// [Moving a DB instance not in a VPC into a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html +func (c *Client) RevokeDBSecurityGroupIngress(ctx context.Context, params *RevokeDBSecurityGroupIngressInput, optFns ...func(*Options)) (*RevokeDBSecurityGroupIngressOutput, error) { + if params == nil { + params = &RevokeDBSecurityGroupIngressInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RevokeDBSecurityGroupIngress", params, optFns, c.addOperationRevokeDBSecurityGroupIngressMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RevokeDBSecurityGroupIngressOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RevokeDBSecurityGroupIngressInput struct { + + // The name of the DB security group to revoke ingress from. + // + // This member is required. + DBSecurityGroupName *string + + // The IP range to revoke access from. Must be a valid CIDR range. If CIDRIP is + // specified, EC2SecurityGroupName , EC2SecurityGroupId and EC2SecurityGroupOwnerId + // can't be provided. + CIDRIP *string + + // The id of the EC2 security group to revoke access from. For VPC DB security + // groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId + // and either EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupId *string + + // The name of the EC2 security group to revoke access from. For VPC DB security + // groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId + // and either EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupName *string + + // The Amazon Web Services account number of the owner of the EC2 security group + // specified in the EC2SecurityGroupName parameter. The Amazon Web Services access + // key ID isn't an acceptable value. For VPC DB security groups, EC2SecurityGroupId + // must be provided. Otherwise, EC2SecurityGroupOwnerId and either + // EC2SecurityGroupName or EC2SecurityGroupId must be provided. + EC2SecurityGroupOwnerId *string + + noSmithyDocumentSerde +} + +type RevokeDBSecurityGroupIngressOutput struct { + + // Contains the details for an Amazon RDS DB security group. + // + // This data type is used as a response element in the DescribeDBSecurityGroups + // action. + DBSecurityGroup *types.DBSecurityGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRevokeDBSecurityGroupIngressMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpRevokeDBSecurityGroupIngress{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpRevokeDBSecurityGroupIngress{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RevokeDBSecurityGroupIngress"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRevokeDBSecurityGroupIngressValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeDBSecurityGroupIngress(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRevokeDBSecurityGroupIngress(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RevokeDBSecurityGroupIngress", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartActivityStream.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartActivityStream.go new file mode 100644 index 00000000..37618bc6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartActivityStream.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a database activity stream to monitor activity on the database. For more +// information, see [Monitoring Amazon Aurora with Database Activity Streams]in the Amazon Aurora User Guide or [Monitoring Amazon RDS with Database Activity Streams] in the Amazon RDS User +// Guide. +// +// [Monitoring Amazon Aurora with Database Activity Streams]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/DBActivityStreams.html +// [Monitoring Amazon RDS with Database Activity Streams]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.html +func (c *Client) StartActivityStream(ctx context.Context, params *StartActivityStreamInput, optFns ...func(*Options)) (*StartActivityStreamOutput, error) { + if params == nil { + params = &StartActivityStreamInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartActivityStream", params, optFns, c.addOperationStartActivityStreamMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartActivityStreamOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartActivityStreamInput struct { + + // The Amazon Web Services KMS key identifier for encrypting messages in the + // database activity stream. The Amazon Web Services KMS key identifier is the key + // ARN, key ID, alias ARN, or alias name for the KMS key. + // + // This member is required. + KmsKeyId *string + + // Specifies the mode of the database activity stream. Database events such as a + // change or access generate an activity stream event. The database session can + // handle these events either synchronously or asynchronously. + // + // This member is required. + Mode types.ActivityStreamMode + + // The Amazon Resource Name (ARN) of the DB cluster, for example, + // arn:aws:rds:us-east-1:12345667890:cluster:das-cluster . + // + // This member is required. + ResourceArn *string + + // Specifies whether or not the database activity stream is to start as soon as + // possible, regardless of the maintenance window for the database. + ApplyImmediately *bool + + // Specifies whether the database activity stream includes engine-native audit + // fields. This option applies to an Oracle or Microsoft SQL Server DB instance. By + // default, no engine-native audit fields are included. + EngineNativeAuditFieldsIncluded *bool + + noSmithyDocumentSerde +} + +type StartActivityStreamOutput struct { + + // Indicates whether or not the database activity stream will start as soon as + // possible, regardless of the maintenance window for the database. + ApplyImmediately *bool + + // Indicates whether engine-native audit fields are included in the database + // activity stream. + EngineNativeAuditFieldsIncluded *bool + + // The name of the Amazon Kinesis data stream to be used for the database activity + // stream. + KinesisStreamName *string + + // The Amazon Web Services KMS key identifier for encryption of messages in the + // database activity stream. + KmsKeyId *string + + // The mode of the database activity stream. + Mode types.ActivityStreamMode + + // The status of the database activity stream. + Status types.ActivityStreamStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartActivityStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStartActivityStream{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartActivityStream{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartActivityStream"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartActivityStreamValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartActivityStream(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartActivityStream(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartActivityStream", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBCluster.go new file mode 100644 index 00000000..4c34d55c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBCluster.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts an Amazon Aurora DB cluster that was stopped using the Amazon Web +// Services console, the stop-db-cluster CLI command, or the StopDBCluster +// operation. +// +// For more information, see [Stopping and Starting an Aurora Cluster] in the Amazon Aurora User Guide. +// +// This operation only applies to Aurora DB clusters. +// +// [Stopping and Starting an Aurora Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-cluster-stop-start.html +func (c *Client) StartDBCluster(ctx context.Context, params *StartDBClusterInput, optFns ...func(*Options)) (*StartDBClusterOutput, error) { + if params == nil { + params = &StartDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDBCluster", params, optFns, c.addOperationStartDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDBClusterInput struct { + + // The DB cluster identifier of the Amazon Aurora DB cluster to be started. This + // parameter is stored as a lowercase string. + // + // This member is required. + DBClusterIdentifier *string + + noSmithyDocumentSerde +} + +type StartDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStartDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstance.go new file mode 100644 index 00000000..64a56983 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstance.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts an Amazon RDS DB instance that was stopped using the Amazon Web Services +// console, the stop-db-instance CLI command, or the StopDBInstance operation. +// +// For more information, see [Starting an Amazon RDS DB instance That Was Previously Stopped] in the Amazon RDS User Guide. +// +// This command doesn't apply to RDS Custom, Aurora MySQL, and Aurora PostgreSQL. +// For Aurora DB clusters, use StartDBCluster instead. +// +// [Starting an Amazon RDS DB instance That Was Previously Stopped]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_StartInstance.html +func (c *Client) StartDBInstance(ctx context.Context, params *StartDBInstanceInput, optFns ...func(*Options)) (*StartDBInstanceOutput, error) { + if params == nil { + params = &StartDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDBInstance", params, optFns, c.addOperationStartDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDBInstanceInput struct { + + // The user-supplied instance identifier. + // + // This member is required. + DBInstanceIdentifier *string + + noSmithyDocumentSerde +} + +type StartDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStartDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstanceAutomatedBackupsReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstanceAutomatedBackupsReplication.go new file mode 100644 index 00000000..38447135 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartDBInstanceAutomatedBackupsReplication.go @@ -0,0 +1,198 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables replication of automated backups to a different Amazon Web Services +// Region. +// +// This command doesn't apply to RDS Custom. +// +// For more information, see [Replicating Automated Backups to Another Amazon Web Services Region] in the Amazon RDS User Guide. +// +// [Replicating Automated Backups to Another Amazon Web Services Region]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html +func (c *Client) StartDBInstanceAutomatedBackupsReplication(ctx context.Context, params *StartDBInstanceAutomatedBackupsReplicationInput, optFns ...func(*Options)) (*StartDBInstanceAutomatedBackupsReplicationOutput, error) { + if params == nil { + params = &StartDBInstanceAutomatedBackupsReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDBInstanceAutomatedBackupsReplication", params, optFns, c.addOperationStartDBInstanceAutomatedBackupsReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDBInstanceAutomatedBackupsReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDBInstanceAutomatedBackupsReplicationInput struct { + + // The Amazon Resource Name (ARN) of the source DB instance for the replicated + // automated backups, for example, arn:aws:rds:us-west-2:123456789012:db:mydatabase + // . + // + // This member is required. + SourceDBInstanceArn *string + + // The retention period for the replicated automated backups. + BackupRetentionPeriod *int32 + + // The Amazon Web Services KMS key identifier for encryption of the replicated + // automated backups. The KMS key ID is the Amazon Resource Name (ARN) for the KMS + // encryption key in the destination Amazon Web Services Region, for example, + // arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE . + KmsKeyId *string + + // In an Amazon Web Services GovCloud (US) Region, an URL that contains a + // Signature Version 4 signed request for the + // StartDBInstanceAutomatedBackupsReplication operation to call in the Amazon Web + // Services Region of the source DB instance. The presigned URL must be a valid + // request for the StartDBInstanceAutomatedBackupsReplication API operation that + // can run in the Amazon Web Services Region that contains the source DB instance. + // + // This setting applies only to Amazon Web Services GovCloud (US) Regions. It's + // ignored in other Amazon Web Services Regions. + // + // To learn how to generate a Signature Version 4 signed request, see [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)] and [Signature Version 4 Signing Process]. + // + // If you are using an Amazon Web Services SDK tool or the CLI, you can specify + // SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl + // manually. Specifying SourceRegion autogenerates a presigned URL that is a valid + // request for the operation that can run in the source Amazon Web Services Region. + // + // [Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html + // [Signature Version 4 Signing Process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html + PreSignedUrl *string + + noSmithyDocumentSerde +} + +type StartDBInstanceAutomatedBackupsReplicationOutput struct { + + // An automated backup of a DB instance. It consists of system backups, + // transaction logs, and the database instance properties that existed at the time + // you deleted the source instance. + DBInstanceAutomatedBackup *types.DBInstanceAutomatedBackup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDBInstanceAutomatedBackupsReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStartDBInstanceAutomatedBackupsReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartDBInstanceAutomatedBackupsReplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDBInstanceAutomatedBackupsReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartDBInstanceAutomatedBackupsReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDBInstanceAutomatedBackupsReplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDBInstanceAutomatedBackupsReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDBInstanceAutomatedBackupsReplication", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartExportTask.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartExportTask.go new file mode 100644 index 00000000..fcd1a02a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StartExportTask.go @@ -0,0 +1,338 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Starts an export of DB snapshot or DB cluster data to Amazon S3. The provided +// IAM role must have access to the S3 bucket. +// +// You can't export snapshot data from Db2 or RDS Custom DB instances. +// +// For more information on exporting DB snapshot data, see [Exporting DB snapshot data to Amazon S3] in the Amazon RDS User +// Guide or [Exporting DB cluster snapshot data to Amazon S3]in the Amazon Aurora User Guide. +// +// For more information on exporting DB cluster data, see [Exporting DB cluster data to Amazon S3] in the Amazon Aurora +// User Guide. +// +// [Exporting DB cluster snapshot data to Amazon S3]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-export-snapshot.html +// [Exporting DB cluster data to Amazon S3]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/export-cluster-data.html +// [Exporting DB snapshot data to Amazon S3]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ExportSnapshot.html +func (c *Client) StartExportTask(ctx context.Context, params *StartExportTaskInput, optFns ...func(*Options)) (*StartExportTaskOutput, error) { + if params == nil { + params = &StartExportTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartExportTask", params, optFns, c.addOperationStartExportTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartExportTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartExportTaskInput struct { + + // A unique identifier for the export task. This ID isn't an identifier for the + // Amazon S3 bucket where the data is to be exported. + // + // This member is required. + ExportTaskIdentifier *string + + // The name of the IAM role to use for writing to the Amazon S3 bucket when + // exporting a snapshot or cluster. + // + // In the IAM policy attached to your IAM role, include the following required + // actions to allow the transfer of files from Amazon RDS or Amazon Aurora to an S3 + // bucket: + // + // - s3:PutObject* + // + // - s3:GetObject* + // + // - s3:ListBucket + // + // - s3:DeleteObject* + // + // - s3:GetBucketLocation + // + // In the policy, include the resources to identify the S3 bucket and objects in + // the bucket. The following list of resources shows the Amazon Resource Name (ARN) + // format for accessing S3: + // + // - arn:aws:s3:::your-s3-bucket + // + // - arn:aws:s3:::your-s3-bucket/* + // + // This member is required. + IamRoleArn *string + + // The ID of the Amazon Web Services KMS key to use to encrypt the data exported + // to Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, + // alias ARN, or alias name for the KMS key. The caller of this operation must be + // authorized to run the following operations. These can be set in the Amazon Web + // Services KMS key policy: + // + // - kms:Encrypt + // + // - kms:Decrypt + // + // - kms:GenerateDataKey + // + // - kms:GenerateDataKeyWithoutPlaintext + // + // - kms:ReEncryptFrom + // + // - kms:ReEncryptTo + // + // - kms:CreateGrant + // + // - kms:DescribeKey + // + // - kms:RetireGrant + // + // This member is required. + KmsKeyId *string + + // The name of the Amazon S3 bucket to export the snapshot or cluster data to. + // + // This member is required. + S3BucketName *string + + // The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon + // S3. + // + // This member is required. + SourceArn *string + + // The data to be exported from the snapshot or cluster. If this parameter isn't + // provided, all of the data is exported. + // + // Valid Values: + // + // - database - Export all the data from a specified database. + // + // - database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. + // + // - database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + // + // - database.schema.table table-name - Export a table of the database schema. + // This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + ExportOnly []string + + // The Amazon S3 bucket prefix to use as the file name and path of the exported + // data. + S3Prefix *string + + noSmithyDocumentSerde +} + +// Contains the details of a snapshot or cluster export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks +// operation. +type StartExportTaskOutput struct { + + // The data exported from the snapshot or cluster. + // + // Valid Values: + // + // - database - Export all the data from a specified database. + // + // - database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. + // + // - database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + // + // - database.schema.table table-name - Export a table of the database schema. + // This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + ExportOnly []string + + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. + ExportTaskIdentifier *string + + // The reason the export failed, if it failed. + FailureCause *string + + // The name of the IAM role that is used to write to Amazon S3 when exporting a + // snapshot or cluster. + IamRoleArn *string + + // The key identifier of the Amazon Web Services KMS key that is used to encrypt + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. + KmsKeyId *string + + // The progress of the snapshot or cluster export task as a percentage. + PercentProgress *int32 + + // The Amazon S3 bucket where the snapshot or cluster is exported to. + S3Bucket *string + + // The Amazon S3 bucket prefix that is the file name and path of the exported data. + S3Prefix *string + + // The time when the snapshot was created. + SnapshotTime *time.Time + + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. + SourceArn *string + + // The type of source for the export. + SourceType types.ExportSourceType + + // The progress status of the export task. The status can be one of the following: + // + // - CANCELED + // + // - CANCELING + // + // - COMPLETE + // + // - FAILED + // + // - IN_PROGRESS + // + // - STARTING + Status *string + + // The time when the snapshot or cluster export task ended. + TaskEndTime *time.Time + + // The time when the snapshot or cluster export task started. + TaskStartTime *time.Time + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int32 + + // A warning about the snapshot or cluster export task. + WarningMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartExportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStartExportTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStartExportTask{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartExportTask"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartExportTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExportTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartExportTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartExportTask", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopActivityStream.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopActivityStream.go new file mode 100644 index 00000000..12500e66 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopActivityStream.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops a database activity stream that was started using the Amazon Web Services +// console, the start-activity-stream CLI command, or the StartActivityStream +// operation. +// +// For more information, see [Monitoring Amazon Aurora with Database Activity Streams] in the Amazon Aurora User Guide or [Monitoring Amazon RDS with Database Activity Streams] in the Amazon +// RDS User Guide. +// +// [Monitoring Amazon Aurora with Database Activity Streams]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/DBActivityStreams.html +// [Monitoring Amazon RDS with Database Activity Streams]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.html +func (c *Client) StopActivityStream(ctx context.Context, params *StopActivityStreamInput, optFns ...func(*Options)) (*StopActivityStreamOutput, error) { + if params == nil { + params = &StopActivityStreamInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopActivityStream", params, optFns, c.addOperationStopActivityStreamMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopActivityStreamOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopActivityStreamInput struct { + + // The Amazon Resource Name (ARN) of the DB cluster for the database activity + // stream. For example, arn:aws:rds:us-east-1:12345667890:cluster:das-cluster . + // + // This member is required. + ResourceArn *string + + // Specifies whether or not the database activity stream is to stop as soon as + // possible, regardless of the maintenance window for the database. + ApplyImmediately *bool + + noSmithyDocumentSerde +} + +type StopActivityStreamOutput struct { + + // The name of the Amazon Kinesis data stream used for the database activity + // stream. + KinesisStreamName *string + + // The Amazon Web Services KMS key identifier used for encrypting messages in the + // database activity stream. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The status of the database activity stream. + Status types.ActivityStreamStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopActivityStreamMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStopActivityStream{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStopActivityStream{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopActivityStream"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStopActivityStreamValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopActivityStream(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopActivityStream(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopActivityStream", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBCluster.go new file mode 100644 index 00000000..0e44c1e1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBCluster.go @@ -0,0 +1,187 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops an Amazon Aurora DB cluster. When you stop a DB cluster, Aurora retains +// the DB cluster's metadata, including its endpoints and DB parameter groups. +// Aurora also retains the transaction logs so you can do a point-in-time restore +// if necessary. +// +// For more information, see [Stopping and Starting an Aurora Cluster] in the Amazon Aurora User Guide. +// +// This operation only applies to Aurora DB clusters. +// +// [Stopping and Starting an Aurora Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-cluster-stop-start.html +func (c *Client) StopDBCluster(ctx context.Context, params *StopDBClusterInput, optFns ...func(*Options)) (*StopDBClusterOutput, error) { + if params == nil { + params = &StopDBClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopDBCluster", params, optFns, c.addOperationStopDBClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopDBClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopDBClusterInput struct { + + // The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This + // parameter is stored as a lowercase string. + // + // This member is required. + DBClusterIdentifier *string + + noSmithyDocumentSerde +} + +type StopDBClusterOutput struct { + + // Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. + // + // For an Amazon Aurora DB cluster, this data type is used as a response element + // in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , + // RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , + // RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . + // + // For a Multi-AZ DB cluster, this data type is used as a response element in the + // operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , + // FailoverDBCluster , ModifyDBCluster , RebootDBCluster , + // RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . + // + // For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora + // User Guide. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + // [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html + DBCluster *types.DBCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStopDBCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStopDBCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopDBCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStopDBClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopDBCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopDBCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstance.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstance.go new file mode 100644 index 00000000..5494e2dc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstance.go @@ -0,0 +1,177 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops an Amazon RDS DB instance. When you stop a DB instance, Amazon RDS +// retains the DB instance's metadata, including its endpoint, DB parameter group, +// and option group membership. Amazon RDS also retains the transaction logs so you +// can do a point-in-time restore if necessary. +// +// For more information, see [Stopping an Amazon RDS DB Instance Temporarily] in the Amazon RDS User Guide. +// +// This command doesn't apply to RDS Custom, Aurora MySQL, and Aurora PostgreSQL. +// For Aurora clusters, use StopDBCluster instead. +// +// [Stopping an Amazon RDS DB Instance Temporarily]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_StopInstance.html +func (c *Client) StopDBInstance(ctx context.Context, params *StopDBInstanceInput, optFns ...func(*Options)) (*StopDBInstanceOutput, error) { + if params == nil { + params = &StopDBInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopDBInstance", params, optFns, c.addOperationStopDBInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopDBInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopDBInstanceInput struct { + + // The user-supplied instance identifier. + // + // This member is required. + DBInstanceIdentifier *string + + // The user-supplied instance identifier of the DB Snapshot created immediately + // before the DB instance is stopped. + DBSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +type StopDBInstanceOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStopDBInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStopDBInstance{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopDBInstance"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStopDBInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopDBInstance(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopDBInstance", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstanceAutomatedBackupsReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstanceAutomatedBackupsReplication.go new file mode 100644 index 00000000..a05dd448 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_StopDBInstanceAutomatedBackupsReplication.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops automated backup replication for a DB instance. +// +// This command doesn't apply to RDS Custom, Aurora MySQL, and Aurora PostgreSQL. +// +// For more information, see [Replicating Automated Backups to Another Amazon Web Services Region] in the Amazon RDS User Guide. +// +// [Replicating Automated Backups to Another Amazon Web Services Region]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html +func (c *Client) StopDBInstanceAutomatedBackupsReplication(ctx context.Context, params *StopDBInstanceAutomatedBackupsReplicationInput, optFns ...func(*Options)) (*StopDBInstanceAutomatedBackupsReplicationOutput, error) { + if params == nil { + params = &StopDBInstanceAutomatedBackupsReplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopDBInstanceAutomatedBackupsReplication", params, optFns, c.addOperationStopDBInstanceAutomatedBackupsReplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopDBInstanceAutomatedBackupsReplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopDBInstanceAutomatedBackupsReplicationInput struct { + + // The Amazon Resource Name (ARN) of the source DB instance for which to stop + // replicating automate backups, for example, + // arn:aws:rds:us-west-2:123456789012:db:mydatabase . + // + // This member is required. + SourceDBInstanceArn *string + + noSmithyDocumentSerde +} + +type StopDBInstanceAutomatedBackupsReplicationOutput struct { + + // An automated backup of a DB instance. It consists of system backups, + // transaction logs, and the database instance properties that existed at the time + // you deleted the source instance. + DBInstanceAutomatedBackup *types.DBInstanceAutomatedBackup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopDBInstanceAutomatedBackupsReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpStopDBInstanceAutomatedBackupsReplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpStopDBInstanceAutomatedBackupsReplication{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StopDBInstanceAutomatedBackupsReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStopDBInstanceAutomatedBackupsReplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopDBInstanceAutomatedBackupsReplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopDBInstanceAutomatedBackupsReplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StopDBInstanceAutomatedBackupsReplication", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverBlueGreenDeployment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverBlueGreenDeployment.go new file mode 100644 index 00000000..faadadeb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverBlueGreenDeployment.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Switches over a blue/green deployment. +// +// Before you switch over, production traffic is routed to the databases in the +// blue environment. After you switch over, production traffic is routed to the +// databases in the green environment. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +func (c *Client) SwitchoverBlueGreenDeployment(ctx context.Context, params *SwitchoverBlueGreenDeploymentInput, optFns ...func(*Options)) (*SwitchoverBlueGreenDeploymentOutput, error) { + if params == nil { + params = &SwitchoverBlueGreenDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SwitchoverBlueGreenDeployment", params, optFns, c.addOperationSwitchoverBlueGreenDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SwitchoverBlueGreenDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SwitchoverBlueGreenDeploymentInput struct { + + // The resource ID of the blue/green deployment. + // + // Constraints: + // + // - Must match an existing blue/green deployment resource ID. + // + // This member is required. + BlueGreenDeploymentIdentifier *string + + // The amount of time, in seconds, for the switchover to complete. + // + // Default: 300 + // + // If the switchover takes longer than the specified duration, then any changes + // are rolled back, and no changes are made to the environments. + SwitchoverTimeout *int32 + + noSmithyDocumentSerde +} + +type SwitchoverBlueGreenDeploymentOutput struct { + + // Details about a blue/green deployment. + // + // For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon + // Aurora User Guide. + // + // [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html + BlueGreenDeployment *types.BlueGreenDeployment + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSwitchoverBlueGreenDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSwitchoverBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSwitchoverBlueGreenDeployment{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SwitchoverBlueGreenDeployment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSwitchoverBlueGreenDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSwitchoverBlueGreenDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSwitchoverBlueGreenDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SwitchoverBlueGreenDeployment", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverGlobalCluster.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverGlobalCluster.go new file mode 100644 index 00000000..0ef6888e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverGlobalCluster.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Switches over the specified secondary DB cluster to be the new primary DB +// cluster in the global database cluster. Switchover operations were previously +// called "managed planned failovers." +// +// Aurora promotes the specified secondary cluster to assume full read/write +// capabilities and demotes the current primary cluster to a secondary (read-only) +// cluster, maintaining the orginal replication topology. All secondary clusters +// are synchronized with the primary at the beginning of the process so the new +// primary continues operations for the Aurora global database without losing any +// data. Your database is unavailable for a short time while the primary and +// selected secondary clusters are assuming their new roles. For more information +// about switching over an Aurora global database, see [Performing switchovers for Amazon Aurora global databases]in the Amazon Aurora User +// Guide. +// +// This operation is intended for controlled environments, for operations such as +// "regional rotation" or to fall back to the original primary after a global +// database failover. +// +// [Performing switchovers for Amazon Aurora global databases]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-disaster-recovery.html#aurora-global-database-disaster-recovery.managed-failover +func (c *Client) SwitchoverGlobalCluster(ctx context.Context, params *SwitchoverGlobalClusterInput, optFns ...func(*Options)) (*SwitchoverGlobalClusterOutput, error) { + if params == nil { + params = &SwitchoverGlobalClusterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SwitchoverGlobalCluster", params, optFns, c.addOperationSwitchoverGlobalClusterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SwitchoverGlobalClusterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SwitchoverGlobalClusterInput struct { + + // The identifier of the global database cluster to switch over. This parameter + // isn't case-sensitive. + // + // Constraints: + // + // - Must match the identifier of an existing global database cluster (Aurora + // global database). + // + // This member is required. + GlobalClusterIdentifier *string + + // The identifier of the secondary Aurora DB cluster to promote to the new primary + // for the global database cluster. Use the Amazon Resource Name (ARN) for the + // identifier so that Aurora can locate the cluster in its Amazon Web Services + // Region. + // + // This member is required. + TargetDbClusterIdentifier *string + + noSmithyDocumentSerde +} + +type SwitchoverGlobalClusterOutput struct { + + // A data type representing an Aurora global database. + GlobalCluster *types.GlobalCluster + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSwitchoverGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSwitchoverGlobalCluster{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSwitchoverGlobalCluster{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SwitchoverGlobalCluster"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSwitchoverGlobalClusterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSwitchoverGlobalCluster(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSwitchoverGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SwitchoverGlobalCluster", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverReadReplica.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverReadReplica.go new file mode 100644 index 00000000..01208b4b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/api_op_SwitchoverReadReplica.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Switches over an Oracle standby database in an Oracle Data Guard environment, +// making it the new primary database. Issue this command in the Region that hosts +// the current standby database. +func (c *Client) SwitchoverReadReplica(ctx context.Context, params *SwitchoverReadReplicaInput, optFns ...func(*Options)) (*SwitchoverReadReplicaOutput, error) { + if params == nil { + params = &SwitchoverReadReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SwitchoverReadReplica", params, optFns, c.addOperationSwitchoverReadReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SwitchoverReadReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SwitchoverReadReplicaInput struct { + + // The DB instance identifier of the current standby database. This value is + // stored as a lowercase string. + // + // Constraints: + // + // - Must match the identifier of an existing Oracle read replica DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + noSmithyDocumentSerde +} + +type SwitchoverReadReplicaOutput struct { + + // Contains the details of an Amazon RDS DB instance. + // + // This data type is used as a response element in the operations CreateDBInstance + // , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , + // ModifyDBInstance , PromoteReadReplica , RebootDBInstance , + // RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , + // RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSwitchoverReadReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpSwitchoverReadReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSwitchoverReadReplica{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SwitchoverReadReplica"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSwitchoverReadReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSwitchoverReadReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSwitchoverReadReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SwitchoverReadReplica", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/auth.go new file mode 100644 index 00000000..f4d613c6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "rds") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/deserializers.go new file mode 100644 index 00000000..5fdb61bb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/deserializers.go @@ -0,0 +1,65926 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "bytes" + "context" + "encoding/xml" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + smithy "github.com/aws/smithy-go" + smithyxml "github.com/aws/smithy-go/encoding/xml" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsquery_deserializeOpAddRoleToDBCluster struct { +} + +func (*awsAwsquery_deserializeOpAddRoleToDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddRoleToDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAddRoleToDBCluster(response, &metadata) + } + output := &AddRoleToDBClusterOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAddRoleToDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterRoleAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBClusterRoleAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterRoleQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBClusterRoleQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAddRoleToDBInstance struct { +} + +func (*awsAwsquery_deserializeOpAddRoleToDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddRoleToDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAddRoleToDBInstance(response, &metadata) + } + output := &AddRoleToDBInstanceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAddRoleToDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceRoleAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceRoleAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBInstanceRoleQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBInstanceRoleQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAddSourceIdentifierToSubscription struct { +} + +func (*awsAwsquery_deserializeOpAddSourceIdentifierToSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddSourceIdentifierToSubscription) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAddSourceIdentifierToSubscription(response, &metadata) + } + output := &AddSourceIdentifierToSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AddSourceIdentifierToSubscriptionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAddSourceIdentifierToSubscriptionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAddSourceIdentifierToSubscription(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("SourceNotFound", errorCode): + return awsAwsquery_deserializeErrorSourceNotFoundFault(response, errorBody) + + case strings.EqualFold("SubscriptionNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAddTagsToResource struct { +} + +func (*awsAwsquery_deserializeOpAddTagsToResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAddTagsToResource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAddTagsToResource(response, &metadata) + } + output := &AddTagsToResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAddTagsToResource(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotTenantDatabaseNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotTenantDatabaseNotFoundFault(response, errorBody) + + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseNotFound", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpApplyPendingMaintenanceAction struct { +} + +func (*awsAwsquery_deserializeOpApplyPendingMaintenanceAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpApplyPendingMaintenanceAction) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorApplyPendingMaintenanceAction(response, &metadata) + } + output := &ApplyPendingMaintenanceActionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ApplyPendingMaintenanceActionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentApplyPendingMaintenanceActionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorApplyPendingMaintenanceAction(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAuthorizeDBSecurityGroupIngress struct { +} + +func (*awsAwsquery_deserializeOpAuthorizeDBSecurityGroupIngress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAuthorizeDBSecurityGroupIngress) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAuthorizeDBSecurityGroupIngress(response, &metadata) + } + output := &AuthorizeDBSecurityGroupIngressOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AuthorizeDBSecurityGroupIngressResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAuthorizeDBSecurityGroupIngressOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAuthorizeDBSecurityGroupIngress(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorAuthorizationAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("AuthorizationQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorAuthorizationQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSecurityGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpBacktrackDBCluster struct { +} + +func (*awsAwsquery_deserializeOpBacktrackDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpBacktrackDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorBacktrackDBCluster(response, &metadata) + } + output := &BacktrackDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("BacktrackDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentBacktrackDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorBacktrackDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCancelExportTask struct { +} + +func (*awsAwsquery_deserializeOpCancelExportTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCancelExportTask) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCancelExportTask(response, &metadata) + } + output := &CancelExportTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CancelExportTaskResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCancelExportTaskOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCancelExportTask(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExportTaskNotFound", errorCode): + return awsAwsquery_deserializeErrorExportTaskNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidExportTaskStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidExportTaskStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCopyDBClusterParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpCopyDBClusterParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCopyDBClusterParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCopyDBClusterParameterGroup(response, &metadata) + } + output := &CopyDBClusterParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CopyDBClusterParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCopyDBClusterParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCopyDBClusterParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCopyDBClusterSnapshot struct { +} + +func (*awsAwsquery_deserializeOpCopyDBClusterSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCopyDBClusterSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCopyDBClusterSnapshot(response, &metadata) + } + output := &CopyDBClusterSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CopyDBClusterSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCopyDBClusterSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCopyDBClusterSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterSnapshotAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCopyDBParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpCopyDBParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCopyDBParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCopyDBParameterGroup(response, &metadata) + } + output := &CopyDBParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CopyDBParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCopyDBParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCopyDBParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCopyDBSnapshot struct { +} + +func (*awsAwsquery_deserializeOpCopyDBSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCopyDBSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCopyDBSnapshot(response, &metadata) + } + output := &CopyDBSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CopyDBSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCopyDBSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCopyDBSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomAvailabilityZoneNotFound", errorCode): + return awsAwsquery_deserializeErrorCustomAvailabilityZoneNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCopyOptionGroup struct { +} + +func (*awsAwsquery_deserializeOpCopyOptionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCopyOptionGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCopyOptionGroup(response, &metadata) + } + output := &CopyOptionGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CopyOptionGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCopyOptionGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCopyOptionGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("OptionGroupAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("OptionGroupQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateBlueGreenDeployment struct { +} + +func (*awsAwsquery_deserializeOpCreateBlueGreenDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateBlueGreenDeployment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateBlueGreenDeployment(response, &metadata) + } + output := &CreateBlueGreenDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateBlueGreenDeploymentResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateBlueGreenDeploymentOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateBlueGreenDeployment(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("SourceClusterNotSupportedFault", errorCode): + return awsAwsquery_deserializeErrorSourceClusterNotSupportedFault(response, errorBody) + + case strings.EqualFold("SourceDatabaseNotSupportedFault", errorCode): + return awsAwsquery_deserializeErrorSourceDatabaseNotSupportedFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateCustomDBEngineVersion struct { +} + +func (*awsAwsquery_deserializeOpCreateCustomDBEngineVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateCustomDBEngineVersion) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateCustomDBEngineVersion(response, &metadata) + } + output := &CreateCustomDBEngineVersionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateCustomDBEngineVersionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateCustomDBEngineVersionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateCustomDBEngineVersion(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CreateCustomDBEngineVersionFault", errorCode): + return awsAwsquery_deserializeErrorCreateCustomDBEngineVersionFault(response, errorBody) + + case strings.EqualFold("CustomDBEngineVersionAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorCustomDBEngineVersionAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("CustomDBEngineVersionQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorCustomDBEngineVersionQuotaExceededFault(response, errorBody) + + case strings.EqualFold("Ec2ImagePropertiesNotSupportedFault", errorCode): + return awsAwsquery_deserializeErrorEc2ImagePropertiesNotSupportedFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBCluster struct { +} + +func (*awsAwsquery_deserializeOpCreateDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBCluster(response, &metadata) + } + output := &CreateDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InsufficientStorageClusterCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientStorageClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBClusterEndpoint struct { +} + +func (*awsAwsquery_deserializeOpCreateDBClusterEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBClusterEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBClusterEndpoint(response, &metadata) + } + output := &CreateDBClusterEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBClusterEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBClusterEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBClusterEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterEndpointAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterEndpointAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterEndpointQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterEndpointQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBClusterParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateDBClusterParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBClusterParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBClusterParameterGroup(response, &metadata) + } + output := &CreateDBClusterParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBClusterParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBClusterParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBClusterParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBClusterSnapshot struct { +} + +func (*awsAwsquery_deserializeOpCreateDBClusterSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBClusterSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBClusterSnapshot(response, &metadata) + } + output := &CreateDBClusterSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBClusterSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBClusterSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBClusterSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBInstance struct { +} + +func (*awsAwsquery_deserializeOpCreateDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBInstance(response, &metadata) + } + output := &CreateDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("BackupPolicyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBInstanceReadReplica struct { +} + +func (*awsAwsquery_deserializeOpCreateDBInstanceReadReplica) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBInstanceReadReplica) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBInstanceReadReplica(response, &metadata) + } + output := &CreateDBInstanceReadReplicaOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBInstanceReadReplicaResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBInstanceReadReplicaOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBInstanceReadReplica(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotAllowedFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotAllowedFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateDBParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBParameterGroup(response, &metadata) + } + output := &CreateDBParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBProxy struct { +} + +func (*awsAwsquery_deserializeOpCreateDBProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBProxy) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBProxy(response, &metadata) + } + output := &CreateDBProxyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBProxyResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBProxyOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBProxy(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBProxyQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBProxyEndpoint struct { +} + +func (*awsAwsquery_deserializeOpCreateDBProxyEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBProxyEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBProxyEndpoint(response, &metadata) + } + output := &CreateDBProxyEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBProxyEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBProxyEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBProxyEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyEndpointAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBProxyEndpointQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBSecurityGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateDBSecurityGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBSecurityGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBSecurityGroup(response, &metadata) + } + output := &CreateDBSecurityGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBSecurityGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBSecurityGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBSecurityGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSecurityGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotSupported", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotSupportedFault(response, errorBody) + + case strings.EqualFold("QuotaExceeded.DBSecurityGroup", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBShardGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateDBShardGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBShardGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBShardGroup(response, &metadata) + } + output := &CreateDBShardGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBShardGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBShardGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBShardGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBShardGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("MaxDBShardGroupLimitReached", errorCode): + return awsAwsquery_deserializeErrorMaxDBShardGroupLimitReached(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("UnsupportedDBEngineVersion", errorCode): + return awsAwsquery_deserializeErrorUnsupportedDBEngineVersionFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBSnapshot struct { +} + +func (*awsAwsquery_deserializeOpCreateDBSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBSnapshot(response, &metadata) + } + output := &CreateDBSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateDBSubnetGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateDBSubnetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateDBSubnetGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateDBSubnetGroup(response, &metadata) + } + output := &CreateDBSubnetGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateDBSubnetGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateDBSubnetGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateDBSubnetGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSubnetGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBSubnetQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateEventSubscription struct { +} + +func (*awsAwsquery_deserializeOpCreateEventSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateEventSubscription) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateEventSubscription(response, &metadata) + } + output := &CreateEventSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateEventSubscriptionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateEventSubscriptionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateEventSubscription(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("EventSubscriptionQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorEventSubscriptionQuotaExceededFault(response, errorBody) + + case strings.EqualFold("SNSInvalidTopic", errorCode): + return awsAwsquery_deserializeErrorSNSInvalidTopicFault(response, errorBody) + + case strings.EqualFold("SNSNoAuthorization", errorCode): + return awsAwsquery_deserializeErrorSNSNoAuthorizationFault(response, errorBody) + + case strings.EqualFold("SNSTopicArnNotFound", errorCode): + return awsAwsquery_deserializeErrorSNSTopicArnNotFoundFault(response, errorBody) + + case strings.EqualFold("SourceNotFound", errorCode): + return awsAwsquery_deserializeErrorSourceNotFoundFault(response, errorBody) + + case strings.EqualFold("SubscriptionAlreadyExist", errorCode): + return awsAwsquery_deserializeErrorSubscriptionAlreadyExistFault(response, errorBody) + + case strings.EqualFold("SubscriptionCategoryNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionCategoryNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpCreateGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateGlobalCluster(response, &metadata) + } + output := &CreateGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("GlobalClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("GlobalClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateIntegration struct { +} + +func (*awsAwsquery_deserializeOpCreateIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateIntegration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateIntegration(response, &metadata) + } + output := &CreateIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateIntegrationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateIntegrationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateIntegration(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("IntegrationAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("IntegrationConflictOperationFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationConflictOperationFault(response, errorBody) + + case strings.EqualFold("IntegrationQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationQuotaExceededFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateOptionGroup struct { +} + +func (*awsAwsquery_deserializeOpCreateOptionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateOptionGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateOptionGroup(response, &metadata) + } + output := &CreateOptionGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateOptionGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateOptionGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateOptionGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("OptionGroupAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("OptionGroupQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpCreateTenantDatabase struct { +} + +func (*awsAwsquery_deserializeOpCreateTenantDatabase) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpCreateTenantDatabase) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorCreateTenantDatabase(response, &metadata) + } + output := &CreateTenantDatabaseOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("CreateTenantDatabaseResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentCreateTenantDatabaseOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorCreateTenantDatabase(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteBlueGreenDeployment struct { +} + +func (*awsAwsquery_deserializeOpDeleteBlueGreenDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteBlueGreenDeployment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteBlueGreenDeployment(response, &metadata) + } + output := &DeleteBlueGreenDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteBlueGreenDeploymentResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteBlueGreenDeploymentOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteBlueGreenDeployment(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidBlueGreenDeploymentStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidBlueGreenDeploymentStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteCustomDBEngineVersion struct { +} + +func (*awsAwsquery_deserializeOpDeleteCustomDBEngineVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteCustomDBEngineVersion) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteCustomDBEngineVersion(response, &metadata) + } + output := &DeleteCustomDBEngineVersionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteCustomDBEngineVersionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteCustomDBEngineVersionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteCustomDBEngineVersion(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomDBEngineVersionNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorCustomDBEngineVersionNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidCustomDBEngineVersionStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidCustomDBEngineVersionStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBCluster struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBCluster(response, &metadata) + } + output := &DeleteDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAutomatedBackupQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAutomatedBackupQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBClusterAutomatedBackup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBClusterAutomatedBackup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBClusterAutomatedBackup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBClusterAutomatedBackup(response, &metadata) + } + output := &DeleteDBClusterAutomatedBackupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBClusterAutomatedBackupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBClusterAutomatedBackupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBClusterAutomatedBackup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAutomatedBackupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAutomatedBackupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterAutomatedBackupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterAutomatedBackupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBClusterEndpoint struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBClusterEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBClusterEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBClusterEndpoint(response, &metadata) + } + output := &DeleteDBClusterEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBClusterEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBClusterEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBClusterEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterEndpointNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterEndpointNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterEndpointStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterEndpointStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBClusterParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBClusterParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBClusterParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBClusterParameterGroup(response, &metadata) + } + output := &DeleteDBClusterParameterGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBClusterParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBClusterSnapshot struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBClusterSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBClusterSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBClusterSnapshot(response, &metadata) + } + output := &DeleteDBClusterSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBClusterSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBClusterSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBClusterSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBInstance struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBInstance(response, &metadata) + } + output := &DeleteDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceAutomatedBackupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAutomatedBackupQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBInstanceAutomatedBackup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBInstanceAutomatedBackup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBInstanceAutomatedBackup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBInstanceAutomatedBackup(response, &metadata) + } + output := &DeleteDBInstanceAutomatedBackupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBInstanceAutomatedBackupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBInstanceAutomatedBackupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBInstanceAutomatedBackup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceAutomatedBackupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAutomatedBackupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceAutomatedBackupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceAutomatedBackupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBParameterGroup(response, &metadata) + } + output := &DeleteDBParameterGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBProxy struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBProxy) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBProxy(response, &metadata) + } + output := &DeleteDBProxyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBProxyResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBProxyOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBProxy(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBProxyEndpoint struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBProxyEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBProxyEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBProxyEndpoint(response, &metadata) + } + output := &DeleteDBProxyEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBProxyEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBProxyEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBProxyEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyEndpointNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyEndpointStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyEndpointStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBSecurityGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBSecurityGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBSecurityGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBSecurityGroup(response, &metadata) + } + output := &DeleteDBSecurityGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBSecurityGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSecurityGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBShardGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBShardGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBShardGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBShardGroup(response, &metadata) + } + output := &DeleteDBShardGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBShardGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBShardGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBShardGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBShardGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBShardGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBShardGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBSnapshot struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBSnapshot(response, &metadata) + } + output := &DeleteDBSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteDBSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteDBSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteDBSubnetGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteDBSubnetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteDBSubnetGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteDBSubnetGroup(response, &metadata) + } + output := &DeleteDBSubnetGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteDBSubnetGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteEventSubscription struct { +} + +func (*awsAwsquery_deserializeOpDeleteEventSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteEventSubscription) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteEventSubscription(response, &metadata) + } + output := &DeleteEventSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteEventSubscriptionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteEventSubscriptionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteEventSubscription(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidEventSubscriptionState", errorCode): + return awsAwsquery_deserializeErrorInvalidEventSubscriptionStateFault(response, errorBody) + + case strings.EqualFold("SubscriptionNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpDeleteGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteGlobalCluster(response, &metadata) + } + output := &DeleteGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteIntegration struct { +} + +func (*awsAwsquery_deserializeOpDeleteIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteIntegration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteIntegration(response, &metadata) + } + output := &DeleteIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteIntegrationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteIntegrationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteIntegration(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("IntegrationConflictOperationFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationConflictOperationFault(response, errorBody) + + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidIntegrationStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidIntegrationStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteOptionGroup struct { +} + +func (*awsAwsquery_deserializeOpDeleteOptionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteOptionGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteOptionGroup(response, &metadata) + } + output := &DeleteOptionGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteOptionGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidOptionGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidOptionGroupStateFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeleteTenantDatabase struct { +} + +func (*awsAwsquery_deserializeOpDeleteTenantDatabase) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeleteTenantDatabase) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeleteTenantDatabase(response, &metadata) + } + output := &DeleteTenantDatabaseOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeleteTenantDatabaseResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeleteTenantDatabaseOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeleteTenantDatabase(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseNotFound", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDeregisterDBProxyTargets struct { +} + +func (*awsAwsquery_deserializeOpDeregisterDBProxyTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDeregisterDBProxyTargets) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDeregisterDBProxyTargets(response, &metadata) + } + output := &DeregisterDBProxyTargetsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DeregisterDBProxyTargetsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDeregisterDBProxyTargetsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDeregisterDBProxyTargets(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeAccountAttributes struct { +} + +func (*awsAwsquery_deserializeOpDescribeAccountAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeAccountAttributes) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeAccountAttributes(response, &metadata) + } + output := &DescribeAccountAttributesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeAccountAttributesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeAccountAttributesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeAccountAttributes(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeBlueGreenDeployments struct { +} + +func (*awsAwsquery_deserializeOpDescribeBlueGreenDeployments) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeBlueGreenDeployments) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeBlueGreenDeployments(response, &metadata) + } + output := &DescribeBlueGreenDeploymentsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeBlueGreenDeploymentsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeBlueGreenDeploymentsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeBlueGreenDeployments(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeCertificates struct { +} + +func (*awsAwsquery_deserializeOpDescribeCertificates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeCertificates) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeCertificates(response, &metadata) + } + output := &DescribeCertificatesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeCertificatesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeCertificatesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeCertificates(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterAutomatedBackups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterAutomatedBackups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterAutomatedBackups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterAutomatedBackups(response, &metadata) + } + output := &DescribeDBClusterAutomatedBackupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterAutomatedBackupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterAutomatedBackupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterAutomatedBackups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAutomatedBackupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAutomatedBackupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterBacktracks struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterBacktracks) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterBacktracks) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterBacktracks(response, &metadata) + } + output := &DescribeDBClusterBacktracksOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterBacktracksResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterBacktracksOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterBacktracks(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterBacktrackNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterBacktrackNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterEndpoints struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterEndpoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterEndpoints) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterEndpoints(response, &metadata) + } + output := &DescribeDBClusterEndpointsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterEndpointsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterEndpointsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterEndpoints(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterParameterGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterParameterGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterParameterGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterParameterGroups(response, &metadata) + } + output := &DescribeDBClusterParameterGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterParameterGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterParameterGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterParameterGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterParameters struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterParameters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterParameters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterParameters(response, &metadata) + } + output := &DescribeDBClusterParametersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterParametersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterParametersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterParameters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusters struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusters(response, &metadata) + } + output := &DescribeDBClustersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClustersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClustersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterSnapshotAttributes struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterSnapshotAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterSnapshotAttributes) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterSnapshotAttributes(response, &metadata) + } + output := &DescribeDBClusterSnapshotAttributesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterSnapshotAttributesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterSnapshotAttributesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterSnapshotAttributes(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBClusterSnapshots struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBClusterSnapshots) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBClusterSnapshots) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBClusterSnapshots(response, &metadata) + } + output := &DescribeDBClusterSnapshotsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBClusterSnapshotsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBClusterSnapshotsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBClusterSnapshots(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBEngineVersions struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBEngineVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBEngineVersions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBEngineVersions(response, &metadata) + } + output := &DescribeDBEngineVersionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBEngineVersionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBEngineVersionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBEngineVersions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBInstanceAutomatedBackups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBInstanceAutomatedBackups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBInstanceAutomatedBackups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBInstanceAutomatedBackups(response, &metadata) + } + output := &DescribeDBInstanceAutomatedBackupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBInstanceAutomatedBackupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBInstanceAutomatedBackupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBInstanceAutomatedBackups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceAutomatedBackupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAutomatedBackupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBInstances struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBInstances) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBInstances) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBInstances(response, &metadata) + } + output := &DescribeDBInstancesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBInstancesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBInstancesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBInstances(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBLogFiles struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBLogFiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBLogFiles) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBLogFiles(response, &metadata) + } + output := &DescribeDBLogFilesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBLogFilesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBLogFilesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBLogFiles(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotReady", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotReadyFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBParameterGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBParameterGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBParameterGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBParameterGroups(response, &metadata) + } + output := &DescribeDBParameterGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBParameterGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBParameterGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBParameterGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBParameters struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBParameters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBParameters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBParameters(response, &metadata) + } + output := &DescribeDBParametersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBParametersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBParametersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBParameters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBProxies struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBProxies) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBProxies) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBProxies(response, &metadata) + } + output := &DescribeDBProxiesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBProxiesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBProxiesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBProxies(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBProxyEndpoints struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBProxyEndpoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBProxyEndpoints) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBProxyEndpoints(response, &metadata) + } + output := &DescribeDBProxyEndpointsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBProxyEndpointsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBProxyEndpointsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBProxyEndpoints(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyEndpointNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBProxyTargetGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBProxyTargetGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBProxyTargetGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBProxyTargetGroups(response, &metadata) + } + output := &DescribeDBProxyTargetGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBProxyTargetGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBProxyTargetGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBProxyTargetGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBProxyTargets struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBProxyTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBProxyTargets) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBProxyTargets(response, &metadata) + } + output := &DescribeDBProxyTargetsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBProxyTargetsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBProxyTargetsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBProxyTargets(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBRecommendations struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBRecommendations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBRecommendations) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBRecommendations(response, &metadata) + } + output := &DescribeDBRecommendationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBRecommendationsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBRecommendationsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBRecommendations(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBSecurityGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBSecurityGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBSecurityGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBSecurityGroups(response, &metadata) + } + output := &DescribeDBSecurityGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBSecurityGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBSecurityGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBSecurityGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBShardGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBShardGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBShardGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBShardGroups(response, &metadata) + } + output := &DescribeDBShardGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBShardGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBShardGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBShardGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBShardGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBSnapshotAttributes struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBSnapshotAttributes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBSnapshotAttributes) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBSnapshotAttributes(response, &metadata) + } + output := &DescribeDBSnapshotAttributesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBSnapshotAttributesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBSnapshotAttributesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBSnapshotAttributes(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBSnapshots struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBSnapshots) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBSnapshots) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBSnapshots(response, &metadata) + } + output := &DescribeDBSnapshotsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBSnapshotsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBSnapshotsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBSnapshots(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBSnapshotTenantDatabases struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBSnapshotTenantDatabases) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBSnapshotTenantDatabases) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBSnapshotTenantDatabases(response, &metadata) + } + output := &DescribeDBSnapshotTenantDatabasesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBSnapshotTenantDatabasesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBSnapshotTenantDatabasesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBSnapshotTenantDatabases(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeDBSubnetGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeDBSubnetGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeDBSubnetGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeDBSubnetGroups(response, &metadata) + } + output := &DescribeDBSubnetGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeDBSubnetGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeDBSubnetGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeDBSubnetGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeEngineDefaultClusterParameters struct { +} + +func (*awsAwsquery_deserializeOpDescribeEngineDefaultClusterParameters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeEngineDefaultClusterParameters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeEngineDefaultClusterParameters(response, &metadata) + } + output := &DescribeEngineDefaultClusterParametersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeEngineDefaultClusterParametersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeEngineDefaultClusterParametersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeEngineDefaultClusterParameters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeEngineDefaultParameters struct { +} + +func (*awsAwsquery_deserializeOpDescribeEngineDefaultParameters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeEngineDefaultParameters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeEngineDefaultParameters(response, &metadata) + } + output := &DescribeEngineDefaultParametersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeEngineDefaultParametersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeEngineDefaultParametersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeEngineDefaultParameters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeEventCategories struct { +} + +func (*awsAwsquery_deserializeOpDescribeEventCategories) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeEventCategories) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeEventCategories(response, &metadata) + } + output := &DescribeEventCategoriesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeEventCategoriesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeEventCategoriesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeEventCategories(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeEvents struct { +} + +func (*awsAwsquery_deserializeOpDescribeEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeEvents) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeEvents(response, &metadata) + } + output := &DescribeEventsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeEventsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeEventsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeEvents(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeEventSubscriptions struct { +} + +func (*awsAwsquery_deserializeOpDescribeEventSubscriptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeEventSubscriptions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeEventSubscriptions(response, &metadata) + } + output := &DescribeEventSubscriptionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeEventSubscriptionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeEventSubscriptionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeEventSubscriptions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("SubscriptionNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeExportTasks struct { +} + +func (*awsAwsquery_deserializeOpDescribeExportTasks) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeExportTasks) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeExportTasks(response, &metadata) + } + output := &DescribeExportTasksOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeExportTasksResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeExportTasksOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeExportTasks(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExportTaskNotFound", errorCode): + return awsAwsquery_deserializeErrorExportTaskNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeGlobalClusters struct { +} + +func (*awsAwsquery_deserializeOpDescribeGlobalClusters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeGlobalClusters) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeGlobalClusters(response, &metadata) + } + output := &DescribeGlobalClustersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeGlobalClustersResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeGlobalClustersOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeGlobalClusters(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeIntegrations struct { +} + +func (*awsAwsquery_deserializeOpDescribeIntegrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeIntegrations) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeIntegrations(response, &metadata) + } + output := &DescribeIntegrationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeIntegrationsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeIntegrationsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeIntegrations(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeOptionGroupOptions struct { +} + +func (*awsAwsquery_deserializeOpDescribeOptionGroupOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeOptionGroupOptions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeOptionGroupOptions(response, &metadata) + } + output := &DescribeOptionGroupOptionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeOptionGroupOptionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeOptionGroupOptionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeOptionGroupOptions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeOptionGroups struct { +} + +func (*awsAwsquery_deserializeOpDescribeOptionGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeOptionGroups) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeOptionGroups(response, &metadata) + } + output := &DescribeOptionGroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeOptionGroupsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeOptionGroupsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeOptionGroups(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeOrderableDBInstanceOptions struct { +} + +func (*awsAwsquery_deserializeOpDescribeOrderableDBInstanceOptions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeOrderableDBInstanceOptions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeOrderableDBInstanceOptions(response, &metadata) + } + output := &DescribeOrderableDBInstanceOptionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeOrderableDBInstanceOptionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeOrderableDBInstanceOptionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeOrderableDBInstanceOptions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribePendingMaintenanceActions struct { +} + +func (*awsAwsquery_deserializeOpDescribePendingMaintenanceActions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribePendingMaintenanceActions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribePendingMaintenanceActions(response, &metadata) + } + output := &DescribePendingMaintenanceActionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribePendingMaintenanceActionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribePendingMaintenanceActionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribePendingMaintenanceActions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeReservedDBInstances struct { +} + +func (*awsAwsquery_deserializeOpDescribeReservedDBInstances) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeReservedDBInstances) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeReservedDBInstances(response, &metadata) + } + output := &DescribeReservedDBInstancesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeReservedDBInstancesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeReservedDBInstancesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeReservedDBInstances(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ReservedDBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedDBInstanceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeReservedDBInstancesOfferings struct { +} + +func (*awsAwsquery_deserializeOpDescribeReservedDBInstancesOfferings) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeReservedDBInstancesOfferings) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeReservedDBInstancesOfferings(response, &metadata) + } + output := &DescribeReservedDBInstancesOfferingsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeReservedDBInstancesOfferingsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeReservedDBInstancesOfferingsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeReservedDBInstancesOfferings(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ReservedDBInstancesOfferingNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedDBInstancesOfferingNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeSourceRegions struct { +} + +func (*awsAwsquery_deserializeOpDescribeSourceRegions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeSourceRegions) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeSourceRegions(response, &metadata) + } + output := &DescribeSourceRegionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeSourceRegionsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeSourceRegionsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeSourceRegions(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeTenantDatabases struct { +} + +func (*awsAwsquery_deserializeOpDescribeTenantDatabases) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeTenantDatabases) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeTenantDatabases(response, &metadata) + } + output := &DescribeTenantDatabasesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeTenantDatabasesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeTenantDatabasesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeTenantDatabases(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDescribeValidDBInstanceModifications struct { +} + +func (*awsAwsquery_deserializeOpDescribeValidDBInstanceModifications) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDescribeValidDBInstanceModifications) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDescribeValidDBInstanceModifications(response, &metadata) + } + output := &DescribeValidDBInstanceModificationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DescribeValidDBInstanceModificationsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDescribeValidDBInstanceModificationsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDescribeValidDBInstanceModifications(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDisableHttpEndpoint struct { +} + +func (*awsAwsquery_deserializeOpDisableHttpEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDisableHttpEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDisableHttpEndpoint(response, &metadata) + } + output := &DisableHttpEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DisableHttpEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDisableHttpEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDisableHttpEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidResourceStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidResourceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDownloadDBLogFilePortion struct { +} + +func (*awsAwsquery_deserializeOpDownloadDBLogFilePortion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDownloadDBLogFilePortion) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDownloadDBLogFilePortion(response, &metadata) + } + output := &DownloadDBLogFilePortionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DownloadDBLogFilePortionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDownloadDBLogFilePortionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDownloadDBLogFilePortion(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotReady", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotReadyFault(response, errorBody) + + case strings.EqualFold("DBLogFileNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBLogFileNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpEnableHttpEndpoint struct { +} + +func (*awsAwsquery_deserializeOpEnableHttpEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpEnableHttpEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorEnableHttpEndpoint(response, &metadata) + } + output := &EnableHttpEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("EnableHttpEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentEnableHttpEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorEnableHttpEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidResourceStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidResourceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpFailoverDBCluster struct { +} + +func (*awsAwsquery_deserializeOpFailoverDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpFailoverDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorFailoverDBCluster(response, &metadata) + } + output := &FailoverDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("FailoverDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentFailoverDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorFailoverDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpFailoverGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpFailoverGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpFailoverGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorFailoverGlobalCluster(response, &metadata) + } + output := &FailoverGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("FailoverGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentFailoverGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorFailoverGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpListTagsForResource struct { +} + +func (*awsAwsquery_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpListTagsForResource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ListTagsForResourceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentListTagsForResourceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorListTagsForResource(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotTenantDatabaseNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotTenantDatabaseNotFoundFault(response, errorBody) + + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseNotFound", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyActivityStream struct { +} + +func (*awsAwsquery_deserializeOpModifyActivityStream) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyActivityStream) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyActivityStream(response, &metadata) + } + output := &ModifyActivityStreamOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyActivityStreamResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyActivityStreamOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyActivityStream(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyCertificates struct { +} + +func (*awsAwsquery_deserializeOpModifyCertificates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyCertificates) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyCertificates(response, &metadata) + } + output := &ModifyCertificatesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyCertificatesResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyCertificatesOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyCertificates(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyCurrentDBClusterCapacity struct { +} + +func (*awsAwsquery_deserializeOpModifyCurrentDBClusterCapacity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyCurrentDBClusterCapacity) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyCurrentDBClusterCapacity(response, &metadata) + } + output := &ModifyCurrentDBClusterCapacityOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyCurrentDBClusterCapacityResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyCurrentDBClusterCapacityOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyCurrentDBClusterCapacity(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterCapacityFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyCustomDBEngineVersion struct { +} + +func (*awsAwsquery_deserializeOpModifyCustomDBEngineVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyCustomDBEngineVersion) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyCustomDBEngineVersion(response, &metadata) + } + output := &ModifyCustomDBEngineVersionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyCustomDBEngineVersionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyCustomDBEngineVersionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyCustomDBEngineVersion(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("CustomDBEngineVersionNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorCustomDBEngineVersionNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidCustomDBEngineVersionStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidCustomDBEngineVersionStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBCluster struct { +} + +func (*awsAwsquery_deserializeOpModifyDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBCluster(response, &metadata) + } + output := &ModifyDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSecurityGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotAvailableFault", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotAvailableFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBClusterEndpoint struct { +} + +func (*awsAwsquery_deserializeOpModifyDBClusterEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBClusterEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBClusterEndpoint(response, &metadata) + } + output := &ModifyDBClusterEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBClusterEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBClusterEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBClusterEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterEndpointNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterEndpointNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterEndpointStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterEndpointStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBClusterParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyDBClusterParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBClusterParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBClusterParameterGroup(response, &metadata) + } + output := &ModifyDBClusterParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBClusterParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBClusterParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBClusterParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBClusterSnapshotAttribute struct { +} + +func (*awsAwsquery_deserializeOpModifyDBClusterSnapshotAttribute) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBClusterSnapshotAttribute) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBClusterSnapshotAttribute(response, &metadata) + } + output := &ModifyDBClusterSnapshotAttributeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBClusterSnapshotAttributeResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBClusterSnapshotAttributeOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBClusterSnapshotAttribute(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("SharedSnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSharedSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBInstance struct { +} + +func (*awsAwsquery_deserializeOpModifyDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBInstance(response, &metadata) + } + output := &ModifyDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("BackupPolicyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBUpgradeDependencyFailure", errorCode): + return awsAwsquery_deserializeErrorDBUpgradeDependencyFailureFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSecurityGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyDBParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBParameterGroup(response, &metadata) + } + output := &ModifyDBParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBProxy struct { +} + +func (*awsAwsquery_deserializeOpModifyDBProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBProxy) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBProxy(response, &metadata) + } + output := &ModifyDBProxyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBProxyResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBProxyOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBProxy(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBProxyEndpoint struct { +} + +func (*awsAwsquery_deserializeOpModifyDBProxyEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBProxyEndpoint) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBProxyEndpoint(response, &metadata) + } + output := &ModifyDBProxyEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBProxyEndpointResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBProxyEndpointOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBProxyEndpoint(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyEndpointAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBProxyEndpointNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyEndpointNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyEndpointStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyEndpointStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBProxyTargetGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyDBProxyTargetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBProxyTargetGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBProxyTargetGroup(response, &metadata) + } + output := &ModifyDBProxyTargetGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBProxyTargetGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBProxyTargetGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBProxyTargetGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBRecommendation struct { +} + +func (*awsAwsquery_deserializeOpModifyDBRecommendation) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBRecommendation) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBRecommendation(response, &metadata) + } + output := &ModifyDBRecommendationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBRecommendationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBRecommendationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBRecommendation(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBShardGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyDBShardGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBShardGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBShardGroup(response, &metadata) + } + output := &ModifyDBShardGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBShardGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBShardGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBShardGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBShardGroupAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBShardGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBSnapshot struct { +} + +func (*awsAwsquery_deserializeOpModifyDBSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBSnapshot(response, &metadata) + } + output := &ModifyDBSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBSnapshotAttribute struct { +} + +func (*awsAwsquery_deserializeOpModifyDBSnapshotAttribute) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBSnapshotAttribute) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBSnapshotAttribute(response, &metadata) + } + output := &ModifyDBSnapshotAttributeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBSnapshotAttributeResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBSnapshotAttributeOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBSnapshotAttribute(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + case strings.EqualFold("SharedSnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSharedSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyDBSubnetGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyDBSubnetGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyDBSubnetGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyDBSubnetGroup(response, &metadata) + } + output := &ModifyDBSubnetGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyDBSubnetGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyDBSubnetGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyDBSubnetGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("SubnetAlreadyInUse", errorCode): + return awsAwsquery_deserializeErrorSubnetAlreadyInUse(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyEventSubscription struct { +} + +func (*awsAwsquery_deserializeOpModifyEventSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyEventSubscription) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyEventSubscription(response, &metadata) + } + output := &ModifyEventSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyEventSubscriptionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyEventSubscriptionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyEventSubscription(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("EventSubscriptionQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorEventSubscriptionQuotaExceededFault(response, errorBody) + + case strings.EqualFold("SNSInvalidTopic", errorCode): + return awsAwsquery_deserializeErrorSNSInvalidTopicFault(response, errorBody) + + case strings.EqualFold("SNSNoAuthorization", errorCode): + return awsAwsquery_deserializeErrorSNSNoAuthorizationFault(response, errorBody) + + case strings.EqualFold("SNSTopicArnNotFound", errorCode): + return awsAwsquery_deserializeErrorSNSTopicArnNotFoundFault(response, errorBody) + + case strings.EqualFold("SubscriptionCategoryNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionCategoryNotFoundFault(response, errorBody) + + case strings.EqualFold("SubscriptionNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpModifyGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyGlobalCluster(response, &metadata) + } + output := &ModifyGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("GlobalClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyIntegration struct { +} + +func (*awsAwsquery_deserializeOpModifyIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyIntegration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyIntegration(response, &metadata) + } + output := &ModifyIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyIntegrationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyIntegrationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyIntegration(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("IntegrationConflictOperationFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationConflictOperationFault(response, errorBody) + + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidIntegrationStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidIntegrationStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyOptionGroup struct { +} + +func (*awsAwsquery_deserializeOpModifyOptionGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyOptionGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyOptionGroup(response, &metadata) + } + output := &ModifyOptionGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyOptionGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyOptionGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyOptionGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidOptionGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidOptionGroupStateFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpModifyTenantDatabase struct { +} + +func (*awsAwsquery_deserializeOpModifyTenantDatabase) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpModifyTenantDatabase) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorModifyTenantDatabase(response, &metadata) + } + output := &ModifyTenantDatabaseOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ModifyTenantDatabaseResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentModifyTenantDatabaseOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorModifyTenantDatabase(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseNotFound", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpPromoteReadReplica struct { +} + +func (*awsAwsquery_deserializeOpPromoteReadReplica) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPromoteReadReplica) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorPromoteReadReplica(response, &metadata) + } + output := &PromoteReadReplicaOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("PromoteReadReplicaResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPromoteReadReplicaOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorPromoteReadReplica(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpPromoteReadReplicaDBCluster struct { +} + +func (*awsAwsquery_deserializeOpPromoteReadReplicaDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPromoteReadReplicaDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorPromoteReadReplicaDBCluster(response, &metadata) + } + output := &PromoteReadReplicaDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("PromoteReadReplicaDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPromoteReadReplicaDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorPromoteReadReplicaDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpPurchaseReservedDBInstancesOffering struct { +} + +func (*awsAwsquery_deserializeOpPurchaseReservedDBInstancesOffering) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpPurchaseReservedDBInstancesOffering) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorPurchaseReservedDBInstancesOffering(response, &metadata) + } + output := &PurchaseReservedDBInstancesOfferingOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("PurchaseReservedDBInstancesOfferingResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentPurchaseReservedDBInstancesOfferingOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorPurchaseReservedDBInstancesOffering(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ReservedDBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorReservedDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("ReservedDBInstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorReservedDBInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("ReservedDBInstancesOfferingNotFound", errorCode): + return awsAwsquery_deserializeErrorReservedDBInstancesOfferingNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRebootDBCluster struct { +} + +func (*awsAwsquery_deserializeOpRebootDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRebootDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRebootDBCluster(response, &metadata) + } + output := &RebootDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RebootDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRebootDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRebootDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRebootDBInstance struct { +} + +func (*awsAwsquery_deserializeOpRebootDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRebootDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRebootDBInstance(response, &metadata) + } + output := &RebootDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RebootDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRebootDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRebootDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRebootDBShardGroup struct { +} + +func (*awsAwsquery_deserializeOpRebootDBShardGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRebootDBShardGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRebootDBShardGroup(response, &metadata) + } + output := &RebootDBShardGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RebootDBShardGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRebootDBShardGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRebootDBShardGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBShardGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBShardGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBShardGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBShardGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRegisterDBProxyTargets struct { +} + +func (*awsAwsquery_deserializeOpRegisterDBProxyTargets) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRegisterDBProxyTargets) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRegisterDBProxyTargets(response, &metadata) + } + output := &RegisterDBProxyTargetsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RegisterDBProxyTargetsResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRegisterDBProxyTargetsOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRegisterDBProxyTargets(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetAlreadyRegisteredFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetAlreadyRegisteredFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientAvailableIPsInSubnetFault", errorCode): + return awsAwsquery_deserializeErrorInsufficientAvailableIPsInSubnetFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBProxyStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveFromGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpRemoveFromGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveFromGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRemoveFromGlobalCluster(response, &metadata) + } + output := &RemoveFromGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RemoveFromGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRemoveFromGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRemoveFromGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveRoleFromDBCluster struct { +} + +func (*awsAwsquery_deserializeOpRemoveRoleFromDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveRoleFromDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRemoveRoleFromDBCluster(response, &metadata) + } + output := &RemoveRoleFromDBClusterOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRemoveRoleFromDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterRoleNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterRoleNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveRoleFromDBInstance struct { +} + +func (*awsAwsquery_deserializeOpRemoveRoleFromDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveRoleFromDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRemoveRoleFromDBInstance(response, &metadata) + } + output := &RemoveRoleFromDBInstanceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRemoveRoleFromDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceRoleNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceRoleNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveSourceIdentifierFromSubscription struct { +} + +func (*awsAwsquery_deserializeOpRemoveSourceIdentifierFromSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveSourceIdentifierFromSubscription) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRemoveSourceIdentifierFromSubscription(response, &metadata) + } + output := &RemoveSourceIdentifierFromSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RemoveSourceIdentifierFromSubscriptionResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRemoveSourceIdentifierFromSubscriptionOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRemoveSourceIdentifierFromSubscription(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("SourceNotFound", errorCode): + return awsAwsquery_deserializeErrorSourceNotFoundFault(response, errorBody) + + case strings.EqualFold("SubscriptionNotFound", errorCode): + return awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRemoveTagsFromResource struct { +} + +func (*awsAwsquery_deserializeOpRemoveTagsFromResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRemoveTagsFromResource) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRemoveTagsFromResource(response, &metadata) + } + output := &RemoveTagsFromResourceOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRemoveTagsFromResource(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyNotFoundFault(response, errorBody) + + case strings.EqualFold("DBProxyTargetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotTenantDatabaseNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotTenantDatabaseNotFoundFault(response, errorBody) + + case strings.EqualFold("IntegrationNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorIntegrationNotFoundFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseNotFound", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpResetDBClusterParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpResetDBClusterParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpResetDBClusterParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorResetDBClusterParameterGroup(response, &metadata) + } + output := &ResetDBClusterParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ResetDBClusterParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentResetDBClusterParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorResetDBClusterParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpResetDBParameterGroup struct { +} + +func (*awsAwsquery_deserializeOpResetDBParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpResetDBParameterGroup) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorResetDBParameterGroup(response, &metadata) + } + output := &ResetDBParameterGroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("ResetDBParameterGroupResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentResetDBParameterGroupOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorResetDBParameterGroup(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBParameterGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBClusterFromS3 struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBClusterFromS3) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBClusterFromS3) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBClusterFromS3(response, &metadata) + } + output := &RestoreDBClusterFromS3Output{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBClusterFromS3Result") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBClusterFromS3Output(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBClusterFromS3(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientStorageClusterCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientStorageClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSubnetGroupStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response, errorBody) + + case strings.EqualFold("InvalidS3BucketFault", errorCode): + return awsAwsquery_deserializeErrorInvalidS3BucketFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBClusterFromSnapshot struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBClusterFromSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBClusterFromSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBClusterFromSnapshot(response, &metadata) + } + output := &RestoreDBClusterFromSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBClusterFromSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBClusterFromSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBClusterFromSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientDBClusterCapacityFault", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InsufficientStorageClusterCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientStorageClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidRestoreFault", errorCode): + return awsAwsquery_deserializeErrorInvalidRestoreFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBClusterToPointInTime struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBClusterToPointInTime) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBClusterToPointInTime) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBClusterToPointInTime(response, &metadata) + } + output := &RestoreDBClusterToPointInTimeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBClusterToPointInTimeResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBClusterToPointInTimeOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBClusterToPointInTime(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterAlreadyExistsFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBClusterAutomatedBackupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterAutomatedBackupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterQuotaExceededFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientDBClusterCapacityFault", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InsufficientStorageClusterCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientStorageClusterCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterSnapshotStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidRestoreFault", errorCode): + return awsAwsquery_deserializeErrorInvalidRestoreFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBInstanceFromDBSnapshot struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBInstanceFromDBSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBInstanceFromDBSnapshot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBInstanceFromDBSnapshot(response, &metadata) + } + output := &RestoreDBInstanceFromDBSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBInstanceFromDBSnapshotResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBInstanceFromDBSnapshotOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBInstanceFromDBSnapshot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("BackupPolicyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBSnapshotState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response, errorBody) + + case strings.EqualFold("InvalidRestoreFault", errorCode): + return awsAwsquery_deserializeErrorInvalidRestoreFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBInstanceFromS3 struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBInstanceFromS3) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBInstanceFromS3) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBInstanceFromS3(response, &metadata) + } + output := &RestoreDBInstanceFromS3Output{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBInstanceFromS3Result") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBInstanceFromS3Output(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBInstanceFromS3(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("BackupPolicyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidS3BucketFault", errorCode): + return awsAwsquery_deserializeErrorInvalidS3BucketFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRestoreDBInstanceToPointInTime struct { +} + +func (*awsAwsquery_deserializeOpRestoreDBInstanceToPointInTime) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRestoreDBInstanceToPointInTime) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRestoreDBInstanceToPointInTime(response, &metadata) + } + output := &RestoreDBInstanceToPointInTimeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RestoreDBInstanceToPointInTimeResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRestoreDBInstanceToPointInTimeOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRestoreDBInstanceToPointInTime(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("BackupPolicyNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response, errorBody) + + case strings.EqualFold("CertificateNotFound", errorCode): + return awsAwsquery_deserializeErrorCertificateNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("DBInstanceAutomatedBackupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAutomatedBackupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBParameterGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("DomainNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDomainNotFoundFault(response, errorBody) + + case strings.EqualFold("InstanceQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidRestoreFault", errorCode): + return awsAwsquery_deserializeErrorInvalidRestoreFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("NetworkTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorNetworkTypeNotSupported(response, errorBody) + + case strings.EqualFold("OptionGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("PointInTimeRestoreNotEnabled", errorCode): + return awsAwsquery_deserializeErrorPointInTimeRestoreNotEnabledFault(response, errorBody) + + case strings.EqualFold("ProvisionedIopsNotAvailableInAZFault", errorCode): + return awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response, errorBody) + + case strings.EqualFold("StorageQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorStorageQuotaExceededFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + case strings.EqualFold("TenantDatabaseQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpRevokeDBSecurityGroupIngress struct { +} + +func (*awsAwsquery_deserializeOpRevokeDBSecurityGroupIngress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpRevokeDBSecurityGroupIngress) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorRevokeDBSecurityGroupIngress(response, &metadata) + } + output := &RevokeDBSecurityGroupIngressOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("RevokeDBSecurityGroupIngressResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentRevokeDBSecurityGroupIngressOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorRevokeDBSecurityGroupIngress(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSecurityGroupNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBSecurityGroupState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStartActivityStream struct { +} + +func (*awsAwsquery_deserializeOpStartActivityStream) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStartActivityStream) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStartActivityStream(response, &metadata) + } + output := &StartActivityStreamOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StartActivityStreamResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStartActivityStreamOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStartActivityStream(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStartDBCluster struct { +} + +func (*awsAwsquery_deserializeOpStartDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStartDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStartDBCluster(response, &metadata) + } + output := &StartDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StartDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStartDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStartDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStartDBInstance struct { +} + +func (*awsAwsquery_deserializeOpStartDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStartDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStartDBInstance(response, &metadata) + } + output := &StartDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StartDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStartDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStartDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("AuthorizationNotFound", errorCode): + return awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSubnetGroupDoesNotCoverEnoughAZs", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response, errorBody) + + case strings.EqualFold("DBSubnetGroupNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response, errorBody) + + case strings.EqualFold("InsufficientDBInstanceCapacity", errorCode): + return awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("InvalidSubnet", errorCode): + return awsAwsquery_deserializeErrorInvalidSubnet(response, errorBody) + + case strings.EqualFold("InvalidVPCNetworkStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStartDBInstanceAutomatedBackupsReplication struct { +} + +func (*awsAwsquery_deserializeOpStartDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStartDBInstanceAutomatedBackupsReplication) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStartDBInstanceAutomatedBackupsReplication(response, &metadata) + } + output := &StartDBInstanceAutomatedBackupsReplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StartDBInstanceAutomatedBackupsReplicationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStartDBInstanceAutomatedBackupsReplicationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStartDBInstanceAutomatedBackupsReplication(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceAutomatedBackupQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorDBInstanceAutomatedBackupQuotaExceededFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + case strings.EqualFold("StorageTypeNotSupported", errorCode): + return awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStartExportTask struct { +} + +func (*awsAwsquery_deserializeOpStartExportTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStartExportTask) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStartExportTask(response, &metadata) + } + output := &StartExportTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StartExportTaskResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStartExportTaskOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStartExportTask(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBClusterSnapshotNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotNotFound", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response, errorBody) + + case strings.EqualFold("ExportTaskAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorExportTaskAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("IamRoleMissingPermissions", errorCode): + return awsAwsquery_deserializeErrorIamRoleMissingPermissionsFault(response, errorBody) + + case strings.EqualFold("IamRoleNotFound", errorCode): + return awsAwsquery_deserializeErrorIamRoleNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidExportOnly", errorCode): + return awsAwsquery_deserializeErrorInvalidExportOnlyFault(response, errorBody) + + case strings.EqualFold("InvalidExportSourceState", errorCode): + return awsAwsquery_deserializeErrorInvalidExportSourceStateFault(response, errorBody) + + case strings.EqualFold("InvalidS3BucketFault", errorCode): + return awsAwsquery_deserializeErrorInvalidS3BucketFault(response, errorBody) + + case strings.EqualFold("KMSKeyNotAccessibleFault", errorCode): + return awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStopActivityStream struct { +} + +func (*awsAwsquery_deserializeOpStopActivityStream) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStopActivityStream) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStopActivityStream(response, &metadata) + } + output := &StopActivityStreamOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StopActivityStreamResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStopActivityStreamOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStopActivityStream(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("ResourceNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorResourceNotFoundFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStopDBCluster struct { +} + +func (*awsAwsquery_deserializeOpStopDBCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStopDBCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStopDBCluster(response, &metadata) + } + output := &StopDBClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StopDBClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStopDBClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStopDBCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStopDBInstance struct { +} + +func (*awsAwsquery_deserializeOpStopDBInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStopDBInstance) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStopDBInstance(response, &metadata) + } + output := &StopDBInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StopDBInstanceResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStopDBInstanceOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStopDBInstance(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("DBSnapshotAlreadyExists", errorCode): + return awsAwsquery_deserializeErrorDBSnapshotAlreadyExistsFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + case strings.EqualFold("SnapshotQuotaExceeded", errorCode): + return awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpStopDBInstanceAutomatedBackupsReplication struct { +} + +func (*awsAwsquery_deserializeOpStopDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpStopDBInstanceAutomatedBackupsReplication) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorStopDBInstanceAutomatedBackupsReplication(response, &metadata) + } + output := &StopDBInstanceAutomatedBackupsReplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("StopDBInstanceAutomatedBackupsReplicationResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentStopDBInstanceAutomatedBackupsReplicationOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorStopDBInstanceAutomatedBackupsReplication(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSwitchoverBlueGreenDeployment struct { +} + +func (*awsAwsquery_deserializeOpSwitchoverBlueGreenDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSwitchoverBlueGreenDeployment) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorSwitchoverBlueGreenDeployment(response, &metadata) + } + output := &SwitchoverBlueGreenDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("SwitchoverBlueGreenDeploymentResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSwitchoverBlueGreenDeploymentOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorSwitchoverBlueGreenDeployment(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("BlueGreenDeploymentNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidBlueGreenDeploymentStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidBlueGreenDeploymentStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSwitchoverGlobalCluster struct { +} + +func (*awsAwsquery_deserializeOpSwitchoverGlobalCluster) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSwitchoverGlobalCluster) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorSwitchoverGlobalCluster(response, &metadata) + } + output := &SwitchoverGlobalClusterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("SwitchoverGlobalClusterResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSwitchoverGlobalClusterOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorSwitchoverGlobalCluster(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorDBClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("GlobalClusterNotFoundFault", errorCode): + return awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response, errorBody) + + case strings.EqualFold("InvalidGlobalClusterStateFault", errorCode): + return awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpSwitchoverReadReplica struct { +} + +func (*awsAwsquery_deserializeOpSwitchoverReadReplica) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSwitchoverReadReplica) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorSwitchoverReadReplica(response, &metadata) + } + output := &SwitchoverReadReplicaOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("SwitchoverReadReplicaResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSwitchoverReadReplicaOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorSwitchoverReadReplica(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsquery_deserializeErrorAuthorizationAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AuthorizationAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAuthorizationAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorAuthorizationNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AuthorizationNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAuthorizationNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorAuthorizationQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AuthorizationQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentAuthorizationQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorBackupPolicyNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BackupPolicyNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentBackupPolicyNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorBlueGreenDeploymentAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BlueGreenDeploymentAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentBlueGreenDeploymentAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorBlueGreenDeploymentNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BlueGreenDeploymentNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentBlueGreenDeploymentNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCertificateNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CertificateNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCertificateNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCreateCustomDBEngineVersionFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CreateCustomDBEngineVersionFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCreateCustomDBEngineVersionFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomAvailabilityZoneNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomAvailabilityZoneNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomAvailabilityZoneNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomDBEngineVersionAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomDBEngineVersionAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomDBEngineVersionAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomDBEngineVersionNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomDBEngineVersionNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomDBEngineVersionNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorCustomDBEngineVersionQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CustomDBEngineVersionQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentCustomDBEngineVersionQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterAutomatedBackupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterAutomatedBackupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterAutomatedBackupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterAutomatedBackupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterAutomatedBackupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterAutomatedBackupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterBacktrackNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterBacktrackNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterBacktrackNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterEndpointAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterEndpointAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterEndpointAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterEndpointNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterEndpointNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterEndpointNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterEndpointQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterEndpointQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterEndpointQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterParameterGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterParameterGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterParameterGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterRoleAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterRoleAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterRoleAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterRoleNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterRoleNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterRoleNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterRoleQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterRoleQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterRoleQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterSnapshotAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterSnapshotAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterSnapshotAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBClusterSnapshotNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBClusterSnapshotNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBClusterSnapshotNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceAutomatedBackupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceAutomatedBackupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceAutomatedBackupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceAutomatedBackupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceNotReadyFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceNotReadyFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceNotReadyFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceRoleAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceRoleAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceRoleAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceRoleNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceRoleNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceRoleNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBInstanceRoleQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBInstanceRoleQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBInstanceRoleQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBLogFileNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBLogFileNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBLogFileNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBParameterGroupAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBParameterGroupAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBParameterGroupAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBParameterGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBParameterGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBParameterGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBParameterGroupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBParameterGroupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBParameterGroupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyEndpointAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyEndpointAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyEndpointAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyEndpointNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyEndpointNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyEndpointNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyEndpointQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyEndpointQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyEndpointQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyTargetAlreadyRegisteredFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyTargetAlreadyRegisteredFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyTargetAlreadyRegisteredFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyTargetGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyTargetGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyTargetGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBProxyTargetNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBProxyTargetNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBProxyTargetNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSecurityGroupAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSecurityGroupAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSecurityGroupAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSecurityGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSecurityGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSecurityGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSecurityGroupNotSupportedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSecurityGroupNotSupportedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSecurityGroupNotSupportedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSecurityGroupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSecurityGroupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSecurityGroupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBShardGroupAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBShardGroupAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBShardGroupAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBShardGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBShardGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBShardGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSnapshotAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSnapshotAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSnapshotAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSnapshotNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSnapshotNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSnapshotNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSnapshotTenantDatabaseNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSnapshotTenantDatabaseNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSnapshotTenantDatabaseNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetGroupAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetGroupAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetGroupAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetGroupDoesNotCoverEnoughAZs(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetGroupDoesNotCoverEnoughAZs{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetGroupDoesNotCoverEnoughAZs(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetGroupNotAllowedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetGroupNotAllowedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetGroupNotAllowedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetGroupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetGroupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetGroupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBSubnetQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBSubnetQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBSubnetQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDBUpgradeDependencyFailureFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DBUpgradeDependencyFailureFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDBUpgradeDependencyFailureFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorDomainNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DomainNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentDomainNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorEc2ImagePropertiesNotSupportedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.Ec2ImagePropertiesNotSupportedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentEc2ImagePropertiesNotSupportedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorEventSubscriptionQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EventSubscriptionQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentEventSubscriptionQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorExportTaskAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExportTaskAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentExportTaskAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorExportTaskNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExportTaskNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentExportTaskNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorGlobalClusterAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.GlobalClusterAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentGlobalClusterAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorGlobalClusterNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.GlobalClusterNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentGlobalClusterNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorGlobalClusterQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.GlobalClusterQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentGlobalClusterQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIamRoleMissingPermissionsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IamRoleMissingPermissionsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIamRoleMissingPermissionsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIamRoleNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IamRoleNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIamRoleNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInstanceQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InstanceQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInstanceQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInsufficientAvailableIPsInSubnetFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InsufficientAvailableIPsInSubnetFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInsufficientAvailableIPsInSubnetFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInsufficientDBClusterCapacityFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InsufficientDBClusterCapacityFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInsufficientDBClusterCapacityFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInsufficientDBInstanceCapacityFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InsufficientDBInstanceCapacityFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInsufficientDBInstanceCapacityFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInsufficientStorageClusterCapacityFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InsufficientStorageClusterCapacityFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInsufficientStorageClusterCapacityFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIntegrationAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IntegrationAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIntegrationAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIntegrationConflictOperationFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IntegrationConflictOperationFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIntegrationConflictOperationFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIntegrationNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IntegrationNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIntegrationNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIntegrationQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IntegrationQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIntegrationQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidBlueGreenDeploymentStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidBlueGreenDeploymentStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidBlueGreenDeploymentStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidCustomDBEngineVersionStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidCustomDBEngineVersionStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidCustomDBEngineVersionStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBClusterAutomatedBackupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBClusterAutomatedBackupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBClusterAutomatedBackupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBClusterCapacityFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBClusterCapacityFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBClusterCapacityFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBClusterEndpointStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBClusterEndpointStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBClusterEndpointStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBClusterSnapshotStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBClusterSnapshotStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBClusterSnapshotStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBClusterStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBClusterStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBClusterStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBInstanceAutomatedBackupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBInstanceAutomatedBackupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBInstanceAutomatedBackupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBInstanceStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBInstanceStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBParameterGroupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBParameterGroupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBParameterGroupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBProxyEndpointStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBProxyEndpointStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBProxyEndpointStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBProxyStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBProxyStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBProxyStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBSecurityGroupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBSecurityGroupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBSecurityGroupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBShardGroupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBShardGroupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBShardGroupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBSnapshotStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBSnapshotStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBSnapshotStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBSubnetGroupFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBSubnetGroupFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBSubnetGroupFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBSubnetGroupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBSubnetGroupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBSubnetGroupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidDBSubnetStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDBSubnetStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidDBSubnetStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidEventSubscriptionStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidEventSubscriptionStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidEventSubscriptionStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidExportOnlyFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidExportOnlyFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidExportOnlyFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidExportSourceStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidExportSourceStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidExportSourceStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidExportTaskStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidExportTaskStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidExportTaskStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidGlobalClusterStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidGlobalClusterStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidGlobalClusterStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidIntegrationStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidIntegrationStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidIntegrationStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidOptionGroupStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidOptionGroupStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidOptionGroupStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidResourceStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidResourceStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidResourceStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidRestoreFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRestoreFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidRestoreFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidS3BucketFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidS3BucketFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidS3BucketFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidSubnet(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSubnet{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidSubnet(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidVPCNetworkStateFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidVPCNetworkStateFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidVPCNetworkStateFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorKMSKeyNotAccessibleFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.KMSKeyNotAccessibleFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentKMSKeyNotAccessibleFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorMaxDBShardGroupLimitReached(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MaxDBShardGroupLimitReached{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentMaxDBShardGroupLimitReached(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorNetworkTypeNotSupported(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NetworkTypeNotSupported{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentNetworkTypeNotSupported(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorOptionGroupAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OptionGroupAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentOptionGroupAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorOptionGroupNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OptionGroupNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentOptionGroupNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorOptionGroupQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OptionGroupQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentOptionGroupQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorPointInTimeRestoreNotEnabledFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PointInTimeRestoreNotEnabledFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentPointInTimeRestoreNotEnabledFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorProvisionedIopsNotAvailableInAZFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ProvisionedIopsNotAvailableInAZFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentProvisionedIopsNotAvailableInAZFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorReservedDBInstanceAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ReservedDBInstanceAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentReservedDBInstanceAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorReservedDBInstanceNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ReservedDBInstanceNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentReservedDBInstanceNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorReservedDBInstanceQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ReservedDBInstanceQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentReservedDBInstanceQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorReservedDBInstancesOfferingNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ReservedDBInstancesOfferingNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentReservedDBInstancesOfferingNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorResourceNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentResourceNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSharedSnapshotQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SharedSnapshotQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSharedSnapshotQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSnapshotQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SnapshotQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSnapshotQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSNSInvalidTopicFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SNSInvalidTopicFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSNSInvalidTopicFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSNSNoAuthorizationFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SNSNoAuthorizationFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSNSNoAuthorizationFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSNSTopicArnNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SNSTopicArnNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSNSTopicArnNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSourceClusterNotSupportedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SourceClusterNotSupportedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSourceClusterNotSupportedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSourceDatabaseNotSupportedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SourceDatabaseNotSupportedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSourceDatabaseNotSupportedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSourceNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SourceNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSourceNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorStorageQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.StorageQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentStorageQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorStorageTypeNotAvailableFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.StorageTypeNotAvailableFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentStorageTypeNotAvailableFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorStorageTypeNotSupportedFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.StorageTypeNotSupportedFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentStorageTypeNotSupportedFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSubnetAlreadyInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubnetAlreadyInUse{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSubnetAlreadyInUse(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSubscriptionAlreadyExistFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubscriptionAlreadyExistFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSubscriptionAlreadyExistFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSubscriptionCategoryNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubscriptionCategoryNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSubscriptionCategoryNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSubscriptionNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SubscriptionNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSubscriptionNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTenantDatabaseAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TenantDatabaseAlreadyExistsFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTenantDatabaseAlreadyExistsFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTenantDatabaseNotFoundFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TenantDatabaseNotFoundFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTenantDatabaseNotFoundFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorTenantDatabaseQuotaExceededFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TenantDatabaseQuotaExceededFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentTenantDatabaseQuotaExceededFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorUnsupportedDBEngineVersionFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedDBEngineVersionFault{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentUnsupportedDBEngineVersionFault(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeDocumentAccountQuota(v **types.AccountQuota, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccountQuota + if *v == nil { + sv = &types.AccountQuota{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AccountQuotaName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccountQuotaName = ptr.String(xtv) + } + + case strings.EqualFold("Max", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Max = ptr.Int64(i64) + } + + case strings.EqualFold("Used", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Used = ptr.Int64(i64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAccountQuotaList(v *[]types.AccountQuota, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AccountQuota + if *v == nil { + sv = make([]types.AccountQuota, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("AccountQuota", t.Name.Local): + var col types.AccountQuota + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAccountQuota(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAccountQuotaListUnwrapped(v *[]types.AccountQuota, decoder smithyxml.NodeDecoder) error { + var sv []types.AccountQuota + if *v == nil { + sv = make([]types.AccountQuota, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AccountQuota + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAccountQuota(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentActivityStreamModeList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentActivityStreamModeListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAttributeValueList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("AttributeValue", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAttributeValueListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAuthorizationAlreadyExistsFault(v **types.AuthorizationAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthorizationAlreadyExistsFault + if *v == nil { + sv = &types.AuthorizationAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthorizationNotFoundFault(v **types.AuthorizationNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthorizationNotFoundFault + if *v == nil { + sv = &types.AuthorizationNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAuthorizationQuotaExceededFault(v **types.AuthorizationQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AuthorizationQuotaExceededFault + if *v == nil { + sv = &types.AuthorizationQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AvailabilityZone + if *v == nil { + sv = &types.AvailabilityZone{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailabilityZoneList(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AvailabilityZone + if *v == nil { + sv = make([]types.AvailabilityZone, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("AvailabilityZone", t.Name.Local): + var col types.AvailabilityZone + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailabilityZoneListUnwrapped(v *[]types.AvailabilityZone, decoder smithyxml.NodeDecoder) error { + var sv []types.AvailabilityZone + if *v == nil { + sv = make([]types.AvailabilityZone, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AvailabilityZone + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAvailabilityZone(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAvailabilityZones(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("AvailabilityZone", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailabilityZonesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentAvailableProcessorFeature(v **types.AvailableProcessorFeature, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AvailableProcessorFeature + if *v == nil { + sv = &types.AvailableProcessorFeature{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowedValues", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AllowedValues = ptr.String(xtv) + } + + case strings.EqualFold("DefaultValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultValue = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailableProcessorFeatureList(v *[]types.AvailableProcessorFeature, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.AvailableProcessorFeature + if *v == nil { + sv = make([]types.AvailableProcessorFeature, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("AvailableProcessorFeature", t.Name.Local): + var col types.AvailableProcessorFeature + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentAvailableProcessorFeature(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentAvailableProcessorFeatureListUnwrapped(v *[]types.AvailableProcessorFeature, decoder smithyxml.NodeDecoder) error { + var sv []types.AvailableProcessorFeature + if *v == nil { + sv = make([]types.AvailableProcessorFeature, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.AvailableProcessorFeature + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentAvailableProcessorFeature(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentBackupPolicyNotFoundFault(v **types.BackupPolicyNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BackupPolicyNotFoundFault + if *v == nil { + sv = &types.BackupPolicyNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeployment(v **types.BlueGreenDeployment, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BlueGreenDeployment + if *v == nil { + sv = &types.BlueGreenDeployment{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BlueGreenDeploymentIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BlueGreenDeploymentIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("BlueGreenDeploymentName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BlueGreenDeploymentName = ptr.String(xtv) + } + + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("DeleteTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.DeleteTime = ptr.Time(t) + } + + case strings.EqualFold("Source", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Source = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StatusDetails", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusDetails = ptr.String(xtv) + } + + case strings.EqualFold("SwitchoverDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSwitchoverDetailList(&sv.SwitchoverDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Target", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Target = ptr.String(xtv) + } + + case strings.EqualFold("Tasks", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBlueGreenDeploymentTaskList(&sv.Tasks, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentAlreadyExistsFault(v **types.BlueGreenDeploymentAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BlueGreenDeploymentAlreadyExistsFault + if *v == nil { + sv = &types.BlueGreenDeploymentAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentList(v *[]types.BlueGreenDeployment, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.BlueGreenDeployment + if *v == nil { + sv = make([]types.BlueGreenDeployment, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.BlueGreenDeployment + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentBlueGreenDeployment(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentListUnwrapped(v *[]types.BlueGreenDeployment, decoder smithyxml.NodeDecoder) error { + var sv []types.BlueGreenDeployment + if *v == nil { + sv = make([]types.BlueGreenDeployment, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.BlueGreenDeployment + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentBlueGreenDeployment(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentBlueGreenDeploymentNotFoundFault(v **types.BlueGreenDeploymentNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BlueGreenDeploymentNotFoundFault + if *v == nil { + sv = &types.BlueGreenDeploymentNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentTask(v **types.BlueGreenDeploymentTask, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.BlueGreenDeploymentTask + if *v == nil { + sv = &types.BlueGreenDeploymentTask{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentTaskList(v *[]types.BlueGreenDeploymentTask, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.BlueGreenDeploymentTask + if *v == nil { + sv = make([]types.BlueGreenDeploymentTask, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.BlueGreenDeploymentTask + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentBlueGreenDeploymentTask(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentBlueGreenDeploymentTaskListUnwrapped(v *[]types.BlueGreenDeploymentTask, decoder smithyxml.NodeDecoder) error { + var sv []types.BlueGreenDeploymentTask + if *v == nil { + sv = make([]types.BlueGreenDeploymentTask, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.BlueGreenDeploymentTask + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentBlueGreenDeploymentTask(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCACertificateIdentifiersList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCACertificateIdentifiersListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCertificate(v **types.Certificate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Certificate + if *v == nil { + sv = &types.Certificate{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CertificateArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CertificateArn = ptr.String(xtv) + } + + case strings.EqualFold("CertificateIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CertificateIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("CertificateType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CertificateType = ptr.String(xtv) + } + + case strings.EqualFold("CustomerOverride", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CustomerOverride = ptr.Bool(xtv) + } + + case strings.EqualFold("CustomerOverrideValidTill", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CustomerOverrideValidTill = ptr.Time(t) + } + + case strings.EqualFold("Thumbprint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Thumbprint = ptr.String(xtv) + } + + case strings.EqualFold("ValidFrom", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ValidFrom = ptr.Time(t) + } + + case strings.EqualFold("ValidTill", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ValidTill = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCertificateDetails(v **types.CertificateDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CertificateDetails + if *v == nil { + sv = &types.CertificateDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CAIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CAIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("ValidTill", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ValidTill = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCertificateList(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Certificate + if *v == nil { + sv = make([]types.Certificate, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Certificate", t.Name.Local): + var col types.Certificate + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCertificate(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCertificateListUnwrapped(v *[]types.Certificate, decoder smithyxml.NodeDecoder) error { + var sv []types.Certificate + if *v == nil { + sv = make([]types.Certificate, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Certificate + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCertificate(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCertificateNotFoundFault(v **types.CertificateNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CertificateNotFoundFault + if *v == nil { + sv = &types.CertificateNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCharacterSet(v **types.CharacterSet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CharacterSet + if *v == nil { + sv = &types.CharacterSet{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CharacterSetDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetDescription = ptr.String(xtv) + } + + case strings.EqualFold("CharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentClusterPendingModifiedValues(v **types.ClusterPendingModifiedValues, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ClusterPendingModifiedValues + if *v == nil { + sv = &types.ClusterPendingModifiedValues{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("CertificateDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateDetails(&sv.CertificateDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MasterUserPassword", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUserPassword = ptr.String(xtv) + } + + case strings.EqualFold("PendingCloudwatchLogsExports", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingCloudwatchLogsExports(&sv.PendingCloudwatchLogsExports, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("RdsCustomClusterConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(&sv.RdsCustomClusterConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentConnectionPoolConfigurationInfo(v **types.ConnectionPoolConfigurationInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConnectionPoolConfigurationInfo + if *v == nil { + sv = &types.ConnectionPoolConfigurationInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ConnectionBorrowTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ConnectionBorrowTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("InitQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InitQuery = ptr.String(xtv) + } + + case strings.EqualFold("MaxConnectionsPercent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxConnectionsPercent = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MaxIdleConnectionsPercent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxIdleConnectionsPercent = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionPinningFilters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.SessionPinningFilters, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentContextAttribute(v **types.ContextAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContextAttribute + if *v == nil { + sv = &types.ContextAttribute{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentContextAttributeList(v *[]types.ContextAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ContextAttribute + if *v == nil { + sv = make([]types.ContextAttribute, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.ContextAttribute + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentContextAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentContextAttributeListUnwrapped(v *[]types.ContextAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.ContextAttribute + if *v == nil { + sv = make([]types.ContextAttribute, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ContextAttribute + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentContextAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentCreateCustomDBEngineVersionFault(v **types.CreateCustomDBEngineVersionFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CreateCustomDBEngineVersionFault + if *v == nil { + sv = &types.CreateCustomDBEngineVersionFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomAvailabilityZoneNotFoundFault(v **types.CustomAvailabilityZoneNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomAvailabilityZoneNotFoundFault + if *v == nil { + sv = &types.CustomAvailabilityZoneNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomDBEngineVersionAlreadyExistsFault(v **types.CustomDBEngineVersionAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomDBEngineVersionAlreadyExistsFault + if *v == nil { + sv = &types.CustomDBEngineVersionAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomDBEngineVersionAMI(v **types.CustomDBEngineVersionAMI, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomDBEngineVersionAMI + if *v == nil { + sv = &types.CustomDBEngineVersionAMI{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ImageId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ImageId = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomDBEngineVersionNotFoundFault(v **types.CustomDBEngineVersionNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomDBEngineVersionNotFoundFault + if *v == nil { + sv = &types.CustomDBEngineVersionNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCustomDBEngineVersionQuotaExceededFault(v **types.CustomDBEngineVersionQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CustomDBEngineVersionQuotaExceededFault + if *v == nil { + sv = &types.CustomDBEngineVersionQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBCluster(v **types.DBCluster, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBCluster + if *v == nil { + sv = &types.DBCluster{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ActivityStreamKinesisStreamName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamKinesisStreamName = ptr.String(xtv) + } + + case strings.EqualFold("ActivityStreamKmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamKmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("ActivityStreamMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamMode = types.ActivityStreamMode(xtv) + } + + case strings.EqualFold("ActivityStreamStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamStatus = types.ActivityStreamStatus(xtv) + } + + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AssociatedRoles", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterRoles(&sv.AssociatedRoles, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AutomaticRestartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.AutomaticRestartTime = ptr.Time(t) + } + + case strings.EqualFold("AutoMinorVersionUpgrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.AutoMinorVersionUpgrade = ptr.Bool(xtv) + } + + case strings.EqualFold("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AwsBackupRecoveryPointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AwsBackupRecoveryPointArn = ptr.String(xtv) + } + + case strings.EqualFold("BacktrackConsumedChangeRecords", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BacktrackConsumedChangeRecords = ptr.Int64(i64) + } + + case strings.EqualFold("BacktrackWindow", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BacktrackWindow = ptr.Int64(i64) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Capacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Capacity = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("CertificateDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateDetails(&sv.CertificateDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("CloneGroupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CloneGroupId = ptr.String(xtv) + } + + case strings.EqualFold("ClusterCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ClusterCreateTime = ptr.Time(t) + } + + case strings.EqualFold("ClusterScalabilityType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ClusterScalabilityType = types.ClusterScalabilityType(xtv) + } + + case strings.EqualFold("CopyTagsToSnapshot", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CopyTagsToSnapshot = ptr.Bool(xtv) + } + + case strings.EqualFold("CrossAccountClone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CrossAccountClone = ptr.Bool(xtv) + } + + case strings.EqualFold("CustomEndpoints", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.CustomEndpoints, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DatabaseInsightsMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInsightsMode = types.DatabaseInsightsMode(xtv) + } + + case strings.EqualFold("DatabaseName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseName = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterMemberList(&sv.DBClusterMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBClusterOptionGroupMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterOptionGroupMemberships(&sv.DBClusterOptionGroupMemberships, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBClusterParameterGroup", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroup = ptr.String(xtv) + } + + case strings.EqualFold("DbClusterResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbClusterResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DBSubnetGroup", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSubnetGroup = ptr.String(xtv) + } + + case strings.EqualFold("DBSystemId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSystemId = ptr.String(xtv) + } + + case strings.EqualFold("DeletionProtection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DeletionProtection = ptr.Bool(xtv) + } + + case strings.EqualFold("DomainMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDomainMembershipList(&sv.DomainMemberships, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EarliestBacktrackTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.EarliestBacktrackTime = ptr.Time(t) + } + + case strings.EqualFold("EarliestRestorableTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.EarliestRestorableTime = ptr.Time(t) + } + + case strings.EqualFold("EnabledCloudwatchLogsExports", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.EnabledCloudwatchLogsExports, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineLifecycleSupport", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineLifecycleSupport = ptr.String(xtv) + } + + case strings.EqualFold("EngineMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineMode = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("GlobalWriteForwardingRequested", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.GlobalWriteForwardingRequested = ptr.Bool(xtv) + } + + case strings.EqualFold("GlobalWriteForwardingStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GlobalWriteForwardingStatus = types.WriteForwardingStatus(xtv) + } + + case strings.EqualFold("HostedZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneId = ptr.String(xtv) + } + + case strings.EqualFold("HttpEndpointEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.HttpEndpointEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("IOOptimizedNextAllowedModificationTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.IOOptimizedNextAllowedModificationTime = ptr.Time(t) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LatestRestorableTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LatestRestorableTime = ptr.Time(t) + } + + case strings.EqualFold("LimitlessDatabase", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLimitlessDatabase(&sv.LimitlessDatabase, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LocalWriteForwardingStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LocalWriteForwardingStatus = types.LocalWriteForwardingStatus(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("MasterUserSecret", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMasterUserSecret(&sv.MasterUserSecret, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MonitoringInterval", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MonitoringInterval = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MonitoringRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MonitoringRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiAZ = ptr.Bool(xtv) + } + + case strings.EqualFold("NetworkType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkType = ptr.String(xtv) + } + + case strings.EqualFold("PendingModifiedValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentClusterPendingModifiedValues(&sv.PendingModifiedValues, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PercentProgress = ptr.String(xtv) + } + + case strings.EqualFold("PerformanceInsightsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PerformanceInsightsEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("PerformanceInsightsKMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PerformanceInsightsKMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("PerformanceInsightsRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PerformanceInsightsRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("PreferredBackupWindow", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PreferredBackupWindow = ptr.String(xtv) + } + + case strings.EqualFold("PreferredMaintenanceWindow", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PreferredMaintenanceWindow = ptr.String(xtv) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("RdsCustomClusterConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(&sv.RdsCustomClusterConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReaderEndpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReaderEndpoint = ptr.String(xtv) + } + + case strings.EqualFold("ReadReplicaIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReadReplicaIdentifierList(&sv.ReadReplicaIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReplicationSourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReplicationSourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("ScalingConfigurationInfo", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentScalingConfigurationInfo(&sv.ScalingConfigurationInfo, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ServerlessV2ScalingConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServerlessV2ScalingConfigurationInfo(&sv.ServerlessV2ScalingConfiguration, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StatusInfos", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfoList(&sv.StatusInfos, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageEncrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.StorageEncrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcSecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVpcSecurityGroupMembershipList(&sv.VpcSecurityGroups, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterAlreadyExistsFault(v **types.DBClusterAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterAlreadyExistsFault + if *v == nil { + sv = &types.DBClusterAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterAutomatedBackup(v **types.DBClusterAutomatedBackup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterAutomatedBackup + if *v == nil { + sv = &types.DBClusterAutomatedBackup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AwsBackupRecoveryPointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AwsBackupRecoveryPointArn = ptr.String(xtv) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("ClusterCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ClusterCreateTime = ptr.Time(t) + } + + case strings.EqualFold("DBClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterAutomatedBackupsArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterAutomatedBackupsArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbClusterResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbClusterResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineMode = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Region", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Region = ptr.String(xtv) + } + + case strings.EqualFold("RestoreWindow", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRestoreWindow(&sv.RestoreWindow, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StorageEncrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.StorageEncrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterAutomatedBackupList(v *[]types.DBClusterAutomatedBackup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterAutomatedBackup + if *v == nil { + sv = make([]types.DBClusterAutomatedBackup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterAutomatedBackup", t.Name.Local): + var col types.DBClusterAutomatedBackup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterAutomatedBackup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterAutomatedBackupListUnwrapped(v *[]types.DBClusterAutomatedBackup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterAutomatedBackup + if *v == nil { + sv = make([]types.DBClusterAutomatedBackup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterAutomatedBackup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterAutomatedBackup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterAutomatedBackupNotFoundFault(v **types.DBClusterAutomatedBackupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterAutomatedBackupNotFoundFault + if *v == nil { + sv = &types.DBClusterAutomatedBackupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterAutomatedBackupQuotaExceededFault(v **types.DBClusterAutomatedBackupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterAutomatedBackupQuotaExceededFault + if *v == nil { + sv = &types.DBClusterAutomatedBackupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterBacktrack(v **types.DBClusterBacktrack, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterBacktrack + if *v == nil { + sv = &types.DBClusterBacktrack{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BacktrackedFrom", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackedFrom = ptr.Time(t) + } + + case strings.EqualFold("BacktrackIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BacktrackIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("BacktrackRequestCreationTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackRequestCreationTime = ptr.Time(t) + } + + case strings.EqualFold("BacktrackTo", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackTo = ptr.Time(t) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterBacktrackList(v *[]types.DBClusterBacktrack, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterBacktrack + if *v == nil { + sv = make([]types.DBClusterBacktrack, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterBacktrack", t.Name.Local): + var col types.DBClusterBacktrack + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterBacktrack(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterBacktrackListUnwrapped(v *[]types.DBClusterBacktrack, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterBacktrack + if *v == nil { + sv = make([]types.DBClusterBacktrack, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterBacktrack + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterBacktrack(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterBacktrackNotFoundFault(v **types.DBClusterBacktrackNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterBacktrackNotFoundFault + if *v == nil { + sv = &types.DBClusterBacktrackNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterEndpoint(v **types.DBClusterEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterEndpoint + if *v == nil { + sv = &types.DBClusterEndpoint{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CustomEndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomEndpointType = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointResourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointResourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("EndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EndpointType = ptr.String(xtv) + } + + case strings.EqualFold("ExcludedMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExcludedMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StaticMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.StaticMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterEndpointAlreadyExistsFault(v **types.DBClusterEndpointAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterEndpointAlreadyExistsFault + if *v == nil { + sv = &types.DBClusterEndpointAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterEndpointList(v *[]types.DBClusterEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterEndpoint + if *v == nil { + sv = make([]types.DBClusterEndpoint, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterEndpointList", t.Name.Local): + var col types.DBClusterEndpoint + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterEndpointListUnwrapped(v *[]types.DBClusterEndpoint, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterEndpoint + if *v == nil { + sv = make([]types.DBClusterEndpoint, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterEndpoint + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterEndpointNotFoundFault(v **types.DBClusterEndpointNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterEndpointNotFoundFault + if *v == nil { + sv = &types.DBClusterEndpointNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterEndpointQuotaExceededFault(v **types.DBClusterEndpointQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterEndpointQuotaExceededFault + if *v == nil { + sv = &types.DBClusterEndpointQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterList(v *[]types.DBCluster, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBCluster + if *v == nil { + sv = make([]types.DBCluster, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + var col types.DBCluster + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBCluster(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterListUnwrapped(v *[]types.DBCluster, decoder smithyxml.NodeDecoder) error { + var sv []types.DBCluster + if *v == nil { + sv = make([]types.DBCluster, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBCluster + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBCluster(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterMember(v **types.DBClusterMember, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterMember + if *v == nil { + sv = &types.DBClusterMember{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroupStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroupStatus = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("IsClusterWriter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsClusterWriter = ptr.Bool(xtv) + } + + case strings.EqualFold("PromotionTier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PromotionTier = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterMemberList(v *[]types.DBClusterMember, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterMember + if *v == nil { + sv = make([]types.DBClusterMember, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterMember", t.Name.Local): + var col types.DBClusterMember + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterMember(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterMemberListUnwrapped(v *[]types.DBClusterMember, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterMember + if *v == nil { + sv = make([]types.DBClusterMember, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterMember + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterMember(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterNotFoundFault(v **types.DBClusterNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterNotFoundFault + if *v == nil { + sv = &types.DBClusterNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterOptionGroupMemberships(v *[]types.DBClusterOptionGroupStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterOptionGroupStatus + if *v == nil { + sv = make([]types.DBClusterOptionGroupStatus, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterOptionGroup", t.Name.Local): + var col types.DBClusterOptionGroupStatus + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterOptionGroupStatus(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterOptionGroupMembershipsUnwrapped(v *[]types.DBClusterOptionGroupStatus, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterOptionGroupStatus + if *v == nil { + sv = make([]types.DBClusterOptionGroupStatus, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterOptionGroupStatus + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterOptionGroupStatus(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterOptionGroupStatus(v **types.DBClusterOptionGroupStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterOptionGroupStatus + if *v == nil { + sv = &types.DBClusterOptionGroupStatus{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterOptionGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterOptionGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterParameterGroup(v **types.DBClusterParameterGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterParameterGroup + if *v == nil { + sv = &types.DBClusterParameterGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroupName = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterParameterGroupList(v *[]types.DBClusterParameterGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterParameterGroup + if *v == nil { + sv = make([]types.DBClusterParameterGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterParameterGroup", t.Name.Local): + var col types.DBClusterParameterGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterParameterGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterParameterGroupListUnwrapped(v *[]types.DBClusterParameterGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterParameterGroup + if *v == nil { + sv = make([]types.DBClusterParameterGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterParameterGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterParameterGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterParameterGroupNotFoundFault(v **types.DBClusterParameterGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterParameterGroupNotFoundFault + if *v == nil { + sv = &types.DBClusterParameterGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterQuotaExceededFault(v **types.DBClusterQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterQuotaExceededFault + if *v == nil { + sv = &types.DBClusterQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRole(v **types.DBClusterRole, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterRole + if *v == nil { + sv = &types.DBClusterRole{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("FeatureName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FeatureName = ptr.String(xtv) + } + + case strings.EqualFold("RoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RoleArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRoleAlreadyExistsFault(v **types.DBClusterRoleAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterRoleAlreadyExistsFault + if *v == nil { + sv = &types.DBClusterRoleAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRoleNotFoundFault(v **types.DBClusterRoleNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterRoleNotFoundFault + if *v == nil { + sv = &types.DBClusterRoleNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRoleQuotaExceededFault(v **types.DBClusterRoleQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterRoleQuotaExceededFault + if *v == nil { + sv = &types.DBClusterRoleQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRoles(v *[]types.DBClusterRole, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterRole + if *v == nil { + sv = make([]types.DBClusterRole, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterRole", t.Name.Local): + var col types.DBClusterRole + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterRole(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterRolesUnwrapped(v *[]types.DBClusterRole, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterRole + if *v == nil { + sv = make([]types.DBClusterRole, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterRole + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterRole(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterSnapshot(v **types.DBClusterSnapshot, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterSnapshot + if *v == nil { + sv = &types.DBClusterSnapshot{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ClusterCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ClusterCreateTime = ptr.Time(t) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbClusterResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbClusterResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterSnapshotArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterSnapshotArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterSnapshotIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBSystemId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSystemId = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineMode = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PercentProgress = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SnapshotCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotCreateTime = ptr.Time(t) + } + + case strings.EqualFold("SnapshotType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SnapshotType = ptr.String(xtv) + } + + case strings.EqualFold("SourceDBClusterSnapshotArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceDBClusterSnapshotArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StorageEncrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.StorageEncrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotAlreadyExistsFault(v **types.DBClusterSnapshotAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterSnapshotAlreadyExistsFault + if *v == nil { + sv = &types.DBClusterSnapshotAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotAttribute(v **types.DBClusterSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterSnapshotAttribute + if *v == nil { + sv = &types.DBClusterSnapshotAttribute{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AttributeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeName = ptr.String(xtv) + } + + case strings.EqualFold("AttributeValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAttributeValueList(&sv.AttributeValues, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotAttributeList(v *[]types.DBClusterSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterSnapshotAttribute + if *v == nil { + sv = make([]types.DBClusterSnapshotAttribute, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterSnapshotAttribute", t.Name.Local): + var col types.DBClusterSnapshotAttribute + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotAttributeListUnwrapped(v *[]types.DBClusterSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterSnapshotAttribute + if *v == nil { + sv = make([]types.DBClusterSnapshotAttribute, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterSnapshotAttribute + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterSnapshotAttributesResult(v **types.DBClusterSnapshotAttributesResult, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterSnapshotAttributesResult + if *v == nil { + sv = &types.DBClusterSnapshotAttributesResult{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshotAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotAttributeList(&sv.DBClusterSnapshotAttributes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBClusterSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterSnapshotIdentifier = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotList(v *[]types.DBClusterSnapshot, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterSnapshot + if *v == nil { + sv = make([]types.DBClusterSnapshot, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterSnapshot", t.Name.Local): + var col types.DBClusterSnapshot + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterSnapshot(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterSnapshotListUnwrapped(v *[]types.DBClusterSnapshot, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterSnapshot + if *v == nil { + sv = make([]types.DBClusterSnapshot, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterSnapshot + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterSnapshot(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBClusterSnapshotNotFoundFault(v **types.DBClusterSnapshotNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterSnapshotNotFoundFault + if *v == nil { + sv = &types.DBClusterSnapshotNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterStatusInfo(v **types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBClusterStatusInfo + if *v == nil { + sv = &types.DBClusterStatusInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Normal", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Normal = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StatusType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterStatusInfoList(v *[]types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBClusterStatusInfo + if *v == nil { + sv = make([]types.DBClusterStatusInfo, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBClusterStatusInfo", t.Name.Local): + var col types.DBClusterStatusInfo + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBClusterStatusInfoListUnwrapped(v *[]types.DBClusterStatusInfo, decoder smithyxml.NodeDecoder) error { + var sv []types.DBClusterStatusInfo + if *v == nil { + sv = make([]types.DBClusterStatusInfo, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBClusterStatusInfo + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBClusterStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBEngineVersion(v **types.DBEngineVersion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBEngineVersion + if *v == nil { + sv = &types.DBEngineVersion{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("CustomDBEngineVersionManifest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomDBEngineVersionManifest = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3BucketName = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineMediaType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineMediaType = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionArn = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("DefaultCharacterSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCharacterSet(&sv.DefaultCharacterSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ExportableLogTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.ExportableLogTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Image", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCustomDBEngineVersionAMI(&sv.Image, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ServerlessV2FeaturesSupport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServerlessV2FeaturesSupport(&sv.ServerlessV2FeaturesSupport, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SupportedCACertificateIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCACertificateIdentifiersList(&sv.SupportedCACertificateIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedFeatureNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFeatureNameList(&sv.SupportedFeatureNames, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNcharCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedNcharCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedTimezones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedTimezonesList(&sv.SupportedTimezones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsBabelfish", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsBabelfish = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsCertificateRotationWithoutRestart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsCertificateRotationWithoutRestart = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIntegrations", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIntegrations = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLimitlessDatabase", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLimitlessDatabase = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLocalWriteForwarding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLocalWriteForwarding = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLogExportsToCloudwatchLogs", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLogExportsToCloudwatchLogs = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsParallelQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsParallelQuery = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsReadReplica", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsReadReplica = ptr.Bool(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ValidUpgradeTarget", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidUpgradeTargetList(&sv.ValidUpgradeTarget, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBEngineVersionList(v *[]types.DBEngineVersion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBEngineVersion + if *v == nil { + sv = make([]types.DBEngineVersion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBEngineVersion", t.Name.Local): + var col types.DBEngineVersion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBEngineVersion(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBEngineVersionListUnwrapped(v *[]types.DBEngineVersion, decoder smithyxml.NodeDecoder) error { + var sv []types.DBEngineVersion + if *v == nil { + sv = make([]types.DBEngineVersion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBEngineVersion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBEngineVersion(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBInstance(v **types.DBInstance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstance + if *v == nil { + sv = &types.DBInstance{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ActivityStreamEngineNativeAuditFieldsIncluded", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.ActivityStreamEngineNativeAuditFieldsIncluded = ptr.Bool(xtv) + } + + case strings.EqualFold("ActivityStreamKinesisStreamName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamKinesisStreamName = ptr.String(xtv) + } + + case strings.EqualFold("ActivityStreamKmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamKmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("ActivityStreamMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamMode = types.ActivityStreamMode(xtv) + } + + case strings.EqualFold("ActivityStreamPolicyStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamPolicyStatus = types.ActivityStreamPolicyStatus(xtv) + } + + case strings.EqualFold("ActivityStreamStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActivityStreamStatus = types.ActivityStreamStatus(xtv) + } + + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AssociatedRoles", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceRoles(&sv.AssociatedRoles, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AutomaticRestartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.AutomaticRestartTime = ptr.Time(t) + } + + case strings.EqualFold("AutomationMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AutomationMode = types.AutomationMode(xtv) + } + + case strings.EqualFold("AutoMinorVersionUpgrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.AutoMinorVersionUpgrade = ptr.Bool(xtv) + } + + case strings.EqualFold("AvailabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("AwsBackupRecoveryPointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AwsBackupRecoveryPointArn = ptr.String(xtv) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("BackupTarget", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BackupTarget = ptr.String(xtv) + } + + case strings.EqualFold("CACertificateIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CACertificateIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("CertificateDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateDetails(&sv.CertificateDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("CopyTagsToSnapshot", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.CopyTagsToSnapshot = ptr.Bool(xtv) + } + + case strings.EqualFold("CustomerOwnedIpEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CustomerOwnedIpEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("CustomIamInstanceProfile", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomIamInstanceProfile = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInsightsMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInsightsMode = types.DatabaseInsightsMode(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceArn = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceAutomatedBackupsReplications", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplicationList(&sv.DBInstanceAutomatedBackupsReplications, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbInstancePort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DbInstancePort = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBInstanceStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceStatus = ptr.String(xtv) + } + + case strings.EqualFold("DbiResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbiResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DBName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBName = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBParameterGroupStatusList(&sv.DBParameterGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBSecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroupMembershipList(&sv.DBSecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBSubnetGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSubnetGroup(&sv.DBSubnetGroup, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBSystemId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSystemId = ptr.String(xtv) + } + + case strings.EqualFold("DedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("DeletionProtection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DeletionProtection = ptr.Bool(xtv) + } + + case strings.EqualFold("DomainMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDomainMembershipList(&sv.DomainMemberships, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EnabledCloudwatchLogsExports", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.EnabledCloudwatchLogsExports, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Endpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEndpoint(&sv.Endpoint, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineLifecycleSupport", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineLifecycleSupport = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("EnhancedMonitoringResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EnhancedMonitoringResourceArn = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("InstanceCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.InstanceCreateTime = ptr.Time(t) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("IsStorageConfigUpgradeAvailable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IsStorageConfigUpgradeAvailable = ptr.Bool(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LatestRestorableTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LatestRestorableTime = ptr.Time(t) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("ListenerEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEndpoint(&sv.ListenerEndpoint, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("MasterUserSecret", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMasterUserSecret(&sv.MasterUserSecret, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MaxAllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxAllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MonitoringInterval", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MonitoringInterval = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MonitoringRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MonitoringRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.MultiAZ = ptr.Bool(xtv) + } + + case strings.EqualFold("MultiTenant", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiTenant = ptr.Bool(xtv) + } + + case strings.EqualFold("NcharCharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NcharCharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("NetworkType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NetworkType = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroupMembershipList(&sv.OptionGroupMemberships, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PendingModifiedValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingModifiedValues(&sv.PendingModifiedValues, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PercentProgress = ptr.String(xtv) + } + + case strings.EqualFold("PerformanceInsightsEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PerformanceInsightsEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("PerformanceInsightsKMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PerformanceInsightsKMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("PerformanceInsightsRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PerformanceInsightsRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("PreferredBackupWindow", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PreferredBackupWindow = ptr.String(xtv) + } + + case strings.EqualFold("PreferredMaintenanceWindow", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PreferredMaintenanceWindow = ptr.String(xtv) + } + + case strings.EqualFold("ProcessorFeatures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentProcessorFeatureList(&sv.ProcessorFeatures, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PromotionTier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PromotionTier = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("ReadReplicaDBClusterIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReadReplicaDBClusterIdentifierList(&sv.ReadReplicaDBClusterIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReadReplicaDBInstanceIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReadReplicaDBInstanceIdentifierList(&sv.ReadReplicaDBInstanceIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReadReplicaSourceDBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReadReplicaSourceDBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("ReadReplicaSourceDBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReadReplicaSourceDBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("ReplicaMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReplicaMode = types.ReplicaMode(xtv) + } + + case strings.EqualFold("ResumeFullAutomationModeTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ResumeFullAutomationModeTime = ptr.Time(t) + } + + case strings.EqualFold("SecondaryAvailabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecondaryAvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("StatusInfos", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceStatusInfoList(&sv.StatusInfos, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageEncrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.StorageEncrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TdeCredentialArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TdeCredentialArn = ptr.String(xtv) + } + + case strings.EqualFold("Timezone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Timezone = ptr.String(xtv) + } + + case strings.EqualFold("VpcSecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVpcSecurityGroupMembershipList(&sv.VpcSecurityGroups, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAlreadyExistsFault(v **types.DBInstanceAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceAlreadyExistsFault + if *v == nil { + sv = &types.DBInstanceAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(v **types.DBInstanceAutomatedBackup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceAutomatedBackup + if *v == nil { + sv = &types.DBInstanceAutomatedBackup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AvailabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("AwsBackupRecoveryPointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AwsBackupRecoveryPointArn = ptr.String(xtv) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("BackupTarget", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BackupTarget = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceArn = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceAutomatedBackupsArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceAutomatedBackupsArn = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceAutomatedBackupsReplications", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplicationList(&sv.DBInstanceAutomatedBackupsReplications, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbiResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbiResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("Encrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Encrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("InstanceCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.InstanceCreateTime = ptr.Time(t) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("MultiTenant", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiTenant = ptr.Bool(xtv) + } + + case strings.EqualFold("OptionGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Region", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Region = ptr.String(xtv) + } + + case strings.EqualFold("RestoreWindow", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRestoreWindow(&sv.RestoreWindow, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("TdeCredentialArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TdeCredentialArn = ptr.String(xtv) + } + + case strings.EqualFold("Timezone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Timezone = ptr.String(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupList(v *[]types.DBInstanceAutomatedBackup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBInstanceAutomatedBackup + if *v == nil { + sv = make([]types.DBInstanceAutomatedBackup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBInstanceAutomatedBackup", t.Name.Local): + var col types.DBInstanceAutomatedBackup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupListUnwrapped(v *[]types.DBInstanceAutomatedBackup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBInstanceAutomatedBackup + if *v == nil { + sv = make([]types.DBInstanceAutomatedBackup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBInstanceAutomatedBackup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupNotFoundFault(v **types.DBInstanceAutomatedBackupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceAutomatedBackupNotFoundFault + if *v == nil { + sv = &types.DBInstanceAutomatedBackupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupQuotaExceededFault(v **types.DBInstanceAutomatedBackupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceAutomatedBackupQuotaExceededFault + if *v == nil { + sv = &types.DBInstanceAutomatedBackupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplication(v **types.DBInstanceAutomatedBackupsReplication, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceAutomatedBackupsReplication + if *v == nil { + sv = &types.DBInstanceAutomatedBackupsReplication{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstanceAutomatedBackupsArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceAutomatedBackupsArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplicationList(v *[]types.DBInstanceAutomatedBackupsReplication, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBInstanceAutomatedBackupsReplication + if *v == nil { + sv = make([]types.DBInstanceAutomatedBackupsReplication, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBInstanceAutomatedBackupsReplication", t.Name.Local): + var col types.DBInstanceAutomatedBackupsReplication + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplication(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplicationListUnwrapped(v *[]types.DBInstanceAutomatedBackupsReplication, decoder smithyxml.NodeDecoder) error { + var sv []types.DBInstanceAutomatedBackupsReplication + if *v == nil { + sv = make([]types.DBInstanceAutomatedBackupsReplication, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBInstanceAutomatedBackupsReplication + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupsReplication(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBInstanceList(v *[]types.DBInstance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBInstance + if *v == nil { + sv = make([]types.DBInstance, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + var col types.DBInstance + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBInstance(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceListUnwrapped(v *[]types.DBInstance, decoder smithyxml.NodeDecoder) error { + var sv []types.DBInstance + if *v == nil { + sv = make([]types.DBInstance, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBInstance + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBInstance(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBInstanceNotFoundFault(v **types.DBInstanceNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceNotFoundFault + if *v == nil { + sv = &types.DBInstanceNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceNotReadyFault(v **types.DBInstanceNotReadyFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceNotReadyFault + if *v == nil { + sv = &types.DBInstanceNotReadyFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRole(v **types.DBInstanceRole, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceRole + if *v == nil { + sv = &types.DBInstanceRole{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("FeatureName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FeatureName = ptr.String(xtv) + } + + case strings.EqualFold("RoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RoleArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRoleAlreadyExistsFault(v **types.DBInstanceRoleAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceRoleAlreadyExistsFault + if *v == nil { + sv = &types.DBInstanceRoleAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRoleNotFoundFault(v **types.DBInstanceRoleNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceRoleNotFoundFault + if *v == nil { + sv = &types.DBInstanceRoleNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRoleQuotaExceededFault(v **types.DBInstanceRoleQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceRoleQuotaExceededFault + if *v == nil { + sv = &types.DBInstanceRoleQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRoles(v *[]types.DBInstanceRole, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBInstanceRole + if *v == nil { + sv = make([]types.DBInstanceRole, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBInstanceRole", t.Name.Local): + var col types.DBInstanceRole + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBInstanceRole(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceRolesUnwrapped(v *[]types.DBInstanceRole, decoder smithyxml.NodeDecoder) error { + var sv []types.DBInstanceRole + if *v == nil { + sv = make([]types.DBInstanceRole, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBInstanceRole + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBInstanceRole(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBInstanceStatusInfo(v **types.DBInstanceStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBInstanceStatusInfo + if *v == nil { + sv = &types.DBInstanceStatusInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("Normal", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Normal = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StatusType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceStatusInfoList(v *[]types.DBInstanceStatusInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBInstanceStatusInfo + if *v == nil { + sv = make([]types.DBInstanceStatusInfo, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBInstanceStatusInfo", t.Name.Local): + var col types.DBInstanceStatusInfo + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBInstanceStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBInstanceStatusInfoListUnwrapped(v *[]types.DBInstanceStatusInfo, decoder smithyxml.NodeDecoder) error { + var sv []types.DBInstanceStatusInfo + if *v == nil { + sv = make([]types.DBInstanceStatusInfo, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBInstanceStatusInfo + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBInstanceStatusInfo(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBLogFileNotFoundFault(v **types.DBLogFileNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBLogFileNotFoundFault + if *v == nil { + sv = &types.DBLogFileNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroup(v **types.DBParameterGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBParameterGroup + if *v == nil { + sv = &types.DBParameterGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupAlreadyExistsFault(v **types.DBParameterGroupAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBParameterGroupAlreadyExistsFault + if *v == nil { + sv = &types.DBParameterGroupAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupList(v *[]types.DBParameterGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBParameterGroup + if *v == nil { + sv = make([]types.DBParameterGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBParameterGroup", t.Name.Local): + var col types.DBParameterGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBParameterGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupListUnwrapped(v *[]types.DBParameterGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBParameterGroup + if *v == nil { + sv = make([]types.DBParameterGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBParameterGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBParameterGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBParameterGroupNotFoundFault(v **types.DBParameterGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBParameterGroupNotFoundFault + if *v == nil { + sv = &types.DBParameterGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupQuotaExceededFault(v **types.DBParameterGroupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBParameterGroupQuotaExceededFault + if *v == nil { + sv = &types.DBParameterGroupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupStatus(v **types.DBParameterGroupStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBParameterGroupStatus + if *v == nil { + sv = &types.DBParameterGroupStatus{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupName = ptr.String(xtv) + } + + case strings.EqualFold("ParameterApplyStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ParameterApplyStatus = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupStatusList(v *[]types.DBParameterGroupStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBParameterGroupStatus + if *v == nil { + sv = make([]types.DBParameterGroupStatus, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBParameterGroup", t.Name.Local): + var col types.DBParameterGroupStatus + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBParameterGroupStatus(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBParameterGroupStatusListUnwrapped(v *[]types.DBParameterGroupStatus, decoder smithyxml.NodeDecoder) error { + var sv []types.DBParameterGroupStatus + if *v == nil { + sv = make([]types.DBParameterGroupStatus, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBParameterGroupStatus + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBParameterGroupStatus(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBProxy(v **types.DBProxy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxy + if *v == nil { + sv = &types.DBProxy{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Auth", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentUserAuthConfigInfoList(&sv.Auth, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case strings.EqualFold("DBProxyArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyArn = ptr.String(xtv) + } + + case strings.EqualFold("DBProxyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyName = ptr.String(xtv) + } + + case strings.EqualFold("DebugLogging", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DebugLogging = ptr.Bool(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("EngineFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineFamily = ptr.String(xtv) + } + + case strings.EqualFold("IdleClientTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.IdleClientTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("RequireTLS", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.RequireTLS = ptr.Bool(xtv) + } + + case strings.EqualFold("RoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RoleArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.DBProxyStatus(xtv) + } + + case strings.EqualFold("UpdatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.UpdatedDate = ptr.Time(t) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + case strings.EqualFold("VpcSecurityGroupIds", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.VpcSecurityGroupIds, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcSubnetIds", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.VpcSubnetIds, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyAlreadyExistsFault(v **types.DBProxyAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyAlreadyExistsFault + if *v == nil { + sv = &types.DBProxyAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyEndpoint(v **types.DBProxyEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyEndpoint + if *v == nil { + sv = &types.DBProxyEndpoint{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CreatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case strings.EqualFold("DBProxyEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("DBProxyEndpointName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyEndpointName = ptr.String(xtv) + } + + case strings.EqualFold("DBProxyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyName = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("IsDefault", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsDefault = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.DBProxyEndpointStatus(xtv) + } + + case strings.EqualFold("TargetRole", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetRole = types.DBProxyEndpointTargetRole(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + case strings.EqualFold("VpcSecurityGroupIds", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.VpcSecurityGroupIds, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcSubnetIds", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.VpcSubnetIds, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyEndpointAlreadyExistsFault(v **types.DBProxyEndpointAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyEndpointAlreadyExistsFault + if *v == nil { + sv = &types.DBProxyEndpointAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyEndpointList(v *[]types.DBProxyEndpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBProxyEndpoint + if *v == nil { + sv = make([]types.DBProxyEndpoint, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DBProxyEndpoint + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBProxyEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyEndpointListUnwrapped(v *[]types.DBProxyEndpoint, decoder smithyxml.NodeDecoder) error { + var sv []types.DBProxyEndpoint + if *v == nil { + sv = make([]types.DBProxyEndpoint, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBProxyEndpoint + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBProxyEndpoint(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBProxyEndpointNotFoundFault(v **types.DBProxyEndpointNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyEndpointNotFoundFault + if *v == nil { + sv = &types.DBProxyEndpointNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyEndpointQuotaExceededFault(v **types.DBProxyEndpointQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyEndpointQuotaExceededFault + if *v == nil { + sv = &types.DBProxyEndpointQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyList(v *[]types.DBProxy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBProxy + if *v == nil { + sv = make([]types.DBProxy, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DBProxy + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBProxy(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyListUnwrapped(v *[]types.DBProxy, decoder smithyxml.NodeDecoder) error { + var sv []types.DBProxy + if *v == nil { + sv = make([]types.DBProxy, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBProxy + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBProxy(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBProxyNotFoundFault(v **types.DBProxyNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyNotFoundFault + if *v == nil { + sv = &types.DBProxyNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyQuotaExceededFault(v **types.DBProxyQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyQuotaExceededFault + if *v == nil { + sv = &types.DBProxyQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyTarget(v **types.DBProxyTarget, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyTarget + if *v == nil { + sv = &types.DBProxyTarget{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("RdsResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RdsResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Role", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Role = types.TargetRole(xtv) + } + + case strings.EqualFold("TargetArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetArn = ptr.String(xtv) + } + + case strings.EqualFold("TargetHealth", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetHealth(&sv.TargetHealth, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrackedClusterId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrackedClusterId = ptr.String(xtv) + } + + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = types.TargetType(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyTargetAlreadyRegisteredFault(v **types.DBProxyTargetAlreadyRegisteredFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyTargetAlreadyRegisteredFault + if *v == nil { + sv = &types.DBProxyTargetAlreadyRegisteredFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyTargetGroup(v **types.DBProxyTargetGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyTargetGroup + if *v == nil { + sv = &types.DBProxyTargetGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ConnectionPoolConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentConnectionPoolConfigurationInfo(&sv.ConnectionPoolConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case strings.EqualFold("DBProxyName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBProxyName = ptr.String(xtv) + } + + case strings.EqualFold("IsDefault", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsDefault = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TargetGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("TargetGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetGroupName = ptr.String(xtv) + } + + case strings.EqualFold("UpdatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.UpdatedDate = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyTargetGroupNotFoundFault(v **types.DBProxyTargetGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyTargetGroupNotFoundFault + if *v == nil { + sv = &types.DBProxyTargetGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBProxyTargetNotFoundFault(v **types.DBProxyTargetNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBProxyTargetNotFoundFault + if *v == nil { + sv = &types.DBProxyTargetNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBRecommendation(v **types.DBRecommendation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBRecommendation + if *v == nil { + sv = &types.DBRecommendation{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalInfo", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AdditionalInfo = ptr.String(xtv) + } + + case strings.EqualFold("Category", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Category = ptr.String(xtv) + } + + case strings.EqualFold("CreatedTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(t) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Detection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Detection = ptr.String(xtv) + } + + case strings.EqualFold("Impact", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Impact = ptr.String(xtv) + } + + case strings.EqualFold("IssueDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIssueDetails(&sv.IssueDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Links", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDocLinkList(&sv.Links, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Reason", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Reason = ptr.String(xtv) + } + + case strings.EqualFold("Recommendation", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Recommendation = ptr.String(xtv) + } + + case strings.EqualFold("RecommendationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RecommendationId = ptr.String(xtv) + } + + case strings.EqualFold("RecommendedActions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecommendedActionList(&sv.RecommendedActions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Severity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Severity = ptr.String(xtv) + } + + case strings.EqualFold("Source", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Source = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TypeDetection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TypeDetection = ptr.String(xtv) + } + + case strings.EqualFold("TypeId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TypeId = ptr.String(xtv) + } + + case strings.EqualFold("TypeRecommendation", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TypeRecommendation = ptr.String(xtv) + } + + case strings.EqualFold("UpdatedTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.UpdatedTime = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBRecommendationList(v *[]types.DBRecommendation, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBRecommendation + if *v == nil { + sv = make([]types.DBRecommendation, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DBRecommendation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBRecommendation(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBRecommendationListUnwrapped(v *[]types.DBRecommendation, decoder smithyxml.NodeDecoder) error { + var sv []types.DBRecommendation + if *v == nil { + sv = make([]types.DBRecommendation, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBRecommendation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBRecommendation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSecurityGroup(v **types.DBSecurityGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroup + if *v == nil { + sv = &types.DBSecurityGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSecurityGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBSecurityGroupDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSecurityGroupDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBSecurityGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSecurityGroupName = ptr.String(xtv) + } + + case strings.EqualFold("EC2SecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEC2SecurityGroupList(&sv.EC2SecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IPRanges", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIPRangeList(&sv.IPRanges, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OwnerId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OwnerId = ptr.String(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupAlreadyExistsFault(v **types.DBSecurityGroupAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroupAlreadyExistsFault + if *v == nil { + sv = &types.DBSecurityGroupAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupMembership(v **types.DBSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroupMembership + if *v == nil { + sv = &types.DBSecurityGroupMembership{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSecurityGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupMembershipList(v *[]types.DBSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSecurityGroupMembership + if *v == nil { + sv = make([]types.DBSecurityGroupMembership, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSecurityGroup", t.Name.Local): + var col types.DBSecurityGroupMembership + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSecurityGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupMembershipListUnwrapped(v *[]types.DBSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSecurityGroupMembership + if *v == nil { + sv = make([]types.DBSecurityGroupMembership, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSecurityGroupMembership + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSecurityGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSecurityGroupNotFoundFault(v **types.DBSecurityGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroupNotFoundFault + if *v == nil { + sv = &types.DBSecurityGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupNotSupportedFault(v **types.DBSecurityGroupNotSupportedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroupNotSupportedFault + if *v == nil { + sv = &types.DBSecurityGroupNotSupportedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupQuotaExceededFault(v **types.DBSecurityGroupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSecurityGroupQuotaExceededFault + if *v == nil { + sv = &types.DBSecurityGroupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroups(v *[]types.DBSecurityGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSecurityGroup + if *v == nil { + sv = make([]types.DBSecurityGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSecurityGroup", t.Name.Local): + var col types.DBSecurityGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSecurityGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSecurityGroupsUnwrapped(v *[]types.DBSecurityGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSecurityGroup + if *v == nil { + sv = make([]types.DBSecurityGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSecurityGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSecurityGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBShardGroup(v **types.DBShardGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBShardGroup + if *v == nil { + sv = &types.DBShardGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComputeRedundancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ComputeRedundancy = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("MaxACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxACU = ptr.Float64(f64) + } + + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBShardGroupAlreadyExistsFault(v **types.DBShardGroupAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBShardGroupAlreadyExistsFault + if *v == nil { + sv = &types.DBShardGroupAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBShardGroupNotFoundFault(v **types.DBShardGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBShardGroupNotFoundFault + if *v == nil { + sv = &types.DBShardGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBShardGroupsList(v *[]types.DBShardGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBShardGroup + if *v == nil { + sv = make([]types.DBShardGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBShardGroup", t.Name.Local): + var col types.DBShardGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBShardGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBShardGroupsListUnwrapped(v *[]types.DBShardGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBShardGroup + if *v == nil { + sv = make([]types.DBShardGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBShardGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBShardGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSnapshot(v **types.DBSnapshot, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshot + if *v == nil { + sv = &types.DBSnapshot{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AvailabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbiResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbiResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DBSnapshotArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSnapshotArn = ptr.String(xtv) + } + + case strings.EqualFold("DBSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSnapshotIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBSystemId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSystemId = ptr.String(xtv) + } + + case strings.EqualFold("DedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("Encrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Encrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("InstanceCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.InstanceCreateTime = ptr.Time(t) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("MultiTenant", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiTenant = ptr.Bool(xtv) + } + + case strings.EqualFold("OptionGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupName = ptr.String(xtv) + } + + case strings.EqualFold("OriginalSnapshotCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.OriginalSnapshotCreateTime = ptr.Time(t) + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PercentProgress = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("ProcessorFeatures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentProcessorFeatureList(&sv.ProcessorFeatures, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SnapshotCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotCreateTime = ptr.Time(t) + } + + case strings.EqualFold("SnapshotDatabaseTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotDatabaseTime = ptr.Time(t) + } + + case strings.EqualFold("SnapshotTarget", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SnapshotTarget = ptr.String(xtv) + } + + case strings.EqualFold("SnapshotType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SnapshotType = ptr.String(xtv) + } + + case strings.EqualFold("SourceDBSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceDBSnapshotIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("SourceRegion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceRegion = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TdeCredentialArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TdeCredentialArn = ptr.String(xtv) + } + + case strings.EqualFold("Timezone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Timezone = ptr.String(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotAlreadyExistsFault(v **types.DBSnapshotAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotAlreadyExistsFault + if *v == nil { + sv = &types.DBSnapshotAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotAttribute(v **types.DBSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotAttribute + if *v == nil { + sv = &types.DBSnapshotAttribute{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AttributeName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AttributeName = ptr.String(xtv) + } + + case strings.EqualFold("AttributeValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAttributeValueList(&sv.AttributeValues, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotAttributeList(v *[]types.DBSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSnapshotAttribute + if *v == nil { + sv = make([]types.DBSnapshotAttribute, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSnapshotAttribute", t.Name.Local): + var col types.DBSnapshotAttribute + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSnapshotAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotAttributeListUnwrapped(v *[]types.DBSnapshotAttribute, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSnapshotAttribute + if *v == nil { + sv = make([]types.DBSnapshotAttribute, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSnapshotAttribute + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSnapshotAttribute(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSnapshotAttributesResult(v **types.DBSnapshotAttributesResult, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotAttributesResult + if *v == nil { + sv = &types.DBSnapshotAttributesResult{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshotAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshotAttributeList(&sv.DBSnapshotAttributes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSnapshotIdentifier = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotList(v *[]types.DBSnapshot, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSnapshot + if *v == nil { + sv = make([]types.DBSnapshot, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSnapshot", t.Name.Local): + var col types.DBSnapshot + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSnapshot(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotListUnwrapped(v *[]types.DBSnapshot, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSnapshot + if *v == nil { + sv = make([]types.DBSnapshot, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSnapshot + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSnapshot(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSnapshotNotFoundFault(v **types.DBSnapshotNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotNotFoundFault + if *v == nil { + sv = &types.DBSnapshotNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotTenantDatabase(v **types.DBSnapshotTenantDatabase, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotTenantDatabase + if *v == nil { + sv = &types.DBSnapshotTenantDatabase{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbiResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbiResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DBSnapshotIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSnapshotIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBSnapshotTenantDatabaseARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSnapshotTenantDatabaseARN = ptr.String(xtv) + } + + case strings.EqualFold("EngineName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineName = ptr.String(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("NcharCharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NcharCharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("SnapshotType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SnapshotType = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TenantDatabaseCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TenantDatabaseCreateTime = ptr.Time(t) + } + + case strings.EqualFold("TenantDatabaseResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDatabaseResourceId = ptr.String(xtv) + } + + case strings.EqualFold("TenantDBName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDBName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotTenantDatabaseNotFoundFault(v **types.DBSnapshotTenantDatabaseNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSnapshotTenantDatabaseNotFoundFault + if *v == nil { + sv = &types.DBSnapshotTenantDatabaseNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotTenantDatabasesList(v *[]types.DBSnapshotTenantDatabase, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSnapshotTenantDatabase + if *v == nil { + sv = make([]types.DBSnapshotTenantDatabase, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSnapshotTenantDatabase", t.Name.Local): + var col types.DBSnapshotTenantDatabase + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSnapshotTenantDatabase(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSnapshotTenantDatabasesListUnwrapped(v *[]types.DBSnapshotTenantDatabase, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSnapshotTenantDatabase + if *v == nil { + sv = make([]types.DBSnapshotTenantDatabase, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSnapshotTenantDatabase + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSnapshotTenantDatabase(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSubnetGroup(v **types.DBSubnetGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroup + if *v == nil { + sv = &types.DBSubnetGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSubnetGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSubnetGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBSubnetGroupDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSubnetGroupDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBSubnetGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSubnetGroupName = ptr.String(xtv) + } + + case strings.EqualFold("SubnetGroupStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubnetGroupStatus = ptr.String(xtv) + } + + case strings.EqualFold("Subnets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSubnetList(&sv.Subnets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNetworkTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.SupportedNetworkTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupAlreadyExistsFault(v **types.DBSubnetGroupAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroupAlreadyExistsFault + if *v == nil { + sv = &types.DBSubnetGroupAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupDoesNotCoverEnoughAZs(v **types.DBSubnetGroupDoesNotCoverEnoughAZs, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroupDoesNotCoverEnoughAZs + if *v == nil { + sv = &types.DBSubnetGroupDoesNotCoverEnoughAZs{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupNotAllowedFault(v **types.DBSubnetGroupNotAllowedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroupNotAllowedFault + if *v == nil { + sv = &types.DBSubnetGroupNotAllowedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupNotFoundFault(v **types.DBSubnetGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroupNotFoundFault + if *v == nil { + sv = &types.DBSubnetGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupQuotaExceededFault(v **types.DBSubnetGroupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetGroupQuotaExceededFault + if *v == nil { + sv = &types.DBSubnetGroupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroups(v *[]types.DBSubnetGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBSubnetGroup + if *v == nil { + sv = make([]types.DBSubnetGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DBSubnetGroup", t.Name.Local): + var col types.DBSubnetGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBSubnetGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBSubnetGroupsUnwrapped(v *[]types.DBSubnetGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBSubnetGroup + if *v == nil { + sv = make([]types.DBSubnetGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBSubnetGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBSubnetGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDBSubnetQuotaExceededFault(v **types.DBSubnetQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBSubnetQuotaExceededFault + if *v == nil { + sv = &types.DBSubnetQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDBUpgradeDependencyFailureFault(v **types.DBUpgradeDependencyFailureFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DBUpgradeDependencyFailureFault + if *v == nil { + sv = &types.DBUpgradeDependencyFailureFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDescribeDBLogFilesDetails(v **types.DescribeDBLogFilesDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DescribeDBLogFilesDetails + if *v == nil { + sv = &types.DescribeDBLogFilesDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("LastWritten", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.LastWritten = ptr.Int64(i64) + } + + case strings.EqualFold("LogFileName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LogFileName = ptr.String(xtv) + } + + case strings.EqualFold("Size", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Size = ptr.Int64(i64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDescribeDBLogFilesList(v *[]types.DescribeDBLogFilesDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DescribeDBLogFilesDetails + if *v == nil { + sv = make([]types.DescribeDBLogFilesDetails, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DescribeDBLogFilesDetails", t.Name.Local): + var col types.DescribeDBLogFilesDetails + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDescribeDBLogFilesDetails(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDescribeDBLogFilesListUnwrapped(v *[]types.DescribeDBLogFilesDetails, decoder smithyxml.NodeDecoder) error { + var sv []types.DescribeDBLogFilesDetails + if *v == nil { + sv = make([]types.DescribeDBLogFilesDetails, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DescribeDBLogFilesDetails + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDescribeDBLogFilesDetails(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDocLink(v **types.DocLink, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DocLink + if *v == nil { + sv = &types.DocLink{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Text", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Text = ptr.String(xtv) + } + + case strings.EqualFold("Url", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Url = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDocLinkList(v *[]types.DocLink, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DocLink + if *v == nil { + sv = make([]types.DocLink, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DocLink + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDocLink(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDocLinkListUnwrapped(v *[]types.DocLink, decoder smithyxml.NodeDecoder) error { + var sv []types.DocLink + if *v == nil { + sv = make([]types.DocLink, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DocLink + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDocLink(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDomainMembership(v **types.DomainMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DomainMembership + if *v == nil { + sv = &types.DomainMembership{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AuthSecretArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AuthSecretArn = ptr.String(xtv) + } + + case strings.EqualFold("DnsIps", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.DnsIps, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Domain", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Domain = ptr.String(xtv) + } + + case strings.EqualFold("FQDN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FQDN = ptr.String(xtv) + } + + case strings.EqualFold("IAMRoleName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMRoleName = ptr.String(xtv) + } + + case strings.EqualFold("OU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OU = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDomainMembershipList(v *[]types.DomainMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DomainMembership + if *v == nil { + sv = make([]types.DomainMembership, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DomainMembership", t.Name.Local): + var col types.DomainMembership + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDomainMembership(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDomainMembershipListUnwrapped(v *[]types.DomainMembership, decoder smithyxml.NodeDecoder) error { + var sv []types.DomainMembership + if *v == nil { + sv = make([]types.DomainMembership, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DomainMembership + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDomainMembership(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentDomainNotFoundFault(v **types.DomainNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DomainNotFoundFault + if *v == nil { + sv = &types.DomainNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDoubleRange(v **types.DoubleRange, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DoubleRange + if *v == nil { + sv = &types.DoubleRange{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("From", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.From = ptr.Float64(f64) + } + + case strings.EqualFold("To", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.To = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDoubleRangeList(v *[]types.DoubleRange, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DoubleRange + if *v == nil { + sv = make([]types.DoubleRange, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("DoubleRange", t.Name.Local): + var col types.DoubleRange + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDoubleRange(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentDoubleRangeListUnwrapped(v *[]types.DoubleRange, decoder smithyxml.NodeDecoder) error { + var sv []types.DoubleRange + if *v == nil { + sv = make([]types.DoubleRange, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DoubleRange + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDoubleRange(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEc2ImagePropertiesNotSupportedFault(v **types.Ec2ImagePropertiesNotSupportedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Ec2ImagePropertiesNotSupportedFault + if *v == nil { + sv = &types.Ec2ImagePropertiesNotSupportedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEC2SecurityGroup(v **types.EC2SecurityGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EC2SecurityGroup + if *v == nil { + sv = &types.EC2SecurityGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EC2SecurityGroupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EC2SecurityGroupId = ptr.String(xtv) + } + + case strings.EqualFold("EC2SecurityGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EC2SecurityGroupName = ptr.String(xtv) + } + + case strings.EqualFold("EC2SecurityGroupOwnerId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EC2SecurityGroupOwnerId = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEC2SecurityGroupList(v *[]types.EC2SecurityGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.EC2SecurityGroup + if *v == nil { + sv = make([]types.EC2SecurityGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("EC2SecurityGroup", t.Name.Local): + var col types.EC2SecurityGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentEC2SecurityGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEC2SecurityGroupListUnwrapped(v *[]types.EC2SecurityGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.EC2SecurityGroup + if *v == nil { + sv = make([]types.EC2SecurityGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.EC2SecurityGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentEC2SecurityGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEncryptionContextMap(v *map[string]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEncryptionContextMapUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEncryptionContextMapUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + var ek string + var ev string + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ev = xtv + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEndpoint(v **types.Endpoint, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Endpoint + if *v == nil { + sv = &types.Endpoint{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Address", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Address = ptr.String(xtv) + } + + case strings.EqualFold("HostedZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneId = ptr.String(xtv) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEngineDefaults(v **types.EngineDefaults, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EngineDefaults + if *v == nil { + sv = &types.EngineDefaults{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("Parameters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentParametersList(&sv.Parameters, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEngineModeList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEngineModeListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEvent(v **types.Event, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Event + if *v == nil { + sv = &types.Event{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Date", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Date = ptr.Time(t) + } + + case strings.EqualFold("EventCategories", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventCategoriesList(&sv.EventCategories, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("SourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = types.SourceType(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventCategoriesList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("EventCategory", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventCategoriesListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEventCategoriesMap(v **types.EventCategoriesMap, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventCategoriesMap + if *v == nil { + sv = &types.EventCategoriesMap{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventCategories", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventCategoriesList(&sv.EventCategories, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventCategoriesMapList(v *[]types.EventCategoriesMap, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.EventCategoriesMap + if *v == nil { + sv = make([]types.EventCategoriesMap, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("EventCategoriesMap", t.Name.Local): + var col types.EventCategoriesMap + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentEventCategoriesMap(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventCategoriesMapListUnwrapped(v *[]types.EventCategoriesMap, decoder smithyxml.NodeDecoder) error { + var sv []types.EventCategoriesMap + if *v == nil { + sv = make([]types.EventCategoriesMap, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.EventCategoriesMap + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentEventCategoriesMap(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEventList(v *[]types.Event, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Event + if *v == nil { + sv = make([]types.Event, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Event", t.Name.Local): + var col types.Event + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentEvent(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventListUnwrapped(v *[]types.Event, decoder smithyxml.NodeDecoder) error { + var sv []types.Event + if *v == nil { + sv = make([]types.Event, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Event + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentEvent(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentEventSubscription(v **types.EventSubscription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventSubscription + if *v == nil { + sv = &types.EventSubscription{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CustomerAwsId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomerAwsId = ptr.String(xtv) + } + + case strings.EqualFold("CustSubscriptionId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustSubscriptionId = ptr.String(xtv) + } + + case strings.EqualFold("Enabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Enabled = ptr.Bool(xtv) + } + + case strings.EqualFold("EventCategoriesList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventCategoriesList(&sv.EventCategoriesList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EventSubscriptionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventSubscriptionArn = ptr.String(xtv) + } + + case strings.EqualFold("SnsTopicArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SnsTopicArn = ptr.String(xtv) + } + + case strings.EqualFold("SourceIdsList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSourceIdsList(&sv.SourceIdsList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SubscriptionCreationTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubscriptionCreationTime = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventSubscriptionQuotaExceededFault(v **types.EventSubscriptionQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventSubscriptionQuotaExceededFault + if *v == nil { + sv = &types.EventSubscriptionQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventSubscriptionsList(v *[]types.EventSubscription, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.EventSubscription + if *v == nil { + sv = make([]types.EventSubscription, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + var col types.EventSubscription + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentEventSubscription(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentEventSubscriptionsListUnwrapped(v *[]types.EventSubscription, decoder smithyxml.NodeDecoder) error { + var sv []types.EventSubscription + if *v == nil { + sv = make([]types.EventSubscription, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.EventSubscription + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentEventSubscription(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentExportTask(v **types.ExportTask, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExportTask + if *v == nil { + sv = &types.ExportTask{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ExportOnly", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExportOnly, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ExportTaskIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ExportTaskIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("FailureCause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FailureCause = ptr.String(xtv) + } + + case strings.EqualFold("IamRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IamRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PercentProgress = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("S3Bucket", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Bucket = ptr.String(xtv) + } + + case strings.EqualFold("S3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("SnapshotTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotTime = ptr.Time(t) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = types.ExportSourceType(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TaskEndTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskEndTime = ptr.Time(t) + } + + case strings.EqualFold("TaskStartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskStartTime = ptr.Time(t) + } + + case strings.EqualFold("TotalExtractedDataInGB", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TotalExtractedDataInGB = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("WarningMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.WarningMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExportTaskAlreadyExistsFault(v **types.ExportTaskAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExportTaskAlreadyExistsFault + if *v == nil { + sv = &types.ExportTaskAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExportTaskNotFoundFault(v **types.ExportTaskNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExportTaskNotFoundFault + if *v == nil { + sv = &types.ExportTaskNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExportTasksList(v *[]types.ExportTask, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ExportTask + if *v == nil { + sv = make([]types.ExportTask, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ExportTask", t.Name.Local): + var col types.ExportTask + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentExportTask(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExportTasksListUnwrapped(v *[]types.ExportTask, decoder smithyxml.NodeDecoder) error { + var sv []types.ExportTask + if *v == nil { + sv = make([]types.ExportTask, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ExportTask + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentExportTask(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentFailoverState(v **types.FailoverState, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FailoverState + if *v == nil { + sv = &types.FailoverState{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("FromDbClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FromDbClusterArn = ptr.String(xtv) + } + + case strings.EqualFold("IsDataLossAllowed", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsDataLossAllowed = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.FailoverStatus(xtv) + } + + case strings.EqualFold("ToDbClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ToDbClusterArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentFeatureNameList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentFeatureNameListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentGlobalCluster(v **types.GlobalCluster, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GlobalCluster + if *v == nil { + sv = &types.GlobalCluster{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DatabaseName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseName = ptr.String(xtv) + } + + case strings.EqualFold("DeletionProtection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DeletionProtection = ptr.Bool(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineLifecycleSupport", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineLifecycleSupport = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("FailoverState", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFailoverState(&sv.FailoverState, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("GlobalClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GlobalClusterArn = ptr.String(xtv) + } + + case strings.EqualFold("GlobalClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GlobalClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("GlobalClusterMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalClusterMemberList(&sv.GlobalClusterMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("GlobalClusterResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GlobalClusterResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("StorageEncrypted", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.StorageEncrypted = ptr.Bool(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterAlreadyExistsFault(v **types.GlobalClusterAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GlobalClusterAlreadyExistsFault + if *v == nil { + sv = &types.GlobalClusterAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterList(v *[]types.GlobalCluster, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.GlobalCluster + if *v == nil { + sv = make([]types.GlobalCluster, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("GlobalClusterMember", t.Name.Local): + var col types.GlobalCluster + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentGlobalCluster(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterListUnwrapped(v *[]types.GlobalCluster, decoder smithyxml.NodeDecoder) error { + var sv []types.GlobalCluster + if *v == nil { + sv = make([]types.GlobalCluster, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.GlobalCluster + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentGlobalCluster(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentGlobalClusterMember(v **types.GlobalClusterMember, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GlobalClusterMember + if *v == nil { + sv = &types.GlobalClusterMember{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterArn = ptr.String(xtv) + } + + case strings.EqualFold("GlobalWriteForwardingStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.GlobalWriteForwardingStatus = types.WriteForwardingStatus(xtv) + } + + case strings.EqualFold("IsWriter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsWriter = ptr.Bool(xtv) + } + + case strings.EqualFold("Readers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReadersArnList(&sv.Readers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SynchronizationStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SynchronizationStatus = types.GlobalClusterMemberSynchronizationStatus(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterMemberList(v *[]types.GlobalClusterMember, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.GlobalClusterMember + if *v == nil { + sv = make([]types.GlobalClusterMember, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("GlobalClusterMember", t.Name.Local): + var col types.GlobalClusterMember + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentGlobalClusterMember(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterMemberListUnwrapped(v *[]types.GlobalClusterMember, decoder smithyxml.NodeDecoder) error { + var sv []types.GlobalClusterMember + if *v == nil { + sv = make([]types.GlobalClusterMember, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.GlobalClusterMember + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentGlobalClusterMember(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentGlobalClusterNotFoundFault(v **types.GlobalClusterNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GlobalClusterNotFoundFault + if *v == nil { + sv = &types.GlobalClusterNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentGlobalClusterQuotaExceededFault(v **types.GlobalClusterQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GlobalClusterQuotaExceededFault + if *v == nil { + sv = &types.GlobalClusterQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIamRoleMissingPermissionsFault(v **types.IamRoleMissingPermissionsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IamRoleMissingPermissionsFault + if *v == nil { + sv = &types.IamRoleMissingPermissionsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIamRoleNotFoundFault(v **types.IamRoleNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IamRoleNotFoundFault + if *v == nil { + sv = &types.IamRoleNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInstanceQuotaExceededFault(v **types.InstanceQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InstanceQuotaExceededFault + if *v == nil { + sv = &types.InstanceQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInsufficientAvailableIPsInSubnetFault(v **types.InsufficientAvailableIPsInSubnetFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InsufficientAvailableIPsInSubnetFault + if *v == nil { + sv = &types.InsufficientAvailableIPsInSubnetFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInsufficientDBClusterCapacityFault(v **types.InsufficientDBClusterCapacityFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InsufficientDBClusterCapacityFault + if *v == nil { + sv = &types.InsufficientDBClusterCapacityFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInsufficientDBInstanceCapacityFault(v **types.InsufficientDBInstanceCapacityFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InsufficientDBInstanceCapacityFault + if *v == nil { + sv = &types.InsufficientDBInstanceCapacityFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInsufficientStorageClusterCapacityFault(v **types.InsufficientStorageClusterCapacityFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InsufficientStorageClusterCapacityFault + if *v == nil { + sv = &types.InsufficientStorageClusterCapacityFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegration(v **types.Integration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Integration + if *v == nil { + sv = &types.Integration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalEncryptionContext", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEncryptionContextMap(&sv.AdditionalEncryptionContext, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("DataFilter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataFilter = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Errors", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIntegrationErrorList(&sv.Errors, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IntegrationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationArn = ptr.String(xtv) + } + + case strings.EqualFold("IntegrationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationName = ptr.String(xtv) + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.IntegrationStatus(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationAlreadyExistsFault(v **types.IntegrationAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IntegrationAlreadyExistsFault + if *v == nil { + sv = &types.IntegrationAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationConflictOperationFault(v **types.IntegrationConflictOperationFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IntegrationConflictOperationFault + if *v == nil { + sv = &types.IntegrationConflictOperationFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationError(v **types.IntegrationError, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IntegrationError + if *v == nil { + sv = &types.IntegrationError{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ErrorCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ErrorCode = ptr.String(xtv) + } + + case strings.EqualFold("ErrorMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ErrorMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationErrorList(v *[]types.IntegrationError, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IntegrationError + if *v == nil { + sv = make([]types.IntegrationError, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("IntegrationError", t.Name.Local): + var col types.IntegrationError + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentIntegrationError(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationErrorListUnwrapped(v *[]types.IntegrationError, decoder smithyxml.NodeDecoder) error { + var sv []types.IntegrationError + if *v == nil { + sv = make([]types.IntegrationError, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IntegrationError + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentIntegrationError(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentIntegrationList(v *[]types.Integration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Integration + if *v == nil { + sv = make([]types.Integration, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Integration", t.Name.Local): + var col types.Integration + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentIntegration(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationListUnwrapped(v *[]types.Integration, decoder smithyxml.NodeDecoder) error { + var sv []types.Integration + if *v == nil { + sv = make([]types.Integration, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Integration + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentIntegration(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentIntegrationNotFoundFault(v **types.IntegrationNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IntegrationNotFoundFault + if *v == nil { + sv = &types.IntegrationNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIntegrationQuotaExceededFault(v **types.IntegrationQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IntegrationQuotaExceededFault + if *v == nil { + sv = &types.IntegrationQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidBlueGreenDeploymentStateFault(v **types.InvalidBlueGreenDeploymentStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidBlueGreenDeploymentStateFault + if *v == nil { + sv = &types.InvalidBlueGreenDeploymentStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidCustomDBEngineVersionStateFault(v **types.InvalidCustomDBEngineVersionStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidCustomDBEngineVersionStateFault + if *v == nil { + sv = &types.InvalidCustomDBEngineVersionStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBClusterAutomatedBackupStateFault(v **types.InvalidDBClusterAutomatedBackupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBClusterAutomatedBackupStateFault + if *v == nil { + sv = &types.InvalidDBClusterAutomatedBackupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBClusterCapacityFault(v **types.InvalidDBClusterCapacityFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBClusterCapacityFault + if *v == nil { + sv = &types.InvalidDBClusterCapacityFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBClusterEndpointStateFault(v **types.InvalidDBClusterEndpointStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBClusterEndpointStateFault + if *v == nil { + sv = &types.InvalidDBClusterEndpointStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBClusterSnapshotStateFault(v **types.InvalidDBClusterSnapshotStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBClusterSnapshotStateFault + if *v == nil { + sv = &types.InvalidDBClusterSnapshotStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBClusterStateFault(v **types.InvalidDBClusterStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBClusterStateFault + if *v == nil { + sv = &types.InvalidDBClusterStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBInstanceAutomatedBackupStateFault(v **types.InvalidDBInstanceAutomatedBackupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBInstanceAutomatedBackupStateFault + if *v == nil { + sv = &types.InvalidDBInstanceAutomatedBackupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBInstanceStateFault(v **types.InvalidDBInstanceStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBInstanceStateFault + if *v == nil { + sv = &types.InvalidDBInstanceStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBParameterGroupStateFault(v **types.InvalidDBParameterGroupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBParameterGroupStateFault + if *v == nil { + sv = &types.InvalidDBParameterGroupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBProxyEndpointStateFault(v **types.InvalidDBProxyEndpointStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBProxyEndpointStateFault + if *v == nil { + sv = &types.InvalidDBProxyEndpointStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBProxyStateFault(v **types.InvalidDBProxyStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBProxyStateFault + if *v == nil { + sv = &types.InvalidDBProxyStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBSecurityGroupStateFault(v **types.InvalidDBSecurityGroupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBSecurityGroupStateFault + if *v == nil { + sv = &types.InvalidDBSecurityGroupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBShardGroupStateFault(v **types.InvalidDBShardGroupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBShardGroupStateFault + if *v == nil { + sv = &types.InvalidDBShardGroupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBSnapshotStateFault(v **types.InvalidDBSnapshotStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBSnapshotStateFault + if *v == nil { + sv = &types.InvalidDBSnapshotStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBSubnetGroupFault(v **types.InvalidDBSubnetGroupFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBSubnetGroupFault + if *v == nil { + sv = &types.InvalidDBSubnetGroupFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBSubnetGroupStateFault(v **types.InvalidDBSubnetGroupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBSubnetGroupStateFault + if *v == nil { + sv = &types.InvalidDBSubnetGroupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidDBSubnetStateFault(v **types.InvalidDBSubnetStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidDBSubnetStateFault + if *v == nil { + sv = &types.InvalidDBSubnetStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidEventSubscriptionStateFault(v **types.InvalidEventSubscriptionStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidEventSubscriptionStateFault + if *v == nil { + sv = &types.InvalidEventSubscriptionStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidExportOnlyFault(v **types.InvalidExportOnlyFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidExportOnlyFault + if *v == nil { + sv = &types.InvalidExportOnlyFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidExportSourceStateFault(v **types.InvalidExportSourceStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidExportSourceStateFault + if *v == nil { + sv = &types.InvalidExportSourceStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidExportTaskStateFault(v **types.InvalidExportTaskStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidExportTaskStateFault + if *v == nil { + sv = &types.InvalidExportTaskStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidGlobalClusterStateFault(v **types.InvalidGlobalClusterStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidGlobalClusterStateFault + if *v == nil { + sv = &types.InvalidGlobalClusterStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidIntegrationStateFault(v **types.InvalidIntegrationStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidIntegrationStateFault + if *v == nil { + sv = &types.InvalidIntegrationStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidOptionGroupStateFault(v **types.InvalidOptionGroupStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidOptionGroupStateFault + if *v == nil { + sv = &types.InvalidOptionGroupStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidResourceStateFault(v **types.InvalidResourceStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidResourceStateFault + if *v == nil { + sv = &types.InvalidResourceStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidRestoreFault(v **types.InvalidRestoreFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidRestoreFault + if *v == nil { + sv = &types.InvalidRestoreFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidS3BucketFault(v **types.InvalidS3BucketFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidS3BucketFault + if *v == nil { + sv = &types.InvalidS3BucketFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidSubnet(v **types.InvalidSubnet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidSubnet + if *v == nil { + sv = &types.InvalidSubnet{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidVPCNetworkStateFault(v **types.InvalidVPCNetworkStateFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidVPCNetworkStateFault + if *v == nil { + sv = &types.InvalidVPCNetworkStateFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIPRange(v **types.IPRange, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IPRange + if *v == nil { + sv = &types.IPRange{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CIDRIP", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CIDRIP = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIPRangeList(v *[]types.IPRange, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IPRange + if *v == nil { + sv = make([]types.IPRange, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("IPRange", t.Name.Local): + var col types.IPRange + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentIPRange(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIPRangeListUnwrapped(v *[]types.IPRange, decoder smithyxml.NodeDecoder) error { + var sv []types.IPRange + if *v == nil { + sv = make([]types.IPRange, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IPRange + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentIPRange(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentIssueDetails(v **types.IssueDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IssueDetails + if *v == nil { + sv = &types.IssueDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("PerformanceIssueDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPerformanceIssueDetails(&sv.PerformanceIssueDetails, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentKMSKeyNotAccessibleFault(v **types.KMSKeyNotAccessibleFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.KMSKeyNotAccessibleFault + if *v == nil { + sv = &types.KMSKeyNotAccessibleFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLimitlessDatabase(v **types.LimitlessDatabase, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.LimitlessDatabase + if *v == nil { + sv = &types.LimitlessDatabase{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MinRequiredACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinRequiredACU = ptr.Float64(f64) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.LimitlessDatabaseStatus(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLogTypeList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentLogTypeListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentMasterUserSecret(v **types.MasterUserSecret, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MasterUserSecret + if *v == nil { + sv = &types.MasterUserSecret{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("SecretArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretArn = ptr.String(xtv) + } + + case strings.EqualFold("SecretStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretStatus = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMaxDBShardGroupLimitReached(v **types.MaxDBShardGroupLimitReached, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MaxDBShardGroupLimitReached + if *v == nil { + sv = &types.MaxDBShardGroupLimitReached{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetric(v **types.Metric, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Metric + if *v == nil { + sv = &types.Metric{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MetricQuery", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMetricQuery(&sv.MetricQuery, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("References", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMetricReferenceList(&sv.References, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StatisticsDetails", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StatisticsDetails = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetricList(v *[]types.Metric, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Metric + if *v == nil { + sv = make([]types.Metric, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.Metric + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentMetric(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetricListUnwrapped(v *[]types.Metric, decoder smithyxml.NodeDecoder) error { + var sv []types.Metric + if *v == nil { + sv = make([]types.Metric, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Metric + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentMetric(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentMetricQuery(v **types.MetricQuery, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MetricQuery + if *v == nil { + sv = &types.MetricQuery{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("PerformanceInsightsMetricQuery", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPerformanceInsightsMetricQuery(&sv.PerformanceInsightsMetricQuery, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetricReference(v **types.MetricReference, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MetricReference + if *v == nil { + sv = &types.MetricReference{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("ReferenceDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReferenceDetails(&sv.ReferenceDetails, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetricReferenceList(v *[]types.MetricReference, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.MetricReference + if *v == nil { + sv = make([]types.MetricReference, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.MetricReference + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentMetricReference(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMetricReferenceListUnwrapped(v *[]types.MetricReference, decoder smithyxml.NodeDecoder) error { + var sv []types.MetricReference + if *v == nil { + sv = make([]types.MetricReference, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.MetricReference + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentMetricReference(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValue(v **types.MinimumEngineVersionPerAllowedValue, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MinimumEngineVersionPerAllowedValue + if *v == nil { + sv = &types.MinimumEngineVersionPerAllowedValue{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowedValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AllowedValue = ptr.String(xtv) + } + + case strings.EqualFold("MinimumEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MinimumEngineVersion = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValueList(v *[]types.MinimumEngineVersionPerAllowedValue, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.MinimumEngineVersionPerAllowedValue + if *v == nil { + sv = make([]types.MinimumEngineVersionPerAllowedValue, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("MinimumEngineVersionPerAllowedValue", t.Name.Local): + var col types.MinimumEngineVersionPerAllowedValue + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValue(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValueListUnwrapped(v *[]types.MinimumEngineVersionPerAllowedValue, decoder smithyxml.NodeDecoder) error { + var sv []types.MinimumEngineVersionPerAllowedValue + if *v == nil { + sv = make([]types.MinimumEngineVersionPerAllowedValue, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.MinimumEngineVersionPerAllowedValue + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValue(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentNetworkTypeNotSupported(v **types.NetworkTypeNotSupported, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.NetworkTypeNotSupported + if *v == nil { + sv = &types.NetworkTypeNotSupported{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOption(v **types.Option, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Option + if *v == nil { + sv = &types.Option{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroupMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroupMembershipList(&sv.DBSecurityGroupMemberships, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OptionDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionDescription = ptr.String(xtv) + } + + case strings.EqualFold("OptionName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionName = ptr.String(xtv) + } + + case strings.EqualFold("OptionSettings", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionSettingConfigurationList(&sv.OptionSettings, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OptionVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionVersion = ptr.String(xtv) + } + + case strings.EqualFold("Permanent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Permanent = ptr.Bool(xtv) + } + + case strings.EqualFold("Persistent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Persistent = ptr.Bool(xtv) + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("VpcSecurityGroupMemberships", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentVpcSecurityGroupMembershipList(&sv.VpcSecurityGroupMemberships, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroup(v **types.OptionGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroup + if *v == nil { + sv = &types.OptionGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowsVpcAndNonVpcInstanceMemberships", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.AllowsVpcAndNonVpcInstanceMemberships = ptr.Bool(xtv) + } + + case strings.EqualFold("CopyTimestamp", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CopyTimestamp = ptr.Time(t) + } + + case strings.EqualFold("EngineName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineName = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupDescription = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Options", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionsList(&sv.Options, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SourceAccountId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceAccountId = ptr.String(xtv) + } + + case strings.EqualFold("SourceOptionGroup", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceOptionGroup = ptr.String(xtv) + } + + case strings.EqualFold("VpcId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupAlreadyExistsFault(v **types.OptionGroupAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupAlreadyExistsFault + if *v == nil { + sv = &types.OptionGroupAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupMembership(v **types.OptionGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupMembership + if *v == nil { + sv = &types.OptionGroupMembership{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("OptionGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptionGroupName = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupMembershipList(v *[]types.OptionGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionGroupMembership + if *v == nil { + sv = make([]types.OptionGroupMembership, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionGroupMembership", t.Name.Local): + var col types.OptionGroupMembership + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupMembershipListUnwrapped(v *[]types.OptionGroupMembership, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionGroupMembership + if *v == nil { + sv = make([]types.OptionGroupMembership, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionGroupMembership + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionGroupNotFoundFault(v **types.OptionGroupNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupNotFoundFault + if *v == nil { + sv = &types.OptionGroupNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOption(v **types.OptionGroupOption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupOption + if *v == nil { + sv = &types.OptionGroupOption{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CopyableCrossAccount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CopyableCrossAccount = ptr.Bool(xtv) + } + + case strings.EqualFold("DefaultPort", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DefaultPort = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("EngineName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineName = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("MinimumRequiredMinorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MinimumRequiredMinorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupOptionSettings", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroupOptionSettingsList(&sv.OptionGroupOptionSettings, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OptionGroupOptionVersions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroupOptionVersionsList(&sv.OptionGroupOptionVersions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OptionsConflictsWith", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionsConflictsWith(&sv.OptionsConflictsWith, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("OptionsDependedOn", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionsDependedOn(&sv.OptionsDependedOn, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Permanent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Permanent = ptr.Bool(xtv) + } + + case strings.EqualFold("Persistent", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Persistent = ptr.Bool(xtv) + } + + case strings.EqualFold("PortRequired", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.PortRequired = ptr.Bool(xtv) + } + + case strings.EqualFold("RequiresAutoMinorEngineVersionUpgrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.RequiresAutoMinorEngineVersionUpgrade = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsOptionVersionDowngrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsOptionVersionDowngrade = ptr.Bool(xtv) + } + + case strings.EqualFold("VpcOnly", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.VpcOnly = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOptionSetting(v **types.OptionGroupOptionSetting, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupOptionSetting + if *v == nil { + sv = &types.OptionGroupOptionSetting{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowedValues", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AllowedValues = ptr.String(xtv) + } + + case strings.EqualFold("ApplyType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplyType = ptr.String(xtv) + } + + case strings.EqualFold("DefaultValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultValue = ptr.String(xtv) + } + + case strings.EqualFold("IsModifiable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsModifiable = ptr.Bool(xtv) + } + + case strings.EqualFold("IsRequired", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsRequired = ptr.Bool(xtv) + } + + case strings.EqualFold("MinimumEngineVersionPerAllowedValue", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMinimumEngineVersionPerAllowedValueList(&sv.MinimumEngineVersionPerAllowedValue, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SettingDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SettingDescription = ptr.String(xtv) + } + + case strings.EqualFold("SettingName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SettingName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOptionSettingsList(v *[]types.OptionGroupOptionSetting, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionGroupOptionSetting + if *v == nil { + sv = make([]types.OptionGroupOptionSetting, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionGroupOptionSetting", t.Name.Local): + var col types.OptionGroupOptionSetting + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionGroupOptionSetting(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOptionSettingsListUnwrapped(v *[]types.OptionGroupOptionSetting, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionGroupOptionSetting + if *v == nil { + sv = make([]types.OptionGroupOptionSetting, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionGroupOptionSetting + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionGroupOptionSetting(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionGroupOptionsList(v *[]types.OptionGroupOption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionGroupOption + if *v == nil { + sv = make([]types.OptionGroupOption, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionGroupOption", t.Name.Local): + var col types.OptionGroupOption + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionGroupOption(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOptionsListUnwrapped(v *[]types.OptionGroupOption, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionGroupOption + if *v == nil { + sv = make([]types.OptionGroupOption, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionGroupOption + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionGroupOption(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionGroupOptionVersionsList(v *[]types.OptionVersion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionVersion + if *v == nil { + sv = make([]types.OptionVersion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionVersion", t.Name.Local): + var col types.OptionVersion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionVersion(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupOptionVersionsListUnwrapped(v *[]types.OptionVersion, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionVersion + if *v == nil { + sv = make([]types.OptionVersion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionVersion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionVersion(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionGroupQuotaExceededFault(v **types.OptionGroupQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionGroupQuotaExceededFault + if *v == nil { + sv = &types.OptionGroupQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupsList(v *[]types.OptionGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionGroup + if *v == nil { + sv = make([]types.OptionGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionGroup", t.Name.Local): + var col types.OptionGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionGroupsListUnwrapped(v *[]types.OptionGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionGroup + if *v == nil { + sv = make([]types.OptionGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionsConflictsWith(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("OptionConflictName", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionsConflictsWithUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionsDependedOn(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("OptionName", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionsDependedOnUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionSetting(v **types.OptionSetting, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionSetting + if *v == nil { + sv = &types.OptionSetting{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowedValues", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AllowedValues = ptr.String(xtv) + } + + case strings.EqualFold("ApplyType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplyType = ptr.String(xtv) + } + + case strings.EqualFold("DataType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataType = ptr.String(xtv) + } + + case strings.EqualFold("DefaultValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultValue = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("IsCollection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsCollection = ptr.Bool(xtv) + } + + case strings.EqualFold("IsModifiable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsModifiable = ptr.Bool(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionSettingConfigurationList(v *[]types.OptionSetting, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OptionSetting + if *v == nil { + sv = make([]types.OptionSetting, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OptionSetting", t.Name.Local): + var col types.OptionSetting + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOptionSetting(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionSettingConfigurationListUnwrapped(v *[]types.OptionSetting, decoder smithyxml.NodeDecoder) error { + var sv []types.OptionSetting + if *v == nil { + sv = make([]types.OptionSetting, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OptionSetting + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOptionSetting(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionsList(v *[]types.Option, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Option + if *v == nil { + sv = make([]types.Option, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Option", t.Name.Local): + var col types.Option + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOption(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOptionsListUnwrapped(v *[]types.Option, decoder smithyxml.NodeDecoder) error { + var sv []types.Option + if *v == nil { + sv = make([]types.Option, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Option + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOption(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOptionVersion(v **types.OptionVersion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OptionVersion + if *v == nil { + sv = &types.OptionVersion{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("IsDefault", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsDefault = ptr.Bool(xtv) + } + + case strings.EqualFold("Version", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Version = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOrderableDBInstanceOption(v **types.OrderableDBInstanceOption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.OrderableDBInstanceOption + if *v == nil { + sv = &types.OrderableDBInstanceOption{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AvailabilityZoneGroup", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZoneGroup = ptr.String(xtv) + } + + case strings.EqualFold("AvailabilityZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZoneList(&sv.AvailabilityZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("AvailableProcessorFeatures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailableProcessorFeatureList(&sv.AvailableProcessorFeatures, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DBInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MaxIopsPerDbInstance", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxIopsPerDbInstance = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MaxIopsPerGib", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxIopsPerGib = ptr.Float64(f64) + } + + case strings.EqualFold("MaxStorageSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxStorageSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MaxStorageThroughputPerDbInstance", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxStorageThroughputPerDbInstance = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MaxStorageThroughputPerIops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxStorageThroughputPerIops = ptr.Float64(f64) + } + + case strings.EqualFold("MinIopsPerDbInstance", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MinIopsPerDbInstance = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MinIopsPerGib", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinIopsPerGib = ptr.Float64(f64) + } + + case strings.EqualFold("MinStorageSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MinStorageSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MinStorageThroughputPerDbInstance", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MinStorageThroughputPerDbInstance = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MinStorageThroughputPerIops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinStorageThroughputPerIops = ptr.Float64(f64) + } + + case strings.EqualFold("MultiAZCapable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.MultiAZCapable = ptr.Bool(xtv) + } + + case strings.EqualFold("OutpostCapable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.OutpostCapable = ptr.Bool(xtv) + } + + case strings.EqualFold("ReadReplicaCapable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.ReadReplicaCapable = ptr.Bool(xtv) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("SupportedActivityStreamModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentActivityStreamModeList(&sv.SupportedActivityStreamModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNetworkTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.SupportedNetworkTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsClusters", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsClusters = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsDedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsDedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsEnhancedMonitoring", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsEnhancedMonitoring = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIAMDatabaseAuthentication", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIAMDatabaseAuthentication = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIops = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsKerberosAuthentication", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsKerberosAuthentication = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsPerformanceInsights", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsPerformanceInsights = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsStorageAutoscaling", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsStorageAutoscaling = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsStorageEncryption", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsStorageEncryption = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsStorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsStorageThroughput = ptr.Bool(xtv) + } + + case strings.EqualFold("Vpc", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.Vpc = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOrderableDBInstanceOptionsList(v *[]types.OrderableDBInstanceOption, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.OrderableDBInstanceOption + if *v == nil { + sv = make([]types.OrderableDBInstanceOption, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("OrderableDBInstanceOption", t.Name.Local): + var col types.OrderableDBInstanceOption + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentOrderableDBInstanceOption(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentOrderableDBInstanceOptionsListUnwrapped(v *[]types.OrderableDBInstanceOption, decoder smithyxml.NodeDecoder) error { + var sv []types.OrderableDBInstanceOption + if *v == nil { + sv = make([]types.OrderableDBInstanceOption, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.OrderableDBInstanceOption + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentOrderableDBInstanceOption(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentOutpost(v **types.Outpost, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Outpost + if *v == nil { + sv = &types.Outpost{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Arn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Arn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentParameter(v **types.Parameter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Parameter + if *v == nil { + sv = &types.Parameter{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllowedValues", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AllowedValues = ptr.String(xtv) + } + + case strings.EqualFold("ApplyMethod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplyMethod = types.ApplyMethod(xtv) + } + + case strings.EqualFold("ApplyType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ApplyType = ptr.String(xtv) + } + + case strings.EqualFold("DataType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataType = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("IsModifiable", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsModifiable = ptr.Bool(xtv) + } + + case strings.EqualFold("MinimumEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MinimumEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ParameterName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ParameterName = ptr.String(xtv) + } + + case strings.EqualFold("ParameterValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ParameterValue = ptr.String(xtv) + } + + case strings.EqualFold("Source", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Source = ptr.String(xtv) + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentParametersList(v *[]types.Parameter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Parameter + if *v == nil { + sv = make([]types.Parameter, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Parameter", t.Name.Local): + var col types.Parameter + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentParameter(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentParametersListUnwrapped(v *[]types.Parameter, decoder smithyxml.NodeDecoder) error { + var sv []types.Parameter + if *v == nil { + sv = make([]types.Parameter, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Parameter + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentParameter(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPendingCloudwatchLogsExports(v **types.PendingCloudwatchLogsExports, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PendingCloudwatchLogsExports + if *v == nil { + sv = &types.PendingCloudwatchLogsExports{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("LogTypesToDisable", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.LogTypesToDisable, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("LogTypesToEnable", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.LogTypesToEnable, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPendingMaintenanceAction(v **types.PendingMaintenanceAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PendingMaintenanceAction + if *v == nil { + sv = &types.PendingMaintenanceAction{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Action", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Action = ptr.String(xtv) + } + + case strings.EqualFold("AutoAppliedAfterDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.AutoAppliedAfterDate = ptr.Time(t) + } + + case strings.EqualFold("CurrentApplyDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CurrentApplyDate = ptr.Time(t) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("ForcedApplyDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ForcedApplyDate = ptr.Time(t) + } + + case strings.EqualFold("OptInStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OptInStatus = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPendingMaintenanceActionDetails(v *[]types.PendingMaintenanceAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.PendingMaintenanceAction + if *v == nil { + sv = make([]types.PendingMaintenanceAction, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("PendingMaintenanceAction", t.Name.Local): + var col types.PendingMaintenanceAction + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentPendingMaintenanceAction(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPendingMaintenanceActionDetailsUnwrapped(v *[]types.PendingMaintenanceAction, decoder smithyxml.NodeDecoder) error { + var sv []types.PendingMaintenanceAction + if *v == nil { + sv = make([]types.PendingMaintenanceAction, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.PendingMaintenanceAction + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentPendingMaintenanceAction(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPendingMaintenanceActions(v *[]types.ResourcePendingMaintenanceActions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ResourcePendingMaintenanceActions + if *v == nil { + sv = make([]types.ResourcePendingMaintenanceActions, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ResourcePendingMaintenanceActions", t.Name.Local): + var col types.ResourcePendingMaintenanceActions + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentResourcePendingMaintenanceActions(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPendingMaintenanceActionsUnwrapped(v *[]types.ResourcePendingMaintenanceActions, decoder smithyxml.NodeDecoder) error { + var sv []types.ResourcePendingMaintenanceActions + if *v == nil { + sv = make([]types.ResourcePendingMaintenanceActions, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ResourcePendingMaintenanceActions + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentResourcePendingMaintenanceActions(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentPendingModifiedValues(v **types.PendingModifiedValues, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PendingModifiedValues + if *v == nil { + sv = &types.PendingModifiedValues{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AllocatedStorage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.AllocatedStorage = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("AutomationMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AutomationMode = types.AutomationMode(xtv) + } + + case strings.EqualFold("BackupRetentionPeriod", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.BackupRetentionPeriod = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("CACertificateIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CACertificateIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBSubnetGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBSubnetGroupName = ptr.String(xtv) + } + + case strings.EqualFold("DedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.DedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("Iops", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Iops = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("LicenseModel", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LicenseModel = ptr.String(xtv) + } + + case strings.EqualFold("MasterUserPassword", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUserPassword = ptr.String(xtv) + } + + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiAZ = ptr.Bool(xtv) + } + + case strings.EqualFold("MultiTenant", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.MultiTenant = ptr.Bool(xtv) + } + + case strings.EqualFold("PendingCloudwatchLogsExports", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingCloudwatchLogsExports(&sv.PendingCloudwatchLogsExports, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("ProcessorFeatures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentProcessorFeatureList(&sv.ProcessorFeatures, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ResumeFullAutomationModeTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.ResumeFullAutomationModeTime = ptr.Time(t) + } + + case strings.EqualFold("StorageThroughput", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.StorageThroughput = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPerformanceInsightsMetricDimensionGroup(v **types.PerformanceInsightsMetricDimensionGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PerformanceInsightsMetricDimensionGroup + if *v == nil { + sv = &types.PerformanceInsightsMetricDimensionGroup{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Dimensions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.Dimensions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Group", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Group = ptr.String(xtv) + } + + case strings.EqualFold("Limit", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Limit = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPerformanceInsightsMetricQuery(v **types.PerformanceInsightsMetricQuery, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PerformanceInsightsMetricQuery + if *v == nil { + sv = &types.PerformanceInsightsMetricQuery{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GroupBy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPerformanceInsightsMetricDimensionGroup(&sv.GroupBy, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Metric", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Metric = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPerformanceIssueDetails(v **types.PerformanceIssueDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PerformanceIssueDetails + if *v == nil { + sv = &types.PerformanceIssueDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Analysis", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Analysis = ptr.String(xtv) + } + + case strings.EqualFold("EndTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case strings.EqualFold("Metrics", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentMetricList(&sv.Metrics, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPointInTimeRestoreNotEnabledFault(v **types.PointInTimeRestoreNotEnabledFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PointInTimeRestoreNotEnabledFault + if *v == nil { + sv = &types.PointInTimeRestoreNotEnabledFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentProcessorFeature(v **types.ProcessorFeature, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ProcessorFeature + if *v == nil { + sv = &types.ProcessorFeature{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentProcessorFeatureList(v *[]types.ProcessorFeature, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ProcessorFeature + if *v == nil { + sv = make([]types.ProcessorFeature, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ProcessorFeature", t.Name.Local): + var col types.ProcessorFeature + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentProcessorFeature(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentProcessorFeatureListUnwrapped(v *[]types.ProcessorFeature, decoder smithyxml.NodeDecoder) error { + var sv []types.ProcessorFeature + if *v == nil { + sv = make([]types.ProcessorFeature, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ProcessorFeature + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentProcessorFeature(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentProvisionedIopsNotAvailableInAZFault(v **types.ProvisionedIopsNotAvailableInAZFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ProvisionedIopsNotAvailableInAZFault + if *v == nil { + sv = &types.ProvisionedIopsNotAvailableInAZFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRange(v **types.Range, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Range + if *v == nil { + sv = &types.Range{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("From", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.From = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Step", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Step = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("To", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.To = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRangeList(v *[]types.Range, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Range + if *v == nil { + sv = make([]types.Range, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Range", t.Name.Local): + var col types.Range + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRange(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRangeListUnwrapped(v *[]types.Range, decoder smithyxml.NodeDecoder) error { + var sv []types.Range + if *v == nil { + sv = make([]types.Range, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Range + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRange(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRdsCustomClusterConfiguration(v **types.RdsCustomClusterConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RdsCustomClusterConfiguration + if *v == nil { + sv = &types.RdsCustomClusterConfiguration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("InterconnectSubnetId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InterconnectSubnetId = ptr.String(xtv) + } + + case strings.EqualFold("ReplicaMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReplicaMode = types.ReplicaMode(xtv) + } + + case strings.EqualFold("TransitGatewayMulticastDomainId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TransitGatewayMulticastDomainId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReadersArnList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReadersArnListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReadReplicaDBClusterIdentifierList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("ReadReplicaDBClusterIdentifier", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReadReplicaDBClusterIdentifierListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReadReplicaDBInstanceIdentifierList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("ReadReplicaDBInstanceIdentifier", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReadReplicaDBInstanceIdentifierListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReadReplicaIdentifierList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("ReadReplicaIdentifier", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReadReplicaIdentifierListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRecommendedAction(v **types.RecommendedAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RecommendedAction + if *v == nil { + sv = &types.RecommendedAction{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ActionId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ActionId = ptr.String(xtv) + } + + case strings.EqualFold("ApplyModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ApplyModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ContextAttributes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentContextAttributeList(&sv.ContextAttributes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("IssueDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIssueDetails(&sv.IssueDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Operation", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Operation = ptr.String(xtv) + } + + case strings.EqualFold("Parameters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecommendedActionParameterList(&sv.Parameters, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("Title", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Title = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecommendedActionList(v *[]types.RecommendedAction, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.RecommendedAction + if *v == nil { + sv = make([]types.RecommendedAction, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.RecommendedAction + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRecommendedAction(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecommendedActionListUnwrapped(v *[]types.RecommendedAction, decoder smithyxml.NodeDecoder) error { + var sv []types.RecommendedAction + if *v == nil { + sv = make([]types.RecommendedAction, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.RecommendedAction + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRecommendedAction(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRecommendedActionParameter(v **types.RecommendedActionParameter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RecommendedActionParameter + if *v == nil { + sv = &types.RecommendedActionParameter{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecommendedActionParameterList(v *[]types.RecommendedActionParameter, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.RecommendedActionParameter + if *v == nil { + sv = make([]types.RecommendedActionParameter, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.RecommendedActionParameter + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRecommendedActionParameter(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecommendedActionParameterListUnwrapped(v *[]types.RecommendedActionParameter, decoder smithyxml.NodeDecoder) error { + var sv []types.RecommendedActionParameter + if *v == nil { + sv = make([]types.RecommendedActionParameter, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.RecommendedActionParameter + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRecommendedActionParameter(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentRecurringCharge(v **types.RecurringCharge, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RecurringCharge + if *v == nil { + sv = &types.RecurringCharge{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("RecurringChargeAmount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.RecurringChargeAmount = ptr.Float64(f64) + } + + case strings.EqualFold("RecurringChargeFrequency", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RecurringChargeFrequency = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecurringChargeList(v *[]types.RecurringCharge, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.RecurringCharge + if *v == nil { + sv = make([]types.RecurringCharge, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("RecurringCharge", t.Name.Local): + var col types.RecurringCharge + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentRecurringCharge(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRecurringChargeListUnwrapped(v *[]types.RecurringCharge, decoder smithyxml.NodeDecoder) error { + var sv []types.RecurringCharge + if *v == nil { + sv = make([]types.RecurringCharge, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.RecurringCharge + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentRecurringCharge(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReferenceDetails(v **types.ReferenceDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReferenceDetails + if *v == nil { + sv = &types.ReferenceDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ScalarReferenceDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentScalarReferenceDetails(&sv.ScalarReferenceDetails, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstance(v **types.ReservedDBInstance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstance + if *v == nil { + sv = &types.ReservedDBInstance{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CurrencyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CurrencyCode = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DBInstanceCount = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Duration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Duration = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("FixedPrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.FixedPrice = ptr.Float64(f64) + } + + case strings.EqualFold("LeaseId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LeaseId = ptr.String(xtv) + } + + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.MultiAZ = ptr.Bool(xtv) + } + + case strings.EqualFold("OfferingType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OfferingType = ptr.String(xtv) + } + + case strings.EqualFold("ProductDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ProductDescription = ptr.String(xtv) + } + + case strings.EqualFold("RecurringCharges", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReservedDBInstanceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedDBInstanceArn = ptr.String(xtv) + } + + case strings.EqualFold("ReservedDBInstanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedDBInstanceId = ptr.String(xtv) + } + + case strings.EqualFold("ReservedDBInstancesOfferingId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedDBInstancesOfferingId = ptr.String(xtv) + } + + case strings.EqualFold("StartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + case strings.EqualFold("State", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = ptr.String(xtv) + } + + case strings.EqualFold("UsagePrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.UsagePrice = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstanceAlreadyExistsFault(v **types.ReservedDBInstanceAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstanceAlreadyExistsFault + if *v == nil { + sv = &types.ReservedDBInstanceAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstanceList(v *[]types.ReservedDBInstance, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReservedDBInstance + if *v == nil { + sv = make([]types.ReservedDBInstance, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ReservedDBInstance", t.Name.Local): + var col types.ReservedDBInstance + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReservedDBInstance(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstanceListUnwrapped(v *[]types.ReservedDBInstance, decoder smithyxml.NodeDecoder) error { + var sv []types.ReservedDBInstance + if *v == nil { + sv = make([]types.ReservedDBInstance, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReservedDBInstance + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReservedDBInstance(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReservedDBInstanceNotFoundFault(v **types.ReservedDBInstanceNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstanceNotFoundFault + if *v == nil { + sv = &types.ReservedDBInstanceNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstanceQuotaExceededFault(v **types.ReservedDBInstanceQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstanceQuotaExceededFault + if *v == nil { + sv = &types.ReservedDBInstanceQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstancesOffering(v **types.ReservedDBInstancesOffering, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstancesOffering + if *v == nil { + sv = &types.ReservedDBInstancesOffering{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CurrencyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CurrencyCode = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceClass", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceClass = ptr.String(xtv) + } + + case strings.EqualFold("Duration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Duration = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("FixedPrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.FixedPrice = ptr.Float64(f64) + } + + case strings.EqualFold("MultiAZ", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.MultiAZ = ptr.Bool(xtv) + } + + case strings.EqualFold("OfferingType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OfferingType = ptr.String(xtv) + } + + case strings.EqualFold("ProductDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ProductDescription = ptr.String(xtv) + } + + case strings.EqualFold("RecurringCharges", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ReservedDBInstancesOfferingId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ReservedDBInstancesOfferingId = ptr.String(xtv) + } + + case strings.EqualFold("UsagePrice", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.UsagePrice = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstancesOfferingList(v *[]types.ReservedDBInstancesOffering, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ReservedDBInstancesOffering + if *v == nil { + sv = make([]types.ReservedDBInstancesOffering, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ReservedDBInstancesOffering", t.Name.Local): + var col types.ReservedDBInstancesOffering + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentReservedDBInstancesOffering(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentReservedDBInstancesOfferingListUnwrapped(v *[]types.ReservedDBInstancesOffering, decoder smithyxml.NodeDecoder) error { + var sv []types.ReservedDBInstancesOffering + if *v == nil { + sv = make([]types.ReservedDBInstancesOffering, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ReservedDBInstancesOffering + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentReservedDBInstancesOffering(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentReservedDBInstancesOfferingNotFoundFault(v **types.ReservedDBInstancesOfferingNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ReservedDBInstancesOfferingNotFoundFault + if *v == nil { + sv = &types.ReservedDBInstancesOfferingNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentResourceNotFoundFault(v **types.ResourceNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ResourceNotFoundFault + if *v == nil { + sv = &types.ResourceNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentResourcePendingMaintenanceActions(v **types.ResourcePendingMaintenanceActions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ResourcePendingMaintenanceActions + if *v == nil { + sv = &types.ResourcePendingMaintenanceActions{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("PendingMaintenanceActionDetails", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingMaintenanceActionDetails(&sv.PendingMaintenanceActionDetails, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ResourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceIdentifier = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRestoreWindow(v **types.RestoreWindow, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RestoreWindow + if *v == nil { + sv = &types.RestoreWindow{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EarliestTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.EarliestTime = ptr.Time(t) + } + + case strings.EqualFold("LatestTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LatestTime = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentScalarReferenceDetails(v **types.ScalarReferenceDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ScalarReferenceDetails + if *v == nil { + sv = &types.ScalarReferenceDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.Value = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentScalingConfigurationInfo(v **types.ScalingConfigurationInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ScalingConfigurationInfo + if *v == nil { + sv = &types.ScalingConfigurationInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AutoPause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.AutoPause = ptr.Bool(xtv) + } + + case strings.EqualFold("MaxCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxCapacity = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MinCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MinCapacity = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SecondsBeforeTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SecondsBeforeTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SecondsUntilAutoPause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SecondsUntilAutoPause = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("TimeoutAction", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TimeoutAction = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentServerlessV2FeaturesSupport(v **types.ServerlessV2FeaturesSupport, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ServerlessV2FeaturesSupport + if *v == nil { + sv = &types.ServerlessV2FeaturesSupport{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MaxCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxCapacity = ptr.Float64(f64) + } + + case strings.EqualFold("MinCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinCapacity = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentServerlessV2ScalingConfigurationInfo(v **types.ServerlessV2ScalingConfigurationInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ServerlessV2ScalingConfigurationInfo + if *v == nil { + sv = &types.ServerlessV2ScalingConfigurationInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MaxCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxCapacity = ptr.Float64(f64) + } + + case strings.EqualFold("MinCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinCapacity = ptr.Float64(f64) + } + + case strings.EqualFold("SecondsUntilAutoPause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SecondsUntilAutoPause = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSharedSnapshotQuotaExceededFault(v **types.SharedSnapshotQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SharedSnapshotQuotaExceededFault + if *v == nil { + sv = &types.SharedSnapshotQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSnapshotQuotaExceededFault(v **types.SnapshotQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SnapshotQuotaExceededFault + if *v == nil { + sv = &types.SnapshotQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSNSInvalidTopicFault(v **types.SNSInvalidTopicFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SNSInvalidTopicFault + if *v == nil { + sv = &types.SNSInvalidTopicFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSNSNoAuthorizationFault(v **types.SNSNoAuthorizationFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SNSNoAuthorizationFault + if *v == nil { + sv = &types.SNSNoAuthorizationFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSNSTopicArnNotFoundFault(v **types.SNSTopicArnNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SNSTopicArnNotFoundFault + if *v == nil { + sv = &types.SNSTopicArnNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceClusterNotSupportedFault(v **types.SourceClusterNotSupportedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SourceClusterNotSupportedFault + if *v == nil { + sv = &types.SourceClusterNotSupportedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceDatabaseNotSupportedFault(v **types.SourceDatabaseNotSupportedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SourceDatabaseNotSupportedFault + if *v == nil { + sv = &types.SourceDatabaseNotSupportedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceIdsList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("SourceId", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceIdsListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSourceNotFoundFault(v **types.SourceNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SourceNotFoundFault + if *v == nil { + sv = &types.SourceNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceRegion(v **types.SourceRegion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SourceRegion + if *v == nil { + sv = &types.SourceRegion{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("RegionName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RegionName = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SupportsDBInstanceAutomatedBackupsReplication", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsDBInstanceAutomatedBackupsReplication = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceRegionList(v *[]types.SourceRegion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.SourceRegion + if *v == nil { + sv = make([]types.SourceRegion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("SourceRegion", t.Name.Local): + var col types.SourceRegion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentSourceRegion(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSourceRegionListUnwrapped(v *[]types.SourceRegion, decoder smithyxml.NodeDecoder) error { + var sv []types.SourceRegion + if *v == nil { + sv = make([]types.SourceRegion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.SourceRegion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentSourceRegion(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentStorageQuotaExceededFault(v **types.StorageQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StorageQuotaExceededFault + if *v == nil { + sv = &types.StorageQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentStorageTypeNotAvailableFault(v **types.StorageTypeNotAvailableFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StorageTypeNotAvailableFault + if *v == nil { + sv = &types.StorageTypeNotAvailableFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentStorageTypeNotSupportedFault(v **types.StorageTypeNotSupportedFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StorageTypeNotSupportedFault + if *v == nil { + sv = &types.StorageTypeNotSupportedFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentStringList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentStringListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSubnet(v **types.Subnet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Subnet + if *v == nil { + sv = &types.Subnet{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("SubnetAvailabilityZone", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailabilityZone(&sv.SubnetAvailabilityZone, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SubnetIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubnetIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("SubnetOutpost", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOutpost(&sv.SubnetOutpost, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SubnetStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubnetStatus = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubnetAlreadyInUse(v **types.SubnetAlreadyInUse, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SubnetAlreadyInUse + if *v == nil { + sv = &types.SubnetAlreadyInUse{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubnetList(v *[]types.Subnet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Subnet + if *v == nil { + sv = make([]types.Subnet, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Subnet", t.Name.Local): + var col types.Subnet + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentSubnet(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubnetListUnwrapped(v *[]types.Subnet, decoder smithyxml.NodeDecoder) error { + var sv []types.Subnet + if *v == nil { + sv = make([]types.Subnet, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Subnet + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentSubnet(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSubscriptionAlreadyExistFault(v **types.SubscriptionAlreadyExistFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SubscriptionAlreadyExistFault + if *v == nil { + sv = &types.SubscriptionAlreadyExistFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubscriptionCategoryNotFoundFault(v **types.SubscriptionCategoryNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SubscriptionCategoryNotFoundFault + if *v == nil { + sv = &types.SubscriptionCategoryNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSubscriptionNotFoundFault(v **types.SubscriptionNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SubscriptionNotFoundFault + if *v == nil { + sv = &types.SubscriptionNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSupportedCharacterSetsList(v *[]types.CharacterSet, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.CharacterSet + if *v == nil { + sv = make([]types.CharacterSet, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("CharacterSet", t.Name.Local): + var col types.CharacterSet + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentCharacterSet(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSupportedCharacterSetsListUnwrapped(v *[]types.CharacterSet, decoder smithyxml.NodeDecoder) error { + var sv []types.CharacterSet + if *v == nil { + sv = make([]types.CharacterSet, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.CharacterSet + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentCharacterSet(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSupportedTimezonesList(v *[]types.Timezone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Timezone + if *v == nil { + sv = make([]types.Timezone, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Timezone", t.Name.Local): + var col types.Timezone + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTimezone(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSupportedTimezonesListUnwrapped(v *[]types.Timezone, decoder smithyxml.NodeDecoder) error { + var sv []types.Timezone + if *v == nil { + sv = make([]types.Timezone, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Timezone + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTimezone(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentSwitchoverDetail(v **types.SwitchoverDetail, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SwitchoverDetail + if *v == nil { + sv = &types.SwitchoverDetail{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("SourceMember", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceMember = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TargetMember", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetMember = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSwitchoverDetailList(v *[]types.SwitchoverDetail, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.SwitchoverDetail + if *v == nil { + sv = make([]types.SwitchoverDetail, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.SwitchoverDetail + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentSwitchoverDetail(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentSwitchoverDetailListUnwrapped(v *[]types.SwitchoverDetail, decoder smithyxml.NodeDecoder) error { + var sv []types.SwitchoverDetail + if *v == nil { + sv = make([]types.SwitchoverDetail, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.SwitchoverDetail + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentSwitchoverDetail(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Key = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagList(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Tag + if *v == nil { + sv = make([]types.Tag, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Tag", t.Name.Local): + var col types.Tag + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTagListUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error { + var sv []types.Tag + if *v == nil { + sv = make([]types.Tag, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.Tag + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTargetGroupList(v *[]types.DBProxyTargetGroup, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBProxyTargetGroup + if *v == nil { + sv = make([]types.DBProxyTargetGroup, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DBProxyTargetGroup + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBProxyTargetGroup(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTargetGroupListUnwrapped(v *[]types.DBProxyTargetGroup, decoder smithyxml.NodeDecoder) error { + var sv []types.DBProxyTargetGroup + if *v == nil { + sv = make([]types.DBProxyTargetGroup, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBProxyTargetGroup + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBProxyTargetGroup(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTargetHealth(v **types.TargetHealth, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TargetHealth + if *v == nil { + sv = &types.TargetHealth{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Reason", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Reason = types.TargetHealthReason(xtv) + } + + case strings.EqualFold("State", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.TargetState(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTargetList(v *[]types.DBProxyTarget, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.DBProxyTarget + if *v == nil { + sv = make([]types.DBProxyTarget, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.DBProxyTarget + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentDBProxyTarget(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTargetListUnwrapped(v *[]types.DBProxyTarget, decoder smithyxml.NodeDecoder) error { + var sv []types.DBProxyTarget + if *v == nil { + sv = make([]types.DBProxyTarget, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.DBProxyTarget + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentDBProxyTarget(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTenantDatabase(v **types.TenantDatabase, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TenantDatabase + if *v == nil { + sv = &types.TenantDatabase{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("DBInstanceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBInstanceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DbiResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DbiResourceId = ptr.String(xtv) + } + + case strings.EqualFold("DeletionProtection", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.DeletionProtection = ptr.Bool(xtv) + } + + case strings.EqualFold("MasterUsername", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUsername = ptr.String(xtv) + } + + case strings.EqualFold("NcharCharacterSetName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NcharCharacterSetName = ptr.String(xtv) + } + + case strings.EqualFold("PendingModifiedValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTenantDatabasePendingModifiedValues(&sv.PendingModifiedValues, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TenantDatabaseARN", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDatabaseARN = ptr.String(xtv) + } + + case strings.EqualFold("TenantDatabaseCreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TenantDatabaseCreateTime = ptr.Time(t) + } + + case strings.EqualFold("TenantDatabaseResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDatabaseResourceId = ptr.String(xtv) + } + + case strings.EqualFold("TenantDBName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDBName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabaseAlreadyExistsFault(v **types.TenantDatabaseAlreadyExistsFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TenantDatabaseAlreadyExistsFault + if *v == nil { + sv = &types.TenantDatabaseAlreadyExistsFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabaseNotFoundFault(v **types.TenantDatabaseNotFoundFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TenantDatabaseNotFoundFault + if *v == nil { + sv = &types.TenantDatabaseNotFoundFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabasePendingModifiedValues(v **types.TenantDatabasePendingModifiedValues, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TenantDatabasePendingModifiedValues + if *v == nil { + sv = &types.TenantDatabasePendingModifiedValues{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MasterUserPassword", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUserPassword = ptr.String(xtv) + } + + case strings.EqualFold("TenantDBName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TenantDBName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabaseQuotaExceededFault(v **types.TenantDatabaseQuotaExceededFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TenantDatabaseQuotaExceededFault + if *v == nil { + sv = &types.TenantDatabaseQuotaExceededFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabasesList(v *[]types.TenantDatabase, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.TenantDatabase + if *v == nil { + sv = make([]types.TenantDatabase, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("TenantDatabase", t.Name.Local): + var col types.TenantDatabase + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentTenantDatabase(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentTenantDatabasesListUnwrapped(v *[]types.TenantDatabase, decoder smithyxml.NodeDecoder) error { + var sv []types.TenantDatabase + if *v == nil { + sv = make([]types.TenantDatabase, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.TenantDatabase + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentTenantDatabase(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentTimezone(v **types.Timezone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Timezone + if *v == nil { + sv = &types.Timezone{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TimezoneName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TimezoneName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUnsupportedDBEngineVersionFault(v **types.UnsupportedDBEngineVersionFault, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.UnsupportedDBEngineVersionFault + if *v == nil { + sv = &types.UnsupportedDBEngineVersionFault{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUpgradeTarget(v **types.UpgradeTarget, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.UpgradeTarget + if *v == nil { + sv = &types.UpgradeTarget{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AutoUpgrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.AutoUpgrade = ptr.Bool(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IsMajorVersionUpgrade", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.IsMajorVersionUpgrade = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsBabelfish", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsBabelfish = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIntegrations", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsIntegrations = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLimitlessDatabase", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLimitlessDatabase = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLocalWriteForwarding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLocalWriteForwarding = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsParallelQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsParallelQuery = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUserAuthConfigInfo(v **types.UserAuthConfigInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.UserAuthConfigInfo + if *v == nil { + sv = &types.UserAuthConfigInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AuthScheme", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AuthScheme = types.AuthScheme(xtv) + } + + case strings.EqualFold("ClientPasswordAuthType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ClientPasswordAuthType = types.ClientPasswordAuthType(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("IAMAuth", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IAMAuth = types.IAMAuthMode(xtv) + } + + case strings.EqualFold("SecretArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretArn = ptr.String(xtv) + } + + case strings.EqualFold("UserName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUserAuthConfigInfoList(v *[]types.UserAuthConfigInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.UserAuthConfigInfo + if *v == nil { + sv = make([]types.UserAuthConfigInfo, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("member", t.Name.Local): + var col types.UserAuthConfigInfo + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentUserAuthConfigInfo(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentUserAuthConfigInfoListUnwrapped(v *[]types.UserAuthConfigInfo, decoder smithyxml.NodeDecoder) error { + var sv []types.UserAuthConfigInfo + if *v == nil { + sv = make([]types.UserAuthConfigInfo, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.UserAuthConfigInfo + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentUserAuthConfigInfo(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentValidDBInstanceModificationsMessage(v **types.ValidDBInstanceModificationsMessage, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ValidDBInstanceModificationsMessage + if *v == nil { + sv = &types.ValidDBInstanceModificationsMessage{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Storage", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidStorageOptionsList(&sv.Storage, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsDedicatedLogVolume", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsDedicatedLogVolume = ptr.Bool(xtv) + } + + case strings.EqualFold("ValidProcessorFeatures", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAvailableProcessorFeatureList(&sv.ValidProcessorFeatures, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentValidStorageOptions(v **types.ValidStorageOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ValidStorageOptions + if *v == nil { + sv = &types.ValidStorageOptions{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("IopsToStorageRatio", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDoubleRangeList(&sv.IopsToStorageRatio, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ProvisionedIops", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRangeList(&sv.ProvisionedIops, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ProvisionedStorageThroughput", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRangeList(&sv.ProvisionedStorageThroughput, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageSize", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentRangeList(&sv.StorageSize, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageThroughputToIopsRatio", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDoubleRangeList(&sv.StorageThroughputToIopsRatio, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StorageType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.StorageType = ptr.String(xtv) + } + + case strings.EqualFold("SupportsStorageAutoscaling", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsStorageAutoscaling = ptr.Bool(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentValidStorageOptionsList(v *[]types.ValidStorageOptions, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ValidStorageOptions + if *v == nil { + sv = make([]types.ValidStorageOptions, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ValidStorageOptions", t.Name.Local): + var col types.ValidStorageOptions + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentValidStorageOptions(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentValidStorageOptionsListUnwrapped(v *[]types.ValidStorageOptions, decoder smithyxml.NodeDecoder) error { + var sv []types.ValidStorageOptions + if *v == nil { + sv = make([]types.ValidStorageOptions, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ValidStorageOptions + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentValidStorageOptions(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentValidUpgradeTargetList(v *[]types.UpgradeTarget, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.UpgradeTarget + if *v == nil { + sv = make([]types.UpgradeTarget, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("UpgradeTarget", t.Name.Local): + var col types.UpgradeTarget + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentUpgradeTarget(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentValidUpgradeTargetListUnwrapped(v *[]types.UpgradeTarget, decoder smithyxml.NodeDecoder) error { + var sv []types.UpgradeTarget + if *v == nil { + sv = make([]types.UpgradeTarget, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.UpgradeTarget + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentUpgradeTarget(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeDocumentVpcSecurityGroupMembership(v **types.VpcSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.VpcSecurityGroupMembership + if *v == nil { + sv = &types.VpcSecurityGroupMembership{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("VpcSecurityGroupId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.VpcSecurityGroupId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentVpcSecurityGroupMembershipList(v *[]types.VpcSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.VpcSecurityGroupMembership + if *v == nil { + sv = make([]types.VpcSecurityGroupMembership, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("VpcSecurityGroupMembership", t.Name.Local): + var col types.VpcSecurityGroupMembership + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsAwsquery_deserializeDocumentVpcSecurityGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentVpcSecurityGroupMembershipListUnwrapped(v *[]types.VpcSecurityGroupMembership, decoder smithyxml.NodeDecoder) error { + var sv []types.VpcSecurityGroupMembership + if *v == nil { + sv = make([]types.VpcSecurityGroupMembership, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.VpcSecurityGroupMembership + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsAwsquery_deserializeDocumentVpcSecurityGroupMembership(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsAwsquery_deserializeOpDocumentAddSourceIdentifierToSubscriptionOutput(v **AddSourceIdentifierToSubscriptionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AddSourceIdentifierToSubscriptionOutput + if *v == nil { + sv = &AddSourceIdentifierToSubscriptionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscription(&sv.EventSubscription, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentApplyPendingMaintenanceActionOutput(v **ApplyPendingMaintenanceActionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ApplyPendingMaintenanceActionOutput + if *v == nil { + sv = &ApplyPendingMaintenanceActionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ResourcePendingMaintenanceActions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentResourcePendingMaintenanceActions(&sv.ResourcePendingMaintenanceActions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAuthorizeDBSecurityGroupIngressOutput(v **AuthorizeDBSecurityGroupIngressOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AuthorizeDBSecurityGroupIngressOutput + if *v == nil { + sv = &AuthorizeDBSecurityGroupIngressOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroup(&sv.DBSecurityGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentBacktrackDBClusterOutput(v **BacktrackDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *BacktrackDBClusterOutput + if *v == nil { + sv = &BacktrackDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BacktrackedFrom", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackedFrom = ptr.Time(t) + } + + case strings.EqualFold("BacktrackIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BacktrackIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("BacktrackRequestCreationTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackRequestCreationTime = ptr.Time(t) + } + + case strings.EqualFold("BacktrackTo", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.BacktrackTo = ptr.Time(t) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCancelExportTaskOutput(v **CancelExportTaskOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CancelExportTaskOutput + if *v == nil { + sv = &CancelExportTaskOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ExportOnly", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExportOnly, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ExportTaskIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ExportTaskIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("FailureCause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FailureCause = ptr.String(xtv) + } + + case strings.EqualFold("IamRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IamRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PercentProgress = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("S3Bucket", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Bucket = ptr.String(xtv) + } + + case strings.EqualFold("S3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("SnapshotTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotTime = ptr.Time(t) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = types.ExportSourceType(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TaskEndTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskEndTime = ptr.Time(t) + } + + case strings.EqualFold("TaskStartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskStartTime = ptr.Time(t) + } + + case strings.EqualFold("TotalExtractedDataInGB", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TotalExtractedDataInGB = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("WarningMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.WarningMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCopyDBClusterParameterGroupOutput(v **CopyDBClusterParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyDBClusterParameterGroupOutput + if *v == nil { + sv = &CopyDBClusterParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterParameterGroup(&sv.DBClusterParameterGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCopyDBClusterSnapshotOutput(v **CopyDBClusterSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyDBClusterSnapshotOutput + if *v == nil { + sv = &CopyDBClusterSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshot(&sv.DBClusterSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCopyDBParameterGroupOutput(v **CopyDBParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyDBParameterGroupOutput + if *v == nil { + sv = &CopyDBParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBParameterGroup(&sv.DBParameterGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCopyDBSnapshotOutput(v **CopyDBSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyDBSnapshotOutput + if *v == nil { + sv = &CopyDBSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshot(&sv.DBSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCopyOptionGroupOutput(v **CopyOptionGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyOptionGroupOutput + if *v == nil { + sv = &CopyOptionGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("OptionGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroup(&sv.OptionGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateBlueGreenDeploymentOutput(v **CreateBlueGreenDeploymentOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateBlueGreenDeploymentOutput + if *v == nil { + sv = &CreateBlueGreenDeploymentOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BlueGreenDeployment", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBlueGreenDeployment(&sv.BlueGreenDeployment, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateCustomDBEngineVersionOutput(v **CreateCustomDBEngineVersionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateCustomDBEngineVersionOutput + if *v == nil { + sv = &CreateCustomDBEngineVersionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("CustomDBEngineVersionManifest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomDBEngineVersionManifest = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3BucketName = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineMediaType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineMediaType = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionArn = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("DefaultCharacterSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCharacterSet(&sv.DefaultCharacterSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ExportableLogTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.ExportableLogTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Image", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCustomDBEngineVersionAMI(&sv.Image, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ServerlessV2FeaturesSupport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServerlessV2FeaturesSupport(&sv.ServerlessV2FeaturesSupport, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SupportedCACertificateIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCACertificateIdentifiersList(&sv.SupportedCACertificateIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedFeatureNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFeatureNameList(&sv.SupportedFeatureNames, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNcharCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedNcharCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedTimezones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedTimezonesList(&sv.SupportedTimezones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsBabelfish", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsBabelfish = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsCertificateRotationWithoutRestart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsCertificateRotationWithoutRestart = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIntegrations", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIntegrations = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLimitlessDatabase", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLimitlessDatabase = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLocalWriteForwarding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLocalWriteForwarding = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLogExportsToCloudwatchLogs", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLogExportsToCloudwatchLogs = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsParallelQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsParallelQuery = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsReadReplica", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsReadReplica = ptr.Bool(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ValidUpgradeTarget", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidUpgradeTargetList(&sv.ValidUpgradeTarget, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBClusterEndpointOutput(v **CreateDBClusterEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBClusterEndpointOutput + if *v == nil { + sv = &CreateDBClusterEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CustomEndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomEndpointType = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointResourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointResourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("EndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EndpointType = ptr.String(xtv) + } + + case strings.EqualFold("ExcludedMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExcludedMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StaticMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.StaticMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBClusterOutput(v **CreateDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBClusterOutput + if *v == nil { + sv = &CreateDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBClusterParameterGroupOutput(v **CreateDBClusterParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBClusterParameterGroupOutput + if *v == nil { + sv = &CreateDBClusterParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterParameterGroup(&sv.DBClusterParameterGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBClusterSnapshotOutput(v **CreateDBClusterSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBClusterSnapshotOutput + if *v == nil { + sv = &CreateDBClusterSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshot(&sv.DBClusterSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBInstanceOutput(v **CreateDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBInstanceOutput + if *v == nil { + sv = &CreateDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBInstanceReadReplicaOutput(v **CreateDBInstanceReadReplicaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBInstanceReadReplicaOutput + if *v == nil { + sv = &CreateDBInstanceReadReplicaOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBParameterGroupOutput(v **CreateDBParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBParameterGroupOutput + if *v == nil { + sv = &CreateDBParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBParameterGroup(&sv.DBParameterGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBProxyEndpointOutput(v **CreateDBProxyEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBProxyEndpointOutput + if *v == nil { + sv = &CreateDBProxyEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyEndpoint(&sv.DBProxyEndpoint, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBProxyOutput(v **CreateDBProxyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBProxyOutput + if *v == nil { + sv = &CreateDBProxyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxy(&sv.DBProxy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBSecurityGroupOutput(v **CreateDBSecurityGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBSecurityGroupOutput + if *v == nil { + sv = &CreateDBSecurityGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroup(&sv.DBSecurityGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBShardGroupOutput(v **CreateDBShardGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBShardGroupOutput + if *v == nil { + sv = &CreateDBShardGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComputeRedundancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ComputeRedundancy = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("MaxACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxACU = ptr.Float64(f64) + } + + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBSnapshotOutput(v **CreateDBSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBSnapshotOutput + if *v == nil { + sv = &CreateDBSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshot(&sv.DBSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateDBSubnetGroupOutput(v **CreateDBSubnetGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateDBSubnetGroupOutput + if *v == nil { + sv = &CreateDBSubnetGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSubnetGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSubnetGroup(&sv.DBSubnetGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateEventSubscriptionOutput(v **CreateEventSubscriptionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateEventSubscriptionOutput + if *v == nil { + sv = &CreateEventSubscriptionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscription(&sv.EventSubscription, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateGlobalClusterOutput(v **CreateGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateGlobalClusterOutput + if *v == nil { + sv = &CreateGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateIntegrationOutput(v **CreateIntegrationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateIntegrationOutput + if *v == nil { + sv = &CreateIntegrationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalEncryptionContext", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEncryptionContextMap(&sv.AdditionalEncryptionContext, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("DataFilter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataFilter = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Errors", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIntegrationErrorList(&sv.Errors, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IntegrationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationArn = ptr.String(xtv) + } + + case strings.EqualFold("IntegrationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationName = ptr.String(xtv) + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.IntegrationStatus(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateOptionGroupOutput(v **CreateOptionGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateOptionGroupOutput + if *v == nil { + sv = &CreateOptionGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("OptionGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroup(&sv.OptionGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentCreateTenantDatabaseOutput(v **CreateTenantDatabaseOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateTenantDatabaseOutput + if *v == nil { + sv = &CreateTenantDatabaseOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TenantDatabase", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTenantDatabase(&sv.TenantDatabase, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteBlueGreenDeploymentOutput(v **DeleteBlueGreenDeploymentOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteBlueGreenDeploymentOutput + if *v == nil { + sv = &DeleteBlueGreenDeploymentOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BlueGreenDeployment", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBlueGreenDeployment(&sv.BlueGreenDeployment, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteCustomDBEngineVersionOutput(v **DeleteCustomDBEngineVersionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteCustomDBEngineVersionOutput + if *v == nil { + sv = &DeleteCustomDBEngineVersionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("CustomDBEngineVersionManifest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomDBEngineVersionManifest = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3BucketName = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineMediaType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineMediaType = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionArn = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("DefaultCharacterSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCharacterSet(&sv.DefaultCharacterSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ExportableLogTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.ExportableLogTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Image", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCustomDBEngineVersionAMI(&sv.Image, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ServerlessV2FeaturesSupport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServerlessV2FeaturesSupport(&sv.ServerlessV2FeaturesSupport, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SupportedCACertificateIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCACertificateIdentifiersList(&sv.SupportedCACertificateIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedFeatureNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFeatureNameList(&sv.SupportedFeatureNames, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNcharCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedNcharCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedTimezones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedTimezonesList(&sv.SupportedTimezones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsBabelfish", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsBabelfish = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsCertificateRotationWithoutRestart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsCertificateRotationWithoutRestart = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIntegrations", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIntegrations = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLimitlessDatabase", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLimitlessDatabase = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLocalWriteForwarding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLocalWriteForwarding = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLogExportsToCloudwatchLogs", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLogExportsToCloudwatchLogs = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsParallelQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsParallelQuery = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsReadReplica", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsReadReplica = ptr.Bool(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ValidUpgradeTarget", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidUpgradeTargetList(&sv.ValidUpgradeTarget, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBClusterAutomatedBackupOutput(v **DeleteDBClusterAutomatedBackupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBClusterAutomatedBackupOutput + if *v == nil { + sv = &DeleteDBClusterAutomatedBackupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterAutomatedBackup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterAutomatedBackup(&sv.DBClusterAutomatedBackup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBClusterEndpointOutput(v **DeleteDBClusterEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBClusterEndpointOutput + if *v == nil { + sv = &DeleteDBClusterEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CustomEndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomEndpointType = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointResourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointResourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("EndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EndpointType = ptr.String(xtv) + } + + case strings.EqualFold("ExcludedMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExcludedMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StaticMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.StaticMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBClusterOutput(v **DeleteDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBClusterOutput + if *v == nil { + sv = &DeleteDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBClusterSnapshotOutput(v **DeleteDBClusterSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBClusterSnapshotOutput + if *v == nil { + sv = &DeleteDBClusterSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshot(&sv.DBClusterSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBInstanceAutomatedBackupOutput(v **DeleteDBInstanceAutomatedBackupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBInstanceAutomatedBackupOutput + if *v == nil { + sv = &DeleteDBInstanceAutomatedBackupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstanceAutomatedBackup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(&sv.DBInstanceAutomatedBackup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBInstanceOutput(v **DeleteDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBInstanceOutput + if *v == nil { + sv = &DeleteDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBProxyEndpointOutput(v **DeleteDBProxyEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBProxyEndpointOutput + if *v == nil { + sv = &DeleteDBProxyEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyEndpoint(&sv.DBProxyEndpoint, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBProxyOutput(v **DeleteDBProxyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBProxyOutput + if *v == nil { + sv = &DeleteDBProxyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxy(&sv.DBProxy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBShardGroupOutput(v **DeleteDBShardGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBShardGroupOutput + if *v == nil { + sv = &DeleteDBShardGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComputeRedundancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ComputeRedundancy = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("MaxACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxACU = ptr.Float64(f64) + } + + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteDBSnapshotOutput(v **DeleteDBSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteDBSnapshotOutput + if *v == nil { + sv = &DeleteDBSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshot(&sv.DBSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteEventSubscriptionOutput(v **DeleteEventSubscriptionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteEventSubscriptionOutput + if *v == nil { + sv = &DeleteEventSubscriptionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscription(&sv.EventSubscription, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteGlobalClusterOutput(v **DeleteGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteGlobalClusterOutput + if *v == nil { + sv = &DeleteGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteIntegrationOutput(v **DeleteIntegrationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteIntegrationOutput + if *v == nil { + sv = &DeleteIntegrationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalEncryptionContext", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEncryptionContextMap(&sv.AdditionalEncryptionContext, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("DataFilter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataFilter = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Errors", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIntegrationErrorList(&sv.Errors, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IntegrationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationArn = ptr.String(xtv) + } + + case strings.EqualFold("IntegrationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationName = ptr.String(xtv) + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.IntegrationStatus(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeleteTenantDatabaseOutput(v **DeleteTenantDatabaseOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteTenantDatabaseOutput + if *v == nil { + sv = &DeleteTenantDatabaseOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TenantDatabase", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTenantDatabase(&sv.TenantDatabase, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDeregisterDBProxyTargetsOutput(v **DeregisterDBProxyTargetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeregisterDBProxyTargetsOutput + if *v == nil { + sv = &DeregisterDBProxyTargetsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeAccountAttributesOutput(v **DescribeAccountAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeAccountAttributesOutput + if *v == nil { + sv = &DescribeAccountAttributesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AccountQuotas", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAccountQuotaList(&sv.AccountQuotas, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeBlueGreenDeploymentsOutput(v **DescribeBlueGreenDeploymentsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeBlueGreenDeploymentsOutput + if *v == nil { + sv = &DescribeBlueGreenDeploymentsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BlueGreenDeployments", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBlueGreenDeploymentList(&sv.BlueGreenDeployments, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeCertificatesOutput(v **DescribeCertificatesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeCertificatesOutput + if *v == nil { + sv = &DescribeCertificatesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Certificates", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificateList(&sv.Certificates, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("DefaultCertificateForNewLaunches", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DefaultCertificateForNewLaunches = ptr.String(xtv) + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterAutomatedBackupsOutput(v **DescribeDBClusterAutomatedBackupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterAutomatedBackupsOutput + if *v == nil { + sv = &DescribeDBClusterAutomatedBackupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterAutomatedBackups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterAutomatedBackupList(&sv.DBClusterAutomatedBackups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterBacktracksOutput(v **DescribeDBClusterBacktracksOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterBacktracksOutput + if *v == nil { + sv = &DescribeDBClusterBacktracksOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterBacktracks", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterBacktrackList(&sv.DBClusterBacktracks, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterEndpointsOutput(v **DescribeDBClusterEndpointsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterEndpointsOutput + if *v == nil { + sv = &DescribeDBClusterEndpointsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterEndpoints", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterEndpointList(&sv.DBClusterEndpoints, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterParameterGroupsOutput(v **DescribeDBClusterParameterGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterParameterGroupsOutput + if *v == nil { + sv = &DescribeDBClusterParameterGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterParameterGroupList(&sv.DBClusterParameterGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterParametersOutput(v **DescribeDBClusterParametersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterParametersOutput + if *v == nil { + sv = &DescribeDBClusterParametersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("Parameters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentParametersList(&sv.Parameters, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterSnapshotAttributesOutput(v **DescribeDBClusterSnapshotAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterSnapshotAttributesOutput + if *v == nil { + sv = &DescribeDBClusterSnapshotAttributesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshotAttributesResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotAttributesResult(&sv.DBClusterSnapshotAttributesResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClusterSnapshotsOutput(v **DescribeDBClusterSnapshotsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClusterSnapshotsOutput + if *v == nil { + sv = &DescribeDBClusterSnapshotsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshots", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotList(&sv.DBClusterSnapshots, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBClustersOutput(v **DescribeDBClustersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBClustersOutput + if *v == nil { + sv = &DescribeDBClustersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterList(&sv.DBClusters, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBEngineVersionsOutput(v **DescribeDBEngineVersionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBEngineVersionsOutput + if *v == nil { + sv = &DescribeDBEngineVersionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBEngineVersions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBEngineVersionList(&sv.DBEngineVersions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBInstanceAutomatedBackupsOutput(v **DescribeDBInstanceAutomatedBackupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBInstanceAutomatedBackupsOutput + if *v == nil { + sv = &DescribeDBInstanceAutomatedBackupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstanceAutomatedBackups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackupList(&sv.DBInstanceAutomatedBackups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBInstancesOutput(v **DescribeDBInstancesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBInstancesOutput + if *v == nil { + sv = &DescribeDBInstancesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceList(&sv.DBInstances, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBLogFilesOutput(v **DescribeDBLogFilesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBLogFilesOutput + if *v == nil { + sv = &DescribeDBLogFilesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DescribeDBLogFiles", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDescribeDBLogFilesList(&sv.DescribeDBLogFiles, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBParameterGroupsOutput(v **DescribeDBParameterGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBParameterGroupsOutput + if *v == nil { + sv = &DescribeDBParameterGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBParameterGroupList(&sv.DBParameterGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBParametersOutput(v **DescribeDBParametersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBParametersOutput + if *v == nil { + sv = &DescribeDBParametersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("Parameters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentParametersList(&sv.Parameters, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBProxiesOutput(v **DescribeDBProxiesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBProxiesOutput + if *v == nil { + sv = &DescribeDBProxiesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxies", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyList(&sv.DBProxies, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBProxyEndpointsOutput(v **DescribeDBProxyEndpointsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBProxyEndpointsOutput + if *v == nil { + sv = &DescribeDBProxyEndpointsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyEndpoints", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyEndpointList(&sv.DBProxyEndpoints, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBProxyTargetGroupsOutput(v **DescribeDBProxyTargetGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBProxyTargetGroupsOutput + if *v == nil { + sv = &DescribeDBProxyTargetGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("TargetGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetGroupList(&sv.TargetGroups, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBProxyTargetsOutput(v **DescribeDBProxyTargetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBProxyTargetsOutput + if *v == nil { + sv = &DescribeDBProxyTargetsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("Targets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetList(&sv.Targets, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBRecommendationsOutput(v **DescribeDBRecommendationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBRecommendationsOutput + if *v == nil { + sv = &DescribeDBRecommendationsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBRecommendations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBRecommendationList(&sv.DBRecommendations, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBSecurityGroupsOutput(v **DescribeDBSecurityGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBSecurityGroupsOutput + if *v == nil { + sv = &DescribeDBSecurityGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroups(&sv.DBSecurityGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBShardGroupsOutput(v **DescribeDBShardGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBShardGroupsOutput + if *v == nil { + sv = &DescribeDBShardGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBShardGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBShardGroupsList(&sv.DBShardGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBSnapshotAttributesOutput(v **DescribeDBSnapshotAttributesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBSnapshotAttributesOutput + if *v == nil { + sv = &DescribeDBSnapshotAttributesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshotAttributesResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshotAttributesResult(&sv.DBSnapshotAttributesResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBSnapshotsOutput(v **DescribeDBSnapshotsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBSnapshotsOutput + if *v == nil { + sv = &DescribeDBSnapshotsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshots", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshotList(&sv.DBSnapshots, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBSnapshotTenantDatabasesOutput(v **DescribeDBSnapshotTenantDatabasesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBSnapshotTenantDatabasesOutput + if *v == nil { + sv = &DescribeDBSnapshotTenantDatabasesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshotTenantDatabases", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshotTenantDatabasesList(&sv.DBSnapshotTenantDatabases, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeDBSubnetGroupsOutput(v **DescribeDBSubnetGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeDBSubnetGroupsOutput + if *v == nil { + sv = &DescribeDBSubnetGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSubnetGroups", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSubnetGroups(&sv.DBSubnetGroups, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeEngineDefaultClusterParametersOutput(v **DescribeEngineDefaultClusterParametersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeEngineDefaultClusterParametersOutput + if *v == nil { + sv = &DescribeEngineDefaultClusterParametersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EngineDefaults", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineDefaults(&sv.EngineDefaults, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeEngineDefaultParametersOutput(v **DescribeEngineDefaultParametersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeEngineDefaultParametersOutput + if *v == nil { + sv = &DescribeEngineDefaultParametersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EngineDefaults", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineDefaults(&sv.EngineDefaults, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeEventCategoriesOutput(v **DescribeEventCategoriesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeEventCategoriesOutput + if *v == nil { + sv = &DescribeEventCategoriesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventCategoriesMapList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventCategoriesMapList(&sv.EventCategoriesMapList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeEventsOutput(v **DescribeEventsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeEventsOutput + if *v == nil { + sv = &DescribeEventsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Events", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventList(&sv.Events, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeEventSubscriptionsOutput(v **DescribeEventSubscriptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeEventSubscriptionsOutput + if *v == nil { + sv = &DescribeEventSubscriptionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscriptionsList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscriptionsList(&sv.EventSubscriptionsList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeExportTasksOutput(v **DescribeExportTasksOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeExportTasksOutput + if *v == nil { + sv = &DescribeExportTasksOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ExportTasks", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentExportTasksList(&sv.ExportTasks, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeGlobalClustersOutput(v **DescribeGlobalClustersOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeGlobalClustersOutput + if *v == nil { + sv = &DescribeGlobalClustersOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalClusters", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalClusterList(&sv.GlobalClusters, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeIntegrationsOutput(v **DescribeIntegrationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeIntegrationsOutput + if *v == nil { + sv = &DescribeIntegrationsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Integrations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIntegrationList(&sv.Integrations, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeOptionGroupOptionsOutput(v **DescribeOptionGroupOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeOptionGroupOptionsOutput + if *v == nil { + sv = &DescribeOptionGroupOptionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroupOptionsList(&sv.OptionGroupOptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeOptionGroupsOutput(v **DescribeOptionGroupsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeOptionGroupsOutput + if *v == nil { + sv = &DescribeOptionGroupsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("OptionGroupsList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroupsList(&sv.OptionGroupsList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeOrderableDBInstanceOptionsOutput(v **DescribeOrderableDBInstanceOptionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeOrderableDBInstanceOptionsOutput + if *v == nil { + sv = &DescribeOrderableDBInstanceOptionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("OrderableDBInstanceOptions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOrderableDBInstanceOptionsList(&sv.OrderableDBInstanceOptions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribePendingMaintenanceActionsOutput(v **DescribePendingMaintenanceActionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribePendingMaintenanceActionsOutput + if *v == nil { + sv = &DescribePendingMaintenanceActionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("PendingMaintenanceActions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingMaintenanceActions(&sv.PendingMaintenanceActions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeReservedDBInstancesOfferingsOutput(v **DescribeReservedDBInstancesOfferingsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeReservedDBInstancesOfferingsOutput + if *v == nil { + sv = &DescribeReservedDBInstancesOfferingsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("ReservedDBInstancesOfferings", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReservedDBInstancesOfferingList(&sv.ReservedDBInstancesOfferings, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeReservedDBInstancesOutput(v **DescribeReservedDBInstancesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeReservedDBInstancesOutput + if *v == nil { + sv = &DescribeReservedDBInstancesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("ReservedDBInstances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReservedDBInstanceList(&sv.ReservedDBInstances, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeSourceRegionsOutput(v **DescribeSourceRegionsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeSourceRegionsOutput + if *v == nil { + sv = &DescribeSourceRegionsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("SourceRegions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSourceRegionList(&sv.SourceRegions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeTenantDatabasesOutput(v **DescribeTenantDatabasesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeTenantDatabasesOutput + if *v == nil { + sv = &DescribeTenantDatabasesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + case strings.EqualFold("TenantDatabases", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTenantDatabasesList(&sv.TenantDatabases, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDescribeValidDBInstanceModificationsOutput(v **DescribeValidDBInstanceModificationsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeValidDBInstanceModificationsOutput + if *v == nil { + sv = &DescribeValidDBInstanceModificationsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ValidDBInstanceModificationsMessage", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidDBInstanceModificationsMessage(&sv.ValidDBInstanceModificationsMessage, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDisableHttpEndpointOutput(v **DisableHttpEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisableHttpEndpointOutput + if *v == nil { + sv = &DisableHttpEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("HttpEndpointEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.HttpEndpointEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDownloadDBLogFilePortionOutput(v **DownloadDBLogFilePortionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DownloadDBLogFilePortionOutput + if *v == nil { + sv = &DownloadDBLogFilePortionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalDataPending", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.AdditionalDataPending = ptr.Bool(xtv) + } + + case strings.EqualFold("LogFileData", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.LogFileData = ptr.String(xtv) + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentEnableHttpEndpointOutput(v **EnableHttpEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *EnableHttpEndpointOutput + if *v == nil { + sv = &EnableHttpEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("HttpEndpointEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.HttpEndpointEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("ResourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ResourceArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentFailoverDBClusterOutput(v **FailoverDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *FailoverDBClusterOutput + if *v == nil { + sv = &FailoverDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentFailoverGlobalClusterOutput(v **FailoverGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *FailoverGlobalClusterOutput + if *v == nil { + sv = &FailoverGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyActivityStreamOutput(v **ModifyActivityStreamOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyActivityStreamOutput + if *v == nil { + sv = &ModifyActivityStreamOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EngineNativeAuditFieldsIncluded", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.EngineNativeAuditFieldsIncluded = ptr.Bool(xtv) + } + + case strings.EqualFold("KinesisStreamName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KinesisStreamName = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Mode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Mode = types.ActivityStreamMode(xtv) + } + + case strings.EqualFold("PolicyStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PolicyStatus = types.ActivityStreamPolicyStatus(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.ActivityStreamStatus(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyCertificatesOutput(v **ModifyCertificatesOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyCertificatesOutput + if *v == nil { + sv = &ModifyCertificatesOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Certificate", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificate(&sv.Certificate, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyCurrentDBClusterCapacityOutput(v **ModifyCurrentDBClusterCapacityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyCurrentDBClusterCapacityOutput + if *v == nil { + sv = &ModifyCurrentDBClusterCapacityOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CurrentCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CurrentCapacity = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("PendingCapacity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PendingCapacity = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SecondsBeforeTimeout", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SecondsBeforeTimeout = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("TimeoutAction", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TimeoutAction = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyCustomDBEngineVersionOutput(v **ModifyCustomDBEngineVersionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyCustomDBEngineVersionOutput + if *v == nil { + sv = &ModifyCustomDBEngineVersionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("CustomDBEngineVersionManifest", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomDBEngineVersionManifest = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3BucketName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3BucketName = ptr.String(xtv) + } + + case strings.EqualFold("DatabaseInstallationFilesS3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DatabaseInstallationFilesS3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineMediaType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineMediaType = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionArn = ptr.String(xtv) + } + + case strings.EqualFold("DBEngineVersionDescription", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBEngineVersionDescription = ptr.String(xtv) + } + + case strings.EqualFold("DBParameterGroupFamily", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupFamily = ptr.String(xtv) + } + + case strings.EqualFold("DefaultCharacterSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCharacterSet(&sv.DefaultCharacterSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Engine", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Engine = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ExportableLogTypes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentLogTypeList(&sv.ExportableLogTypes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Image", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCustomDBEngineVersionAMI(&sv.Image, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("MajorEngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MajorEngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("ServerlessV2FeaturesSupport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentServerlessV2FeaturesSupport(&sv.ServerlessV2FeaturesSupport, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("SupportedCACertificateIdentifiers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCACertificateIdentifiersList(&sv.SupportedCACertificateIdentifiers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedEngineModes", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEngineModeList(&sv.SupportedEngineModes, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedFeatureNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFeatureNameList(&sv.SupportedFeatureNames, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedNcharCharacterSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedCharacterSetsList(&sv.SupportedNcharCharacterSets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportedTimezones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentSupportedTimezonesList(&sv.SupportedTimezones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SupportsBabelfish", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsBabelfish = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsCertificateRotationWithoutRestart", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsCertificateRotationWithoutRestart = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsGlobalDatabases", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsGlobalDatabases = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsIntegrations", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsIntegrations = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLimitlessDatabase", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLimitlessDatabase = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLocalWriteForwarding", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.SupportsLocalWriteForwarding = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsLogExportsToCloudwatchLogs", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsLogExportsToCloudwatchLogs = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsParallelQuery", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsParallelQuery = ptr.Bool(xtv) + } + + case strings.EqualFold("SupportsReadReplica", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.SupportsReadReplica = ptr.Bool(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ValidUpgradeTarget", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentValidUpgradeTargetList(&sv.ValidUpgradeTarget, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBClusterEndpointOutput(v **ModifyDBClusterEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBClusterEndpointOutput + if *v == nil { + sv = &ModifyDBClusterEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CustomEndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CustomEndpointType = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointArn = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterEndpointResourceIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterEndpointResourceIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("EndpointType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EndpointType = ptr.String(xtv) + } + + case strings.EqualFold("ExcludedMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExcludedMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("StaticMembers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.StaticMembers, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBClusterOutput(v **ModifyDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBClusterOutput + if *v == nil { + sv = &ModifyDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBClusterParameterGroupOutput(v **ModifyDBClusterParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBClusterParameterGroupOutput + if *v == nil { + sv = &ModifyDBClusterParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroupName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBClusterSnapshotAttributeOutput(v **ModifyDBClusterSnapshotAttributeOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBClusterSnapshotAttributeOutput + if *v == nil { + sv = &ModifyDBClusterSnapshotAttributeOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterSnapshotAttributesResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBClusterSnapshotAttributesResult(&sv.DBClusterSnapshotAttributesResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBInstanceOutput(v **ModifyDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBInstanceOutput + if *v == nil { + sv = &ModifyDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBParameterGroupOutput(v **ModifyDBParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBParameterGroupOutput + if *v == nil { + sv = &ModifyDBParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBProxyEndpointOutput(v **ModifyDBProxyEndpointOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBProxyEndpointOutput + if *v == nil { + sv = &ModifyDBProxyEndpointOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyEndpoint", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyEndpoint(&sv.DBProxyEndpoint, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBProxyOutput(v **ModifyDBProxyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBProxyOutput + if *v == nil { + sv = &ModifyDBProxyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxy(&sv.DBProxy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBProxyTargetGroupOutput(v **ModifyDBProxyTargetGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBProxyTargetGroupOutput + if *v == nil { + sv = &ModifyDBProxyTargetGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyTargetGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBProxyTargetGroup(&sv.DBProxyTargetGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBRecommendationOutput(v **ModifyDBRecommendationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBRecommendationOutput + if *v == nil { + sv = &ModifyDBRecommendationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBRecommendation", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBRecommendation(&sv.DBRecommendation, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBShardGroupOutput(v **ModifyDBShardGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBShardGroupOutput + if *v == nil { + sv = &ModifyDBShardGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComputeRedundancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ComputeRedundancy = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("MaxACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxACU = ptr.Float64(f64) + } + + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBSnapshotAttributeOutput(v **ModifyDBSnapshotAttributeOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBSnapshotAttributeOutput + if *v == nil { + sv = &ModifyDBSnapshotAttributeOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshotAttributesResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshotAttributesResult(&sv.DBSnapshotAttributesResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBSnapshotOutput(v **ModifyDBSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBSnapshotOutput + if *v == nil { + sv = &ModifyDBSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSnapshot", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSnapshot(&sv.DBSnapshot, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyDBSubnetGroupOutput(v **ModifyDBSubnetGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyDBSubnetGroupOutput + if *v == nil { + sv = &ModifyDBSubnetGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSubnetGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSubnetGroup(&sv.DBSubnetGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyEventSubscriptionOutput(v **ModifyEventSubscriptionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyEventSubscriptionOutput + if *v == nil { + sv = &ModifyEventSubscriptionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscription(&sv.EventSubscription, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyGlobalClusterOutput(v **ModifyGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyGlobalClusterOutput + if *v == nil { + sv = &ModifyGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyIntegrationOutput(v **ModifyIntegrationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyIntegrationOutput + if *v == nil { + sv = &ModifyIntegrationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AdditionalEncryptionContext", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEncryptionContextMap(&sv.AdditionalEncryptionContext, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("CreateTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreateTime = ptr.Time(t) + } + + case strings.EqualFold("DataFilter", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DataFilter = ptr.String(xtv) + } + + case strings.EqualFold("Description", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Description = ptr.String(xtv) + } + + case strings.EqualFold("Errors", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentIntegrationErrorList(&sv.Errors, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IntegrationArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationArn = ptr.String(xtv) + } + + case strings.EqualFold("IntegrationName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IntegrationName = ptr.String(xtv) + } + + case strings.EqualFold("KMSKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KMSKeyId = ptr.String(xtv) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.IntegrationStatus(xtv) + } + + case strings.EqualFold("Tags", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.Tags, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TargetArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TargetArn = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyOptionGroupOutput(v **ModifyOptionGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyOptionGroupOutput + if *v == nil { + sv = &ModifyOptionGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("OptionGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentOptionGroup(&sv.OptionGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentModifyTenantDatabaseOutput(v **ModifyTenantDatabaseOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ModifyTenantDatabaseOutput + if *v == nil { + sv = &ModifyTenantDatabaseOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TenantDatabase", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTenantDatabase(&sv.TenantDatabase, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentPromoteReadReplicaDBClusterOutput(v **PromoteReadReplicaDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PromoteReadReplicaDBClusterOutput + if *v == nil { + sv = &PromoteReadReplicaDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentPromoteReadReplicaOutput(v **PromoteReadReplicaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PromoteReadReplicaOutput + if *v == nil { + sv = &PromoteReadReplicaOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentPurchaseReservedDBInstancesOfferingOutput(v **PurchaseReservedDBInstancesOfferingOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PurchaseReservedDBInstancesOfferingOutput + if *v == nil { + sv = &PurchaseReservedDBInstancesOfferingOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ReservedDBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentReservedDBInstance(&sv.ReservedDBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRebootDBClusterOutput(v **RebootDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RebootDBClusterOutput + if *v == nil { + sv = &RebootDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRebootDBInstanceOutput(v **RebootDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RebootDBInstanceOutput + if *v == nil { + sv = &RebootDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRebootDBShardGroupOutput(v **RebootDBShardGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RebootDBShardGroupOutput + if *v == nil { + sv = &RebootDBShardGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComputeRedundancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ComputeRedundancy = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupArn = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("DBShardGroupResourceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBShardGroupResourceId = ptr.String(xtv) + } + + case strings.EqualFold("Endpoint", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Endpoint = ptr.String(xtv) + } + + case strings.EqualFold("MaxACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MaxACU = ptr.Float64(f64) + } + + case strings.EqualFold("MinACU", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.MinACU = ptr.Float64(f64) + } + + case strings.EqualFold("PubliclyAccessible", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.PubliclyAccessible = ptr.Bool(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TagList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTagList(&sv.TagList, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRegisterDBProxyTargetsOutput(v **RegisterDBProxyTargetsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RegisterDBProxyTargetsOutput + if *v == nil { + sv = &RegisterDBProxyTargetsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBProxyTargets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentTargetList(&sv.DBProxyTargets, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRemoveFromGlobalClusterOutput(v **RemoveFromGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RemoveFromGlobalClusterOutput + if *v == nil { + sv = &RemoveFromGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRemoveSourceIdentifierFromSubscriptionOutput(v **RemoveSourceIdentifierFromSubscriptionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RemoveSourceIdentifierFromSubscriptionOutput + if *v == nil { + sv = &RemoveSourceIdentifierFromSubscriptionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("EventSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentEventSubscription(&sv.EventSubscription, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentResetDBClusterParameterGroupOutput(v **ResetDBClusterParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ResetDBClusterParameterGroupOutput + if *v == nil { + sv = &ResetDBClusterParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterParameterGroupName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentResetDBParameterGroupOutput(v **ResetDBParameterGroupOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ResetDBParameterGroupOutput + if *v == nil { + sv = &ResetDBParameterGroupOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBParameterGroupName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBParameterGroupName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBClusterFromS3Output(v **RestoreDBClusterFromS3Output, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBClusterFromS3Output + if *v == nil { + sv = &RestoreDBClusterFromS3Output{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBClusterFromSnapshotOutput(v **RestoreDBClusterFromSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBClusterFromSnapshotOutput + if *v == nil { + sv = &RestoreDBClusterFromSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBClusterToPointInTimeOutput(v **RestoreDBClusterToPointInTimeOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBClusterToPointInTimeOutput + if *v == nil { + sv = &RestoreDBClusterToPointInTimeOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBInstanceFromDBSnapshotOutput(v **RestoreDBInstanceFromDBSnapshotOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBInstanceFromDBSnapshotOutput + if *v == nil { + sv = &RestoreDBInstanceFromDBSnapshotOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBInstanceFromS3Output(v **RestoreDBInstanceFromS3Output, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBInstanceFromS3Output + if *v == nil { + sv = &RestoreDBInstanceFromS3Output{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRestoreDBInstanceToPointInTimeOutput(v **RestoreDBInstanceToPointInTimeOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RestoreDBInstanceToPointInTimeOutput + if *v == nil { + sv = &RestoreDBInstanceToPointInTimeOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentRevokeDBSecurityGroupIngressOutput(v **RevokeDBSecurityGroupIngressOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *RevokeDBSecurityGroupIngressOutput + if *v == nil { + sv = &RevokeDBSecurityGroupIngressOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBSecurityGroup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBSecurityGroup(&sv.DBSecurityGroup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStartActivityStreamOutput(v **StartActivityStreamOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StartActivityStreamOutput + if *v == nil { + sv = &StartActivityStreamOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ApplyImmediately", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", val) + } + sv.ApplyImmediately = ptr.Bool(xtv) + } + + case strings.EqualFold("EngineNativeAuditFieldsIncluded", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.EngineNativeAuditFieldsIncluded = ptr.Bool(xtv) + } + + case strings.EqualFold("KinesisStreamName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KinesisStreamName = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Mode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Mode = types.ActivityStreamMode(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.ActivityStreamStatus(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStartDBClusterOutput(v **StartDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StartDBClusterOutput + if *v == nil { + sv = &StartDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStartDBInstanceAutomatedBackupsReplicationOutput(v **StartDBInstanceAutomatedBackupsReplicationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StartDBInstanceAutomatedBackupsReplicationOutput + if *v == nil { + sv = &StartDBInstanceAutomatedBackupsReplicationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstanceAutomatedBackup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(&sv.DBInstanceAutomatedBackup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStartDBInstanceOutput(v **StartDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StartDBInstanceOutput + if *v == nil { + sv = &StartDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStartExportTaskOutput(v **StartExportTaskOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StartExportTaskOutput + if *v == nil { + sv = &StartExportTaskOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ExportOnly", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentStringList(&sv.ExportOnly, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ExportTaskIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ExportTaskIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("FailureCause", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FailureCause = ptr.String(xtv) + } + + case strings.EqualFold("IamRoleArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.IamRoleArn = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("PercentProgress", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PercentProgress = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("S3Bucket", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Bucket = ptr.String(xtv) + } + + case strings.EqualFold("S3Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.S3Prefix = ptr.String(xtv) + } + + case strings.EqualFold("SnapshotTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotTime = ptr.Time(t) + } + + case strings.EqualFold("SourceArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceArn = ptr.String(xtv) + } + + case strings.EqualFold("SourceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceType = types.ExportSourceType(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + case strings.EqualFold("TaskEndTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskEndTime = ptr.Time(t) + } + + case strings.EqualFold("TaskStartTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.TaskStartTime = ptr.Time(t) + } + + case strings.EqualFold("TotalExtractedDataInGB", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.TotalExtractedDataInGB = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("WarningMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.WarningMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStopActivityStreamOutput(v **StopActivityStreamOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StopActivityStreamOutput + if *v == nil { + sv = &StopActivityStreamOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("KinesisStreamName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KinesisStreamName = ptr.String(xtv) + } + + case strings.EqualFold("KmsKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.ActivityStreamStatus(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStopDBClusterOutput(v **StopDBClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StopDBClusterOutput + if *v == nil { + sv = &StopDBClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBCluster(&sv.DBCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStopDBInstanceAutomatedBackupsReplicationOutput(v **StopDBInstanceAutomatedBackupsReplicationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StopDBInstanceAutomatedBackupsReplicationOutput + if *v == nil { + sv = &StopDBInstanceAutomatedBackupsReplicationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstanceAutomatedBackup", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstanceAutomatedBackup(&sv.DBInstanceAutomatedBackup, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentStopDBInstanceOutput(v **StopDBInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *StopDBInstanceOutput + if *v == nil { + sv = &StopDBInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSwitchoverBlueGreenDeploymentOutput(v **SwitchoverBlueGreenDeploymentOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SwitchoverBlueGreenDeploymentOutput + if *v == nil { + sv = &SwitchoverBlueGreenDeploymentOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("BlueGreenDeployment", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentBlueGreenDeployment(&sv.BlueGreenDeployment, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSwitchoverGlobalClusterOutput(v **SwitchoverGlobalClusterOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SwitchoverGlobalClusterOutput + if *v == nil { + sv = &SwitchoverGlobalClusterOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GlobalCluster", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentGlobalCluster(&sv.GlobalCluster, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentSwitchoverReadReplicaOutput(v **SwitchoverReadReplicaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SwitchoverReadReplicaOutput + if *v == nil { + sv = &SwitchoverReadReplicaOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/doc.go new file mode 100644 index 00000000..c4c8e269 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/doc.go @@ -0,0 +1,55 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package rds provides the API client, operations, and parameter types for Amazon +// Relational Database Service. +// +// # Amazon Relational Database Service +// +// Amazon Relational Database Service (Amazon RDS) is a web service that makes it +// easier to set up, operate, and scale a relational database in the cloud. It +// provides cost-efficient, resizeable capacity for an industry-standard relational +// database and manages common database administration tasks, freeing up developers +// to focus on what makes their applications and businesses unique. +// +// Amazon RDS gives you access to the capabilities of a MySQL, MariaDB, +// PostgreSQL, Microsoft SQL Server, Oracle, Db2, or Amazon Aurora database server. +// These capabilities mean that the code, applications, and tools you already use +// today with your existing databases work with Amazon RDS without modification. +// Amazon RDS automatically backs up your database and maintains the database +// software that powers your DB instance. Amazon RDS is flexible: you can scale +// your DB instance's compute resources and storage capacity to meet your +// application's demand. As with all Amazon Web Services, there are no up-front +// investments, and you pay only for the resources you use. +// +// This interface reference for Amazon RDS contains documentation for a +// programming or command line interface you can use to manage Amazon RDS. Amazon +// RDS is asynchronous, which means that some interfaces might require techniques +// such as polling or callback functions to determine when a command has been +// applied. In this reference, the parameter descriptions indicate whether a +// command is applied immediately, on the next instance reboot, or during the +// maintenance window. The reference structure is as follows, and we list following +// some related topics from the user guide. +// +// Amazon RDS API Reference +// +// - For the alphabetical list of API actions, see [API Actions]. +// +// - For the alphabetical list of data types, see [Data Types]. +// +// - For a list of common query parameters, see [Common Parameters]. +// +// - For descriptions of the error codes, see [Common Errors]. +// +// Amazon RDS User Guide +// +// - For a summary of the Amazon RDS interfaces, see [Available RDS Interfaces]. +// +// - For more information about how to use the Query API, see [Using the Query API]. +// +// [API Actions]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Operations.html +// [Common Errors]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonErrors.html +// [Using the Query API]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Using_the_Query_API.html +// [Data Types]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_Types.html +// [Common Parameters]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/CommonParameters.html +// [Available RDS Interfaces]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html#Welcome.Interfaces +package rds diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/endpoints.go new file mode 100644 index 00000000..a9763ab2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/endpoints.go @@ -0,0 +1,556 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/rds/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "rds" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_RDS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "RDS", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://rds-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://rds.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://rds-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://rds.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://rds.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/generated.json new file mode 100644 index 00000000..8c918bdf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/generated.json @@ -0,0 +1,201 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5", + "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", + "github.com/aws/smithy-go": "v1.4.0", + "github.com/jmespath/go-jmespath": "v0.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_AddRoleToDBCluster.go", + "api_op_AddRoleToDBInstance.go", + "api_op_AddSourceIdentifierToSubscription.go", + "api_op_AddTagsToResource.go", + "api_op_ApplyPendingMaintenanceAction.go", + "api_op_AuthorizeDBSecurityGroupIngress.go", + "api_op_BacktrackDBCluster.go", + "api_op_CancelExportTask.go", + "api_op_CopyDBClusterParameterGroup.go", + "api_op_CopyDBClusterSnapshot.go", + "api_op_CopyDBClusterSnapshot_test.go", + "api_op_CopyDBParameterGroup.go", + "api_op_CopyDBSnapshot.go", + "api_op_CopyDBSnapshot_test.go", + "api_op_CopyOptionGroup.go", + "api_op_CreateBlueGreenDeployment.go", + "api_op_CreateCustomDBEngineVersion.go", + "api_op_CreateDBCluster.go", + "api_op_CreateDBClusterEndpoint.go", + "api_op_CreateDBClusterParameterGroup.go", + "api_op_CreateDBClusterSnapshot.go", + "api_op_CreateDBCluster_test.go", + "api_op_CreateDBInstance.go", + "api_op_CreateDBInstanceReadReplica.go", + "api_op_CreateDBInstanceReadReplica_test.go", + "api_op_CreateDBParameterGroup.go", + "api_op_CreateDBProxy.go", + "api_op_CreateDBProxyEndpoint.go", + "api_op_CreateDBSecurityGroup.go", + "api_op_CreateDBShardGroup.go", + "api_op_CreateDBSnapshot.go", + "api_op_CreateDBSubnetGroup.go", + "api_op_CreateEventSubscription.go", + "api_op_CreateGlobalCluster.go", + "api_op_CreateIntegration.go", + "api_op_CreateOptionGroup.go", + "api_op_CreateTenantDatabase.go", + "api_op_DeleteBlueGreenDeployment.go", + "api_op_DeleteCustomDBEngineVersion.go", + "api_op_DeleteDBCluster.go", + "api_op_DeleteDBClusterAutomatedBackup.go", + "api_op_DeleteDBClusterEndpoint.go", + "api_op_DeleteDBClusterParameterGroup.go", + "api_op_DeleteDBClusterSnapshot.go", + "api_op_DeleteDBInstance.go", + "api_op_DeleteDBInstanceAutomatedBackup.go", + "api_op_DeleteDBParameterGroup.go", + "api_op_DeleteDBProxy.go", + "api_op_DeleteDBProxyEndpoint.go", + "api_op_DeleteDBSecurityGroup.go", + "api_op_DeleteDBShardGroup.go", + "api_op_DeleteDBSnapshot.go", + "api_op_DeleteDBSubnetGroup.go", + "api_op_DeleteEventSubscription.go", + "api_op_DeleteGlobalCluster.go", + "api_op_DeleteIntegration.go", + "api_op_DeleteOptionGroup.go", + "api_op_DeleteTenantDatabase.go", + "api_op_DeregisterDBProxyTargets.go", + "api_op_DescribeAccountAttributes.go", + "api_op_DescribeBlueGreenDeployments.go", + "api_op_DescribeCertificates.go", + "api_op_DescribeDBClusterAutomatedBackups.go", + "api_op_DescribeDBClusterBacktracks.go", + "api_op_DescribeDBClusterEndpoints.go", + "api_op_DescribeDBClusterParameterGroups.go", + "api_op_DescribeDBClusterParameters.go", + "api_op_DescribeDBClusterSnapshotAttributes.go", + "api_op_DescribeDBClusterSnapshots.go", + "api_op_DescribeDBClusters.go", + "api_op_DescribeDBEngineVersions.go", + "api_op_DescribeDBInstanceAutomatedBackups.go", + "api_op_DescribeDBInstances.go", + "api_op_DescribeDBLogFiles.go", + "api_op_DescribeDBParameterGroups.go", + "api_op_DescribeDBParameters.go", + "api_op_DescribeDBProxies.go", + "api_op_DescribeDBProxyEndpoints.go", + "api_op_DescribeDBProxyTargetGroups.go", + "api_op_DescribeDBProxyTargets.go", + "api_op_DescribeDBRecommendations.go", + "api_op_DescribeDBSecurityGroups.go", + "api_op_DescribeDBShardGroups.go", + "api_op_DescribeDBSnapshotAttributes.go", + "api_op_DescribeDBSnapshotTenantDatabases.go", + "api_op_DescribeDBSnapshots.go", + "api_op_DescribeDBSubnetGroups.go", + "api_op_DescribeEngineDefaultClusterParameters.go", + "api_op_DescribeEngineDefaultParameters.go", + "api_op_DescribeEventCategories.go", + "api_op_DescribeEventSubscriptions.go", + "api_op_DescribeEvents.go", + "api_op_DescribeExportTasks.go", + "api_op_DescribeGlobalClusters.go", + "api_op_DescribeIntegrations.go", + "api_op_DescribeOptionGroupOptions.go", + "api_op_DescribeOptionGroups.go", + "api_op_DescribeOrderableDBInstanceOptions.go", + "api_op_DescribePendingMaintenanceActions.go", + "api_op_DescribeReservedDBInstances.go", + "api_op_DescribeReservedDBInstancesOfferings.go", + "api_op_DescribeSourceRegions.go", + "api_op_DescribeTenantDatabases.go", + "api_op_DescribeValidDBInstanceModifications.go", + "api_op_DisableHttpEndpoint.go", + "api_op_DownloadDBLogFilePortion.go", + "api_op_EnableHttpEndpoint.go", + "api_op_FailoverDBCluster.go", + "api_op_FailoverGlobalCluster.go", + "api_op_ListTagsForResource.go", + "api_op_ModifyActivityStream.go", + "api_op_ModifyCertificates.go", + "api_op_ModifyCurrentDBClusterCapacity.go", + "api_op_ModifyCustomDBEngineVersion.go", + "api_op_ModifyDBCluster.go", + "api_op_ModifyDBClusterEndpoint.go", + "api_op_ModifyDBClusterParameterGroup.go", + "api_op_ModifyDBClusterSnapshotAttribute.go", + "api_op_ModifyDBInstance.go", + "api_op_ModifyDBParameterGroup.go", + "api_op_ModifyDBProxy.go", + "api_op_ModifyDBProxyEndpoint.go", + "api_op_ModifyDBProxyTargetGroup.go", + "api_op_ModifyDBRecommendation.go", + "api_op_ModifyDBShardGroup.go", + "api_op_ModifyDBSnapshot.go", + "api_op_ModifyDBSnapshotAttribute.go", + "api_op_ModifyDBSubnetGroup.go", + "api_op_ModifyEventSubscription.go", + "api_op_ModifyGlobalCluster.go", + "api_op_ModifyIntegration.go", + "api_op_ModifyOptionGroup.go", + "api_op_ModifyTenantDatabase.go", + "api_op_PromoteReadReplica.go", + "api_op_PromoteReadReplicaDBCluster.go", + "api_op_PurchaseReservedDBInstancesOffering.go", + "api_op_RebootDBCluster.go", + "api_op_RebootDBInstance.go", + "api_op_RebootDBShardGroup.go", + "api_op_RegisterDBProxyTargets.go", + "api_op_RemoveFromGlobalCluster.go", + "api_op_RemoveRoleFromDBCluster.go", + "api_op_RemoveRoleFromDBInstance.go", + "api_op_RemoveSourceIdentifierFromSubscription.go", + "api_op_RemoveTagsFromResource.go", + "api_op_ResetDBClusterParameterGroup.go", + "api_op_ResetDBParameterGroup.go", + "api_op_RestoreDBClusterFromS3.go", + "api_op_RestoreDBClusterFromSnapshot.go", + "api_op_RestoreDBClusterToPointInTime.go", + "api_op_RestoreDBInstanceFromDBSnapshot.go", + "api_op_RestoreDBInstanceFromS3.go", + "api_op_RestoreDBInstanceToPointInTime.go", + "api_op_RevokeDBSecurityGroupIngress.go", + "api_op_StartActivityStream.go", + "api_op_StartDBCluster.go", + "api_op_StartDBInstance.go", + "api_op_StartDBInstanceAutomatedBackupsReplication.go", + "api_op_StartExportTask.go", + "api_op_StopActivityStream.go", + "api_op_StopDBCluster.go", + "api_op_StopDBInstance.go", + "api_op_StopDBInstanceAutomatedBackupsReplication.go", + "api_op_SwitchoverBlueGreenDeployment.go", + "api_op_SwitchoverGlobalCluster.go", + "api_op_SwitchoverReadReplica.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/rds", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/go_module_metadata.go new file mode 100644 index 00000000..ce69c211 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package rds + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.93.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/internal/endpoints/endpoints.go new file mode 100644 index 00000000..bece3cfc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/internal/endpoints/endpoints.go @@ -0,0 +1,789 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver RDS endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "rds.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "rds-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.ca-central-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-central-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.ca-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "rds-fips.ca-central-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.ca-west-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-east-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-east-2", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-west-1", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds-fips.us-west-2", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.ca-central-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.ca-west-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-east-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-east-2", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-west-1", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-west-2", + }: endpoints.Endpoint{ + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Hostname: "rds-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "rds.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "rds-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds.us-iso-east-1", + }: endpoints.Endpoint{ + Hostname: "rds.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "rds.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.us-iso-east-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.us-iso-west-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds.us-isob-east-1", + }: endpoints.Endpoint{ + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "rds.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "rds-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "rds.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "rds.us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "rds.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "rds.us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "rds.us-gov-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/options.go new file mode 100644 index 00000000..d405be03 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/serializers.go new file mode 100644 index 00000000..766b346c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/serializers.go @@ -0,0 +1,19085 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" + "path" + "sort" +) + +type awsAwsquery_serializeOpAddRoleToDBCluster struct { +} + +func (*awsAwsquery_serializeOpAddRoleToDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddRoleToDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddRoleToDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AddRoleToDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentAddRoleToDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAddRoleToDBInstance struct { +} + +func (*awsAwsquery_serializeOpAddRoleToDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddRoleToDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddRoleToDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AddRoleToDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentAddRoleToDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAddSourceIdentifierToSubscription struct { +} + +func (*awsAwsquery_serializeOpAddSourceIdentifierToSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddSourceIdentifierToSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddSourceIdentifierToSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AddSourceIdentifierToSubscription") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentAddSourceIdentifierToSubscriptionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAddTagsToResource struct { +} + +func (*awsAwsquery_serializeOpAddTagsToResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAddTagsToResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddTagsToResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AddTagsToResource") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentAddTagsToResourceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpApplyPendingMaintenanceAction struct { +} + +func (*awsAwsquery_serializeOpApplyPendingMaintenanceAction) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpApplyPendingMaintenanceAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ApplyPendingMaintenanceActionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ApplyPendingMaintenanceAction") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentApplyPendingMaintenanceActionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAuthorizeDBSecurityGroupIngress struct { +} + +func (*awsAwsquery_serializeOpAuthorizeDBSecurityGroupIngress) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAuthorizeDBSecurityGroupIngress) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AuthorizeDBSecurityGroupIngressInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AuthorizeDBSecurityGroupIngress") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentAuthorizeDBSecurityGroupIngressInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpBacktrackDBCluster struct { +} + +func (*awsAwsquery_serializeOpBacktrackDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpBacktrackDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BacktrackDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("BacktrackDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentBacktrackDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCancelExportTask struct { +} + +func (*awsAwsquery_serializeOpCancelExportTask) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCancelExportTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CancelExportTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CancelExportTask") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCancelExportTaskInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCopyDBClusterParameterGroup struct { +} + +func (*awsAwsquery_serializeOpCopyDBClusterParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCopyDBClusterParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyDBClusterParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CopyDBClusterParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCopyDBClusterParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCopyDBClusterSnapshot struct { +} + +func (*awsAwsquery_serializeOpCopyDBClusterSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCopyDBClusterSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyDBClusterSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CopyDBClusterSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCopyDBClusterSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCopyDBParameterGroup struct { +} + +func (*awsAwsquery_serializeOpCopyDBParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCopyDBParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyDBParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CopyDBParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCopyDBParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCopyDBSnapshot struct { +} + +func (*awsAwsquery_serializeOpCopyDBSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCopyDBSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyDBSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CopyDBSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCopyDBSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCopyOptionGroup struct { +} + +func (*awsAwsquery_serializeOpCopyOptionGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCopyOptionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyOptionGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CopyOptionGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCopyOptionGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateBlueGreenDeployment struct { +} + +func (*awsAwsquery_serializeOpCreateBlueGreenDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateBlueGreenDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateBlueGreenDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateBlueGreenDeployment") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateBlueGreenDeploymentInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateCustomDBEngineVersion struct { +} + +func (*awsAwsquery_serializeOpCreateCustomDBEngineVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateCustomDBEngineVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateCustomDBEngineVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateCustomDBEngineVersion") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateCustomDBEngineVersionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBCluster struct { +} + +func (*awsAwsquery_serializeOpCreateDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBClusterEndpoint struct { +} + +func (*awsAwsquery_serializeOpCreateDBClusterEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBClusterEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBClusterEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBClusterEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBClusterEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBClusterParameterGroup struct { +} + +func (*awsAwsquery_serializeOpCreateDBClusterParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBClusterParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBClusterParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBClusterParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBClusterParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBClusterSnapshot struct { +} + +func (*awsAwsquery_serializeOpCreateDBClusterSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBClusterSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBClusterSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBClusterSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBClusterSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBInstance struct { +} + +func (*awsAwsquery_serializeOpCreateDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBInstanceReadReplica struct { +} + +func (*awsAwsquery_serializeOpCreateDBInstanceReadReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBInstanceReadReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBInstanceReadReplicaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBInstanceReadReplica") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBInstanceReadReplicaInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBParameterGroup struct { +} + +func (*awsAwsquery_serializeOpCreateDBParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBProxy struct { +} + +func (*awsAwsquery_serializeOpCreateDBProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBProxy") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBProxyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBProxyEndpoint struct { +} + +func (*awsAwsquery_serializeOpCreateDBProxyEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBProxyEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBProxyEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBProxyEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBProxyEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBSecurityGroup struct { +} + +func (*awsAwsquery_serializeOpCreateDBSecurityGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBSecurityGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBSecurityGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBSecurityGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBSecurityGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBShardGroup struct { +} + +func (*awsAwsquery_serializeOpCreateDBShardGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBShardGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBShardGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBShardGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBShardGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBSnapshot struct { +} + +func (*awsAwsquery_serializeOpCreateDBSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateDBSubnetGroup struct { +} + +func (*awsAwsquery_serializeOpCreateDBSubnetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateDBSubnetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDBSubnetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateDBSubnetGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateDBSubnetGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateEventSubscription struct { +} + +func (*awsAwsquery_serializeOpCreateEventSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateEventSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEventSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateEventSubscription") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateEventSubscriptionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpCreateGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateIntegration struct { +} + +func (*awsAwsquery_serializeOpCreateIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateIntegration") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateIntegrationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateOptionGroup struct { +} + +func (*awsAwsquery_serializeOpCreateOptionGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateOptionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateOptionGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateOptionGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateOptionGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpCreateTenantDatabase struct { +} + +func (*awsAwsquery_serializeOpCreateTenantDatabase) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpCreateTenantDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTenantDatabaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("CreateTenantDatabase") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentCreateTenantDatabaseInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteBlueGreenDeployment struct { +} + +func (*awsAwsquery_serializeOpDeleteBlueGreenDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteBlueGreenDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBlueGreenDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteBlueGreenDeployment") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteBlueGreenDeploymentInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteCustomDBEngineVersion struct { +} + +func (*awsAwsquery_serializeOpDeleteCustomDBEngineVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteCustomDBEngineVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteCustomDBEngineVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteCustomDBEngineVersion") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteCustomDBEngineVersionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBCluster struct { +} + +func (*awsAwsquery_serializeOpDeleteDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBClusterAutomatedBackup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBClusterAutomatedBackup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBClusterAutomatedBackup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBClusterAutomatedBackupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBClusterAutomatedBackup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBClusterAutomatedBackupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBClusterEndpoint struct { +} + +func (*awsAwsquery_serializeOpDeleteDBClusterEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBClusterEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBClusterEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBClusterEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBClusterEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBClusterParameterGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBClusterParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBClusterParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBClusterParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBClusterParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBClusterParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBClusterSnapshot struct { +} + +func (*awsAwsquery_serializeOpDeleteDBClusterSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBClusterSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBClusterSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBClusterSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBClusterSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBInstance struct { +} + +func (*awsAwsquery_serializeOpDeleteDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBInstanceAutomatedBackup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBInstanceAutomatedBackup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBInstanceAutomatedBackup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBInstanceAutomatedBackupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBInstanceAutomatedBackup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBInstanceAutomatedBackupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBParameterGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBProxy struct { +} + +func (*awsAwsquery_serializeOpDeleteDBProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBProxy") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBProxyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBProxyEndpoint struct { +} + +func (*awsAwsquery_serializeOpDeleteDBProxyEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBProxyEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBProxyEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBProxyEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBProxyEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBSecurityGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBSecurityGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBSecurityGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBSecurityGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBSecurityGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBSecurityGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBShardGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBShardGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBShardGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBShardGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBShardGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBShardGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBSnapshot struct { +} + +func (*awsAwsquery_serializeOpDeleteDBSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteDBSubnetGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteDBSubnetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteDBSubnetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDBSubnetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteDBSubnetGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteDBSubnetGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteEventSubscription struct { +} + +func (*awsAwsquery_serializeOpDeleteEventSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteEventSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEventSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteEventSubscription") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteEventSubscriptionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpDeleteGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteIntegration struct { +} + +func (*awsAwsquery_serializeOpDeleteIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteIntegration") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteIntegrationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteOptionGroup struct { +} + +func (*awsAwsquery_serializeOpDeleteOptionGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteOptionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteOptionGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteOptionGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteOptionGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeleteTenantDatabase struct { +} + +func (*awsAwsquery_serializeOpDeleteTenantDatabase) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeleteTenantDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteTenantDatabaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeleteTenantDatabase") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeleteTenantDatabaseInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDeregisterDBProxyTargets struct { +} + +func (*awsAwsquery_serializeOpDeregisterDBProxyTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDeregisterDBProxyTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterDBProxyTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DeregisterDBProxyTargets") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDeregisterDBProxyTargetsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeAccountAttributes struct { +} + +func (*awsAwsquery_serializeOpDescribeAccountAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeAccountAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeAccountAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeAccountAttributes") + body.Key("Version").String("2014-10-31") + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeBlueGreenDeployments struct { +} + +func (*awsAwsquery_serializeOpDescribeBlueGreenDeployments) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeBlueGreenDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeBlueGreenDeploymentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeBlueGreenDeployments") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeBlueGreenDeploymentsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeCertificates struct { +} + +func (*awsAwsquery_serializeOpDescribeCertificates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeCertificatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeCertificates") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeCertificatesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterAutomatedBackups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterAutomatedBackups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterAutomatedBackups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterAutomatedBackupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterAutomatedBackups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterAutomatedBackupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterBacktracks struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterBacktracks) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterBacktracks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterBacktracksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterBacktracks") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterBacktracksInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterEndpoints struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterEndpoints") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterEndpointsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterParameterGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterParameterGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterParameterGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterParameterGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterParameterGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterParameterGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterParameters struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterParameters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterParametersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterParameters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterParametersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusters struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClustersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClustersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterSnapshotAttributes struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterSnapshotAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterSnapshotAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterSnapshotAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterSnapshotAttributes") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterSnapshotAttributesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBClusterSnapshots struct { +} + +func (*awsAwsquery_serializeOpDescribeDBClusterSnapshots) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBClusterSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBClusterSnapshotsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBClusterSnapshots") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBClusterSnapshotsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBEngineVersions struct { +} + +func (*awsAwsquery_serializeOpDescribeDBEngineVersions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBEngineVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBEngineVersionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBEngineVersions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBEngineVersionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBInstanceAutomatedBackups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBInstanceAutomatedBackups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBInstanceAutomatedBackups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBInstanceAutomatedBackupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBInstanceAutomatedBackups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBInstanceAutomatedBackupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBInstances struct { +} + +func (*awsAwsquery_serializeOpDescribeDBInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBInstances") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBInstancesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBLogFiles struct { +} + +func (*awsAwsquery_serializeOpDescribeDBLogFiles) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBLogFiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBLogFilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBLogFiles") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBLogFilesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBParameterGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBParameterGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBParameterGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBParameterGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBParameterGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBParameterGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBParameters struct { +} + +func (*awsAwsquery_serializeOpDescribeDBParameters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBParametersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBParameters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBParametersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBProxies struct { +} + +func (*awsAwsquery_serializeOpDescribeDBProxies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBProxies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBProxiesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBProxies") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBProxiesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBProxyEndpoints struct { +} + +func (*awsAwsquery_serializeOpDescribeDBProxyEndpoints) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBProxyEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBProxyEndpointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBProxyEndpoints") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBProxyEndpointsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBProxyTargetGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBProxyTargetGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBProxyTargetGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBProxyTargetGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBProxyTargetGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBProxyTargetGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBProxyTargets struct { +} + +func (*awsAwsquery_serializeOpDescribeDBProxyTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBProxyTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBProxyTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBProxyTargets") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBProxyTargetsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBRecommendations struct { +} + +func (*awsAwsquery_serializeOpDescribeDBRecommendations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBRecommendations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBRecommendationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBRecommendations") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBRecommendationsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBSecurityGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBSecurityGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBSecurityGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBSecurityGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBSecurityGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBSecurityGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBShardGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBShardGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBShardGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBShardGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBShardGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBShardGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBSnapshotAttributes struct { +} + +func (*awsAwsquery_serializeOpDescribeDBSnapshotAttributes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBSnapshotAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBSnapshotAttributesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBSnapshotAttributes") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBSnapshotAttributesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBSnapshots struct { +} + +func (*awsAwsquery_serializeOpDescribeDBSnapshots) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBSnapshotsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBSnapshots") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBSnapshotsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBSnapshotTenantDatabases struct { +} + +func (*awsAwsquery_serializeOpDescribeDBSnapshotTenantDatabases) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBSnapshotTenantDatabases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBSnapshotTenantDatabasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBSnapshotTenantDatabases") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBSnapshotTenantDatabasesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeDBSubnetGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeDBSubnetGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeDBSubnetGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDBSubnetGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeDBSubnetGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeDBSubnetGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeEngineDefaultClusterParameters struct { +} + +func (*awsAwsquery_serializeOpDescribeEngineDefaultClusterParameters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeEngineDefaultClusterParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEngineDefaultClusterParametersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeEngineDefaultClusterParameters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeEngineDefaultClusterParametersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeEngineDefaultParameters struct { +} + +func (*awsAwsquery_serializeOpDescribeEngineDefaultParameters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeEngineDefaultParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEngineDefaultParametersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeEngineDefaultParameters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeEngineDefaultParametersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeEventCategories struct { +} + +func (*awsAwsquery_serializeOpDescribeEventCategories) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeEventCategories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEventCategoriesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeEventCategories") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeEventCategoriesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeEvents struct { +} + +func (*awsAwsquery_serializeOpDescribeEvents) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEventsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeEvents") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeEventsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeEventSubscriptions struct { +} + +func (*awsAwsquery_serializeOpDescribeEventSubscriptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeEventSubscriptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEventSubscriptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeEventSubscriptions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeEventSubscriptionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeExportTasks struct { +} + +func (*awsAwsquery_serializeOpDescribeExportTasks) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeExportTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeExportTasksInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeExportTasks") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeExportTasksInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeGlobalClusters struct { +} + +func (*awsAwsquery_serializeOpDescribeGlobalClusters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeGlobalClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeGlobalClustersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeGlobalClusters") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeGlobalClustersInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeIntegrations struct { +} + +func (*awsAwsquery_serializeOpDescribeIntegrations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeIntegrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeIntegrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeIntegrations") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeIntegrationsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeOptionGroupOptions struct { +} + +func (*awsAwsquery_serializeOpDescribeOptionGroupOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeOptionGroupOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeOptionGroupOptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeOptionGroupOptions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeOptionGroupOptionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeOptionGroups struct { +} + +func (*awsAwsquery_serializeOpDescribeOptionGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeOptionGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeOptionGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeOptionGroups") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeOptionGroupsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeOrderableDBInstanceOptions struct { +} + +func (*awsAwsquery_serializeOpDescribeOrderableDBInstanceOptions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeOrderableDBInstanceOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeOrderableDBInstanceOptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeOrderableDBInstanceOptions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeOrderableDBInstanceOptionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribePendingMaintenanceActions struct { +} + +func (*awsAwsquery_serializeOpDescribePendingMaintenanceActions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribePendingMaintenanceActions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribePendingMaintenanceActionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribePendingMaintenanceActions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribePendingMaintenanceActionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeReservedDBInstances struct { +} + +func (*awsAwsquery_serializeOpDescribeReservedDBInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeReservedDBInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeReservedDBInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeReservedDBInstances") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeReservedDBInstancesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeReservedDBInstancesOfferings struct { +} + +func (*awsAwsquery_serializeOpDescribeReservedDBInstancesOfferings) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeReservedDBInstancesOfferings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeReservedDBInstancesOfferingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeReservedDBInstancesOfferings") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeReservedDBInstancesOfferingsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeSourceRegions struct { +} + +func (*awsAwsquery_serializeOpDescribeSourceRegions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeSourceRegions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSourceRegionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeSourceRegions") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeSourceRegionsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeTenantDatabases struct { +} + +func (*awsAwsquery_serializeOpDescribeTenantDatabases) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeTenantDatabases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeTenantDatabasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeTenantDatabases") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeTenantDatabasesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDescribeValidDBInstanceModifications struct { +} + +func (*awsAwsquery_serializeOpDescribeValidDBInstanceModifications) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDescribeValidDBInstanceModifications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeValidDBInstanceModificationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeValidDBInstanceModifications") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDescribeValidDBInstanceModificationsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDisableHttpEndpoint struct { +} + +func (*awsAwsquery_serializeOpDisableHttpEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDisableHttpEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisableHttpEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DisableHttpEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDisableHttpEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDownloadDBLogFilePortion struct { +} + +func (*awsAwsquery_serializeOpDownloadDBLogFilePortion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDownloadDBLogFilePortion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DownloadDBLogFilePortionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DownloadDBLogFilePortion") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentDownloadDBLogFilePortionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpEnableHttpEndpoint struct { +} + +func (*awsAwsquery_serializeOpEnableHttpEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpEnableHttpEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EnableHttpEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("EnableHttpEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentEnableHttpEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpFailoverDBCluster struct { +} + +func (*awsAwsquery_serializeOpFailoverDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpFailoverDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*FailoverDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("FailoverDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentFailoverDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpFailoverGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpFailoverGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpFailoverGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*FailoverGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("FailoverGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentFailoverGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpListTagsForResource struct { +} + +func (*awsAwsquery_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ListTagsForResource") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentListTagsForResourceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyActivityStream struct { +} + +func (*awsAwsquery_serializeOpModifyActivityStream) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyActivityStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyActivityStreamInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyActivityStream") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyActivityStreamInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyCertificates struct { +} + +func (*awsAwsquery_serializeOpModifyCertificates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyCertificatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyCertificates") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyCertificatesInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyCurrentDBClusterCapacity struct { +} + +func (*awsAwsquery_serializeOpModifyCurrentDBClusterCapacity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyCurrentDBClusterCapacity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyCurrentDBClusterCapacityInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyCurrentDBClusterCapacity") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyCurrentDBClusterCapacityInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyCustomDBEngineVersion struct { +} + +func (*awsAwsquery_serializeOpModifyCustomDBEngineVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyCustomDBEngineVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyCustomDBEngineVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyCustomDBEngineVersion") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyCustomDBEngineVersionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBCluster struct { +} + +func (*awsAwsquery_serializeOpModifyDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBClusterEndpoint struct { +} + +func (*awsAwsquery_serializeOpModifyDBClusterEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBClusterEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBClusterEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBClusterEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBClusterEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBClusterParameterGroup struct { +} + +func (*awsAwsquery_serializeOpModifyDBClusterParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBClusterParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBClusterParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBClusterParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBClusterParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBClusterSnapshotAttribute struct { +} + +func (*awsAwsquery_serializeOpModifyDBClusterSnapshotAttribute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBClusterSnapshotAttribute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBClusterSnapshotAttributeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBClusterSnapshotAttribute") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBClusterSnapshotAttributeInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBInstance struct { +} + +func (*awsAwsquery_serializeOpModifyDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBParameterGroup struct { +} + +func (*awsAwsquery_serializeOpModifyDBParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBProxy struct { +} + +func (*awsAwsquery_serializeOpModifyDBProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBProxy") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBProxyInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBProxyEndpoint struct { +} + +func (*awsAwsquery_serializeOpModifyDBProxyEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBProxyEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBProxyEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBProxyEndpoint") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBProxyEndpointInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBProxyTargetGroup struct { +} + +func (*awsAwsquery_serializeOpModifyDBProxyTargetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBProxyTargetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBProxyTargetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBProxyTargetGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBProxyTargetGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBRecommendation struct { +} + +func (*awsAwsquery_serializeOpModifyDBRecommendation) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBRecommendationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBRecommendation") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBRecommendationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBShardGroup struct { +} + +func (*awsAwsquery_serializeOpModifyDBShardGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBShardGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBShardGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBShardGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBShardGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBSnapshot struct { +} + +func (*awsAwsquery_serializeOpModifyDBSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBSnapshotAttribute struct { +} + +func (*awsAwsquery_serializeOpModifyDBSnapshotAttribute) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBSnapshotAttribute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBSnapshotAttributeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBSnapshotAttribute") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBSnapshotAttributeInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyDBSubnetGroup struct { +} + +func (*awsAwsquery_serializeOpModifyDBSubnetGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyDBSubnetGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyDBSubnetGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyDBSubnetGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyDBSubnetGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyEventSubscription struct { +} + +func (*awsAwsquery_serializeOpModifyEventSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyEventSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyEventSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyEventSubscription") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyEventSubscriptionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpModifyGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyIntegration struct { +} + +func (*awsAwsquery_serializeOpModifyIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyIntegration") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyIntegrationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyOptionGroup struct { +} + +func (*awsAwsquery_serializeOpModifyOptionGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyOptionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyOptionGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyOptionGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyOptionGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpModifyTenantDatabase struct { +} + +func (*awsAwsquery_serializeOpModifyTenantDatabase) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpModifyTenantDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ModifyTenantDatabaseInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ModifyTenantDatabase") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentModifyTenantDatabaseInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpPromoteReadReplica struct { +} + +func (*awsAwsquery_serializeOpPromoteReadReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPromoteReadReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PromoteReadReplicaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("PromoteReadReplica") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentPromoteReadReplicaInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpPromoteReadReplicaDBCluster struct { +} + +func (*awsAwsquery_serializeOpPromoteReadReplicaDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPromoteReadReplicaDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PromoteReadReplicaDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("PromoteReadReplicaDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentPromoteReadReplicaDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpPurchaseReservedDBInstancesOffering struct { +} + +func (*awsAwsquery_serializeOpPurchaseReservedDBInstancesOffering) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpPurchaseReservedDBInstancesOffering) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PurchaseReservedDBInstancesOfferingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("PurchaseReservedDBInstancesOffering") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentPurchaseReservedDBInstancesOfferingInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRebootDBCluster struct { +} + +func (*awsAwsquery_serializeOpRebootDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRebootDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RebootDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RebootDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRebootDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRebootDBInstance struct { +} + +func (*awsAwsquery_serializeOpRebootDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRebootDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RebootDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RebootDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRebootDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRebootDBShardGroup struct { +} + +func (*awsAwsquery_serializeOpRebootDBShardGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRebootDBShardGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RebootDBShardGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RebootDBShardGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRebootDBShardGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRegisterDBProxyTargets struct { +} + +func (*awsAwsquery_serializeOpRegisterDBProxyTargets) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRegisterDBProxyTargets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterDBProxyTargetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RegisterDBProxyTargets") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRegisterDBProxyTargetsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveFromGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpRemoveFromGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveFromGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveFromGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RemoveFromGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRemoveFromGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveRoleFromDBCluster struct { +} + +func (*awsAwsquery_serializeOpRemoveRoleFromDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveRoleFromDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveRoleFromDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RemoveRoleFromDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRemoveRoleFromDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveRoleFromDBInstance struct { +} + +func (*awsAwsquery_serializeOpRemoveRoleFromDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveRoleFromDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveRoleFromDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RemoveRoleFromDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRemoveRoleFromDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveSourceIdentifierFromSubscription struct { +} + +func (*awsAwsquery_serializeOpRemoveSourceIdentifierFromSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveSourceIdentifierFromSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveSourceIdentifierFromSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RemoveSourceIdentifierFromSubscription") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRemoveSourceIdentifierFromSubscriptionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRemoveTagsFromResource struct { +} + +func (*awsAwsquery_serializeOpRemoveTagsFromResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRemoveTagsFromResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RemoveTagsFromResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RemoveTagsFromResource") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRemoveTagsFromResourceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpResetDBClusterParameterGroup struct { +} + +func (*awsAwsquery_serializeOpResetDBClusterParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpResetDBClusterParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ResetDBClusterParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ResetDBClusterParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentResetDBClusterParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpResetDBParameterGroup struct { +} + +func (*awsAwsquery_serializeOpResetDBParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpResetDBParameterGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ResetDBParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("ResetDBParameterGroup") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentResetDBParameterGroupInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBClusterFromS3 struct { +} + +func (*awsAwsquery_serializeOpRestoreDBClusterFromS3) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBClusterFromS3) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBClusterFromS3Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBClusterFromS3") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBClusterFromS3Input(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBClusterFromSnapshot struct { +} + +func (*awsAwsquery_serializeOpRestoreDBClusterFromSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBClusterFromSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBClusterFromSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBClusterFromSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBClusterFromSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBClusterToPointInTime struct { +} + +func (*awsAwsquery_serializeOpRestoreDBClusterToPointInTime) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBClusterToPointInTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBClusterToPointInTimeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBClusterToPointInTime") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBClusterToPointInTimeInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBInstanceFromDBSnapshot struct { +} + +func (*awsAwsquery_serializeOpRestoreDBInstanceFromDBSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBInstanceFromDBSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBInstanceFromDBSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBInstanceFromDBSnapshot") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBInstanceFromDBSnapshotInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBInstanceFromS3 struct { +} + +func (*awsAwsquery_serializeOpRestoreDBInstanceFromS3) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBInstanceFromS3) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBInstanceFromS3Input) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBInstanceFromS3") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBInstanceFromS3Input(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRestoreDBInstanceToPointInTime struct { +} + +func (*awsAwsquery_serializeOpRestoreDBInstanceToPointInTime) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRestoreDBInstanceToPointInTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreDBInstanceToPointInTimeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RestoreDBInstanceToPointInTime") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRestoreDBInstanceToPointInTimeInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpRevokeDBSecurityGroupIngress struct { +} + +func (*awsAwsquery_serializeOpRevokeDBSecurityGroupIngress) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpRevokeDBSecurityGroupIngress) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RevokeDBSecurityGroupIngressInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("RevokeDBSecurityGroupIngress") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentRevokeDBSecurityGroupIngressInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStartActivityStream struct { +} + +func (*awsAwsquery_serializeOpStartActivityStream) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStartActivityStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartActivityStreamInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StartActivityStream") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStartActivityStreamInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStartDBCluster struct { +} + +func (*awsAwsquery_serializeOpStartDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStartDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StartDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStartDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStartDBInstance struct { +} + +func (*awsAwsquery_serializeOpStartDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStartDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StartDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStartDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStartDBInstanceAutomatedBackupsReplication struct { +} + +func (*awsAwsquery_serializeOpStartDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStartDBInstanceAutomatedBackupsReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartDBInstanceAutomatedBackupsReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StartDBInstanceAutomatedBackupsReplication") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStartDBInstanceAutomatedBackupsReplicationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStartExportTask struct { +} + +func (*awsAwsquery_serializeOpStartExportTask) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStartExportTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartExportTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StartExportTask") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStartExportTaskInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStopActivityStream struct { +} + +func (*awsAwsquery_serializeOpStopActivityStream) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStopActivityStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopActivityStreamInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StopActivityStream") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStopActivityStreamInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStopDBCluster struct { +} + +func (*awsAwsquery_serializeOpStopDBCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStopDBCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopDBClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StopDBCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStopDBClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStopDBInstance struct { +} + +func (*awsAwsquery_serializeOpStopDBInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStopDBInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopDBInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StopDBInstance") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStopDBInstanceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpStopDBInstanceAutomatedBackupsReplication struct { +} + +func (*awsAwsquery_serializeOpStopDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpStopDBInstanceAutomatedBackupsReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StopDBInstanceAutomatedBackupsReplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("StopDBInstanceAutomatedBackupsReplication") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentStopDBInstanceAutomatedBackupsReplicationInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSwitchoverBlueGreenDeployment struct { +} + +func (*awsAwsquery_serializeOpSwitchoverBlueGreenDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSwitchoverBlueGreenDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SwitchoverBlueGreenDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("SwitchoverBlueGreenDeployment") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentSwitchoverBlueGreenDeploymentInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSwitchoverGlobalCluster struct { +} + +func (*awsAwsquery_serializeOpSwitchoverGlobalCluster) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSwitchoverGlobalCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SwitchoverGlobalClusterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("SwitchoverGlobalCluster") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentSwitchoverGlobalClusterInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpSwitchoverReadReplica struct { +} + +func (*awsAwsquery_serializeOpSwitchoverReadReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSwitchoverReadReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SwitchoverReadReplicaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("SwitchoverReadReplica") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentSwitchoverReadReplicaInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsAwsquery_serializeDocumentAttributeValueList(v []string, value query.Value) error { + array := value.Array("AttributeValue") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentAvailabilityZones(v []string, value query.Value) error { + array := value.Array("AvailabilityZone") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentCloudwatchLogsExportConfiguration(v *types.CloudwatchLogsExportConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.DisableLogTypes != nil { + objectKey := object.Key("DisableLogTypes") + if err := awsAwsquery_serializeDocumentLogTypeList(v.DisableLogTypes, objectKey); err != nil { + return err + } + } + + if v.EnableLogTypes != nil { + objectKey := object.Key("EnableLogTypes") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableLogTypes, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentConnectionPoolConfiguration(v *types.ConnectionPoolConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.ConnectionBorrowTimeout != nil { + objectKey := object.Key("ConnectionBorrowTimeout") + objectKey.Integer(*v.ConnectionBorrowTimeout) + } + + if v.InitQuery != nil { + objectKey := object.Key("InitQuery") + objectKey.String(*v.InitQuery) + } + + if v.MaxConnectionsPercent != nil { + objectKey := object.Key("MaxConnectionsPercent") + objectKey.Integer(*v.MaxConnectionsPercent) + } + + if v.MaxIdleConnectionsPercent != nil { + objectKey := object.Key("MaxIdleConnectionsPercent") + objectKey.Integer(*v.MaxIdleConnectionsPercent) + } + + if v.SessionPinningFilters != nil { + objectKey := object.Key("SessionPinningFilters") + if err := awsAwsquery_serializeDocumentStringList(v.SessionPinningFilters, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentDBSecurityGroupNameList(v []string, value query.Value) error { + array := value.Array("DBSecurityGroupName") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentEncryptionContextMap(v map[string]string, value query.Value) error { + if len(v) == 0 { + return nil + } + object := value.Map("key", "value") + + keys := make([]string, 0, len(v)) + for key := range v { + keys = append(keys, key) + } + sort.Strings(keys) + + for _, key := range keys { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsAwsquery_serializeDocumentEngineModeList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentEventCategoriesList(v []string, value query.Value) error { + array := value.Array("EventCategory") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentFilter(v *types.Filter, value query.Value) error { + object := value.Object() + _ = object + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Values != nil { + objectKey := object.Key("Values") + if err := awsAwsquery_serializeDocumentFilterValueList(v.Values, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentFilterList(v []types.Filter, value query.Value) error { + array := value.Array("Filter") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentFilterValueList(v []string, value query.Value) error { + array := value.Array("Value") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentKeyList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentLogTypeList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentOptionConfiguration(v *types.OptionConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSecurityGroupMemberships != nil { + objectKey := object.Key("DBSecurityGroupMemberships") + if err := awsAwsquery_serializeDocumentDBSecurityGroupNameList(v.DBSecurityGroupMemberships, objectKey); err != nil { + return err + } + } + + if v.OptionName != nil { + objectKey := object.Key("OptionName") + objectKey.String(*v.OptionName) + } + + if v.OptionSettings != nil { + objectKey := object.Key("OptionSettings") + if err := awsAwsquery_serializeDocumentOptionSettingsList(v.OptionSettings, objectKey); err != nil { + return err + } + } + + if v.OptionVersion != nil { + objectKey := object.Key("OptionVersion") + objectKey.String(*v.OptionVersion) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.VpcSecurityGroupMemberships != nil { + objectKey := object.Key("VpcSecurityGroupMemberships") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupMemberships, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentOptionConfigurationList(v []types.OptionConfiguration, value query.Value) error { + array := value.Array("OptionConfiguration") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentOptionConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentOptionNamesList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentOptionSetting(v *types.OptionSetting, value query.Value) error { + object := value.Object() + _ = object + + if v.AllowedValues != nil { + objectKey := object.Key("AllowedValues") + objectKey.String(*v.AllowedValues) + } + + if v.ApplyType != nil { + objectKey := object.Key("ApplyType") + objectKey.String(*v.ApplyType) + } + + if v.DataType != nil { + objectKey := object.Key("DataType") + objectKey.String(*v.DataType) + } + + if v.DefaultValue != nil { + objectKey := object.Key("DefaultValue") + objectKey.String(*v.DefaultValue) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.IsCollection != nil { + objectKey := object.Key("IsCollection") + objectKey.Boolean(*v.IsCollection) + } + + if v.IsModifiable != nil { + objectKey := object.Key("IsModifiable") + objectKey.Boolean(*v.IsModifiable) + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentOptionSettingsList(v []types.OptionSetting, value query.Value) error { + array := value.Array("OptionSetting") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentOptionSetting(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentParameter(v *types.Parameter, value query.Value) error { + object := value.Object() + _ = object + + if v.AllowedValues != nil { + objectKey := object.Key("AllowedValues") + objectKey.String(*v.AllowedValues) + } + + if len(v.ApplyMethod) > 0 { + objectKey := object.Key("ApplyMethod") + objectKey.String(string(v.ApplyMethod)) + } + + if v.ApplyType != nil { + objectKey := object.Key("ApplyType") + objectKey.String(*v.ApplyType) + } + + if v.DataType != nil { + objectKey := object.Key("DataType") + objectKey.String(*v.DataType) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.IsModifiable != nil { + objectKey := object.Key("IsModifiable") + objectKey.Boolean(*v.IsModifiable) + } + + if v.MinimumEngineVersion != nil { + objectKey := object.Key("MinimumEngineVersion") + objectKey.String(*v.MinimumEngineVersion) + } + + if v.ParameterName != nil { + objectKey := object.Key("ParameterName") + objectKey.String(*v.ParameterName) + } + + if v.ParameterValue != nil { + objectKey := object.Key("ParameterValue") + objectKey.String(*v.ParameterValue) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.SupportedEngineModes != nil { + objectKey := object.Key("SupportedEngineModes") + if err := awsAwsquery_serializeDocumentEngineModeList(v.SupportedEngineModes, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeDocumentParametersList(v []types.Parameter, value query.Value) error { + array := value.Array("Parameter") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentProcessorFeature(v *types.ProcessorFeature, value query.Value) error { + object := value.Object() + _ = object + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentProcessorFeatureList(v []types.ProcessorFeature, value query.Value) error { + array := value.Array("ProcessorFeature") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentProcessorFeature(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v *types.RdsCustomClusterConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.InterconnectSubnetId != nil { + objectKey := object.Key("InterconnectSubnetId") + objectKey.String(*v.InterconnectSubnetId) + } + + if len(v.ReplicaMode) > 0 { + objectKey := object.Key("ReplicaMode") + objectKey.String(string(v.ReplicaMode)) + } + + if v.TransitGatewayMulticastDomainId != nil { + objectKey := object.Key("TransitGatewayMulticastDomainId") + objectKey.String(*v.TransitGatewayMulticastDomainId) + } + + return nil +} + +func awsAwsquery_serializeDocumentRecommendedActionUpdate(v *types.RecommendedActionUpdate, value query.Value) error { + object := value.Object() + _ = object + + if v.ActionId != nil { + objectKey := object.Key("ActionId") + objectKey.String(*v.ActionId) + } + + if v.Status != nil { + objectKey := object.Key("Status") + objectKey.String(*v.Status) + } + + return nil +} + +func awsAwsquery_serializeDocumentRecommendedActionUpdateList(v []types.RecommendedActionUpdate, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentRecommendedActionUpdate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentScalingConfiguration(v *types.ScalingConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.AutoPause != nil { + objectKey := object.Key("AutoPause") + objectKey.Boolean(*v.AutoPause) + } + + if v.MaxCapacity != nil { + objectKey := object.Key("MaxCapacity") + objectKey.Integer(*v.MaxCapacity) + } + + if v.MinCapacity != nil { + objectKey := object.Key("MinCapacity") + objectKey.Integer(*v.MinCapacity) + } + + if v.SecondsBeforeTimeout != nil { + objectKey := object.Key("SecondsBeforeTimeout") + objectKey.Integer(*v.SecondsBeforeTimeout) + } + + if v.SecondsUntilAutoPause != nil { + objectKey := object.Key("SecondsUntilAutoPause") + objectKey.Integer(*v.SecondsUntilAutoPause) + } + + if v.TimeoutAction != nil { + objectKey := object.Key("TimeoutAction") + objectKey.String(*v.TimeoutAction) + } + + return nil +} + +func awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v *types.ServerlessV2ScalingConfiguration, value query.Value) error { + object := value.Object() + _ = object + + if v.MaxCapacity != nil { + objectKey := object.Key("MaxCapacity") + switch { + case math.IsNaN(*v.MaxCapacity): + objectKey.String("NaN") + + case math.IsInf(*v.MaxCapacity, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MaxCapacity, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MaxCapacity) + + } + } + + if v.MinCapacity != nil { + objectKey := object.Key("MinCapacity") + switch { + case math.IsNaN(*v.MinCapacity): + objectKey.String("NaN") + + case math.IsInf(*v.MinCapacity, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MinCapacity, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MinCapacity) + + } + } + + if v.SecondsUntilAutoPause != nil { + objectKey := object.Key("SecondsUntilAutoPause") + objectKey.Integer(*v.SecondsUntilAutoPause) + } + + return nil +} + +func awsAwsquery_serializeDocumentSourceIdsList(v []string, value query.Value) error { + array := value.Array("SourceId") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentStringList(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentSubnetIdentifierList(v []string, value query.Value) error { + array := value.Array("SubnetIdentifier") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { + object := value.Object() + _ = object + + if v.Key != nil { + objectKey := object.Key("Key") + objectKey.String(*v.Key) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentTagList(v []types.Tag, value query.Value) error { + array := value.Array("Tag") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentUserAuthConfig(v *types.UserAuthConfig, value query.Value) error { + object := value.Object() + _ = object + + if len(v.AuthScheme) > 0 { + objectKey := object.Key("AuthScheme") + objectKey.String(string(v.AuthScheme)) + } + + if len(v.ClientPasswordAuthType) > 0 { + objectKey := object.Key("ClientPasswordAuthType") + objectKey.String(string(v.ClientPasswordAuthType)) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if len(v.IAMAuth) > 0 { + objectKey := object.Key("IAMAuth") + objectKey.String(string(v.IAMAuth)) + } + + if v.SecretArn != nil { + objectKey := object.Key("SecretArn") + objectKey.String(*v.SecretArn) + } + + if v.UserName != nil { + objectKey := object.Key("UserName") + objectKey.String(*v.UserName) + } + + return nil +} + +func awsAwsquery_serializeDocumentUserAuthConfigList(v []types.UserAuthConfig, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentUserAuthConfig(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v []string, value query.Value) error { + array := value.Array("VpcSecurityGroupId") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeOpDocumentAddRoleToDBClusterInput(v *AddRoleToDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.FeatureName != nil { + objectKey := object.Key("FeatureName") + objectKey.String(*v.FeatureName) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAddRoleToDBInstanceInput(v *AddRoleToDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.FeatureName != nil { + objectKey := object.Key("FeatureName") + objectKey.String(*v.FeatureName) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAddSourceIdentifierToSubscriptionInput(v *AddSourceIdentifierToSubscriptionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceIdentifier != nil { + objectKey := object.Key("SourceIdentifier") + objectKey.String(*v.SourceIdentifier) + } + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAddTagsToResourceInput(v *AddTagsToResourceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceName != nil { + objectKey := object.Key("ResourceName") + objectKey.String(*v.ResourceName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentApplyPendingMaintenanceActionInput(v *ApplyPendingMaintenanceActionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ApplyAction != nil { + objectKey := object.Key("ApplyAction") + objectKey.String(*v.ApplyAction) + } + + if v.OptInType != nil { + objectKey := object.Key("OptInType") + objectKey.String(*v.OptInType) + } + + if v.ResourceIdentifier != nil { + objectKey := object.Key("ResourceIdentifier") + objectKey.String(*v.ResourceIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAuthorizeDBSecurityGroupIngressInput(v *AuthorizeDBSecurityGroupIngressInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CIDRIP != nil { + objectKey := object.Key("CIDRIP") + objectKey.String(*v.CIDRIP) + } + + if v.DBSecurityGroupName != nil { + objectKey := object.Key("DBSecurityGroupName") + objectKey.String(*v.DBSecurityGroupName) + } + + if v.EC2SecurityGroupId != nil { + objectKey := object.Key("EC2SecurityGroupId") + objectKey.String(*v.EC2SecurityGroupId) + } + + if v.EC2SecurityGroupName != nil { + objectKey := object.Key("EC2SecurityGroupName") + objectKey.String(*v.EC2SecurityGroupName) + } + + if v.EC2SecurityGroupOwnerId != nil { + objectKey := object.Key("EC2SecurityGroupOwnerId") + objectKey.String(*v.EC2SecurityGroupOwnerId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentBacktrackDBClusterInput(v *BacktrackDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BacktrackTo != nil { + objectKey := object.Key("BacktrackTo") + objectKey.String(smithytime.FormatDateTime(*v.BacktrackTo)) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.Force != nil { + objectKey := object.Key("Force") + objectKey.Boolean(*v.Force) + } + + if v.UseEarliestTimeOnPointInTimeUnavailable != nil { + objectKey := object.Key("UseEarliestTimeOnPointInTimeUnavailable") + objectKey.Boolean(*v.UseEarliestTimeOnPointInTimeUnavailable) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCancelExportTaskInput(v *CancelExportTaskInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ExportTaskIdentifier != nil { + objectKey := object.Key("ExportTaskIdentifier") + objectKey.String(*v.ExportTaskIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCopyDBClusterParameterGroupInput(v *CopyDBClusterParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceDBClusterParameterGroupIdentifier != nil { + objectKey := object.Key("SourceDBClusterParameterGroupIdentifier") + objectKey.String(*v.SourceDBClusterParameterGroupIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetDBClusterParameterGroupDescription != nil { + objectKey := object.Key("TargetDBClusterParameterGroupDescription") + objectKey.String(*v.TargetDBClusterParameterGroupDescription) + } + + if v.TargetDBClusterParameterGroupIdentifier != nil { + objectKey := object.Key("TargetDBClusterParameterGroupIdentifier") + objectKey.String(*v.TargetDBClusterParameterGroupIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCopyDBClusterSnapshotInput(v *CopyDBClusterSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CopyTags != nil { + objectKey := object.Key("CopyTags") + objectKey.Boolean(*v.CopyTags) + } + + if v.destinationRegion != nil { + objectKey := object.Key("DestinationRegion") + objectKey.String(*v.destinationRegion) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.PreSignedUrl != nil { + objectKey := object.Key("PreSignedUrl") + objectKey.String(*v.PreSignedUrl) + } + + if v.SourceDBClusterSnapshotIdentifier != nil { + objectKey := object.Key("SourceDBClusterSnapshotIdentifier") + objectKey.String(*v.SourceDBClusterSnapshotIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetDBClusterSnapshotIdentifier != nil { + objectKey := object.Key("TargetDBClusterSnapshotIdentifier") + objectKey.String(*v.TargetDBClusterSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCopyDBParameterGroupInput(v *CopyDBParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceDBParameterGroupIdentifier != nil { + objectKey := object.Key("SourceDBParameterGroupIdentifier") + objectKey.String(*v.SourceDBParameterGroupIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetDBParameterGroupDescription != nil { + objectKey := object.Key("TargetDBParameterGroupDescription") + objectKey.String(*v.TargetDBParameterGroupDescription) + } + + if v.TargetDBParameterGroupIdentifier != nil { + objectKey := object.Key("TargetDBParameterGroupIdentifier") + objectKey.String(*v.TargetDBParameterGroupIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCopyDBSnapshotInput(v *CopyDBSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CopyOptionGroup != nil { + objectKey := object.Key("CopyOptionGroup") + objectKey.Boolean(*v.CopyOptionGroup) + } + + if v.CopyTags != nil { + objectKey := object.Key("CopyTags") + objectKey.Boolean(*v.CopyTags) + } + + if v.destinationRegion != nil { + objectKey := object.Key("DestinationRegion") + objectKey.String(*v.destinationRegion) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PreSignedUrl != nil { + objectKey := object.Key("PreSignedUrl") + objectKey.String(*v.PreSignedUrl) + } + + if v.SourceDBSnapshotIdentifier != nil { + objectKey := object.Key("SourceDBSnapshotIdentifier") + objectKey.String(*v.SourceDBSnapshotIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetCustomAvailabilityZone != nil { + objectKey := object.Key("TargetCustomAvailabilityZone") + objectKey.String(*v.TargetCustomAvailabilityZone) + } + + if v.TargetDBSnapshotIdentifier != nil { + objectKey := object.Key("TargetDBSnapshotIdentifier") + objectKey.String(*v.TargetDBSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCopyOptionGroupInput(v *CopyOptionGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceOptionGroupIdentifier != nil { + objectKey := object.Key("SourceOptionGroupIdentifier") + objectKey.String(*v.SourceOptionGroupIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetOptionGroupDescription != nil { + objectKey := object.Key("TargetOptionGroupDescription") + objectKey.String(*v.TargetOptionGroupDescription) + } + + if v.TargetOptionGroupIdentifier != nil { + objectKey := object.Key("TargetOptionGroupIdentifier") + objectKey.String(*v.TargetOptionGroupIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateBlueGreenDeploymentInput(v *CreateBlueGreenDeploymentInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BlueGreenDeploymentName != nil { + objectKey := object.Key("BlueGreenDeploymentName") + objectKey.String(*v.BlueGreenDeploymentName) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetAllocatedStorage != nil { + objectKey := object.Key("TargetAllocatedStorage") + objectKey.Integer(*v.TargetAllocatedStorage) + } + + if v.TargetDBClusterParameterGroupName != nil { + objectKey := object.Key("TargetDBClusterParameterGroupName") + objectKey.String(*v.TargetDBClusterParameterGroupName) + } + + if v.TargetDBInstanceClass != nil { + objectKey := object.Key("TargetDBInstanceClass") + objectKey.String(*v.TargetDBInstanceClass) + } + + if v.TargetDBParameterGroupName != nil { + objectKey := object.Key("TargetDBParameterGroupName") + objectKey.String(*v.TargetDBParameterGroupName) + } + + if v.TargetEngineVersion != nil { + objectKey := object.Key("TargetEngineVersion") + objectKey.String(*v.TargetEngineVersion) + } + + if v.TargetIops != nil { + objectKey := object.Key("TargetIops") + objectKey.Integer(*v.TargetIops) + } + + if v.TargetStorageThroughput != nil { + objectKey := object.Key("TargetStorageThroughput") + objectKey.Integer(*v.TargetStorageThroughput) + } + + if v.TargetStorageType != nil { + objectKey := object.Key("TargetStorageType") + objectKey.String(*v.TargetStorageType) + } + + if v.UpgradeTargetStorageConfig != nil { + objectKey := object.Key("UpgradeTargetStorageConfig") + objectKey.Boolean(*v.UpgradeTargetStorageConfig) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateCustomDBEngineVersionInput(v *CreateCustomDBEngineVersionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DatabaseInstallationFilesS3BucketName != nil { + objectKey := object.Key("DatabaseInstallationFilesS3BucketName") + objectKey.String(*v.DatabaseInstallationFilesS3BucketName) + } + + if v.DatabaseInstallationFilesS3Prefix != nil { + objectKey := object.Key("DatabaseInstallationFilesS3Prefix") + objectKey.String(*v.DatabaseInstallationFilesS3Prefix) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.ImageId != nil { + objectKey := object.Key("ImageId") + objectKey.String(*v.ImageId) + } + + if v.KMSKeyId != nil { + objectKey := object.Key("KMSKeyId") + objectKey.String(*v.KMSKeyId) + } + + if v.Manifest != nil { + objectKey := object.Key("Manifest") + objectKey.String(*v.Manifest) + } + + if v.SourceCustomDbEngineVersionIdentifier != nil { + objectKey := object.Key("SourceCustomDbEngineVersionIdentifier") + objectKey.String(*v.SourceCustomDbEngineVersionIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.UseAwsProvidedLatestImage != nil { + objectKey := object.Key("UseAwsProvidedLatestImage") + objectKey.Boolean(*v.UseAwsProvidedLatestImage) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBClusterEndpointInput(v *CreateDBClusterEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterEndpointIdentifier != nil { + objectKey := object.Key("DBClusterEndpointIdentifier") + objectKey.String(*v.DBClusterEndpointIdentifier) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.EndpointType != nil { + objectKey := object.Key("EndpointType") + objectKey.String(*v.EndpointType) + } + + if v.ExcludedMembers != nil { + objectKey := object.Key("ExcludedMembers") + if err := awsAwsquery_serializeDocumentStringList(v.ExcludedMembers, objectKey); err != nil { + return err + } + } + + if v.StaticMembers != nil { + objectKey := object.Key("StaticMembers") + if err := awsAwsquery_serializeDocumentStringList(v.StaticMembers, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBClusterInput(v *CreateDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.BacktrackWindow != nil { + objectKey := object.Key("BacktrackWindow") + objectKey.Long(*v.BacktrackWindow) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CharacterSetName != nil { + objectKey := object.Key("CharacterSetName") + objectKey.String(*v.CharacterSetName) + } + + if len(v.ClusterScalabilityType) > 0 { + objectKey := object.Key("ClusterScalabilityType") + objectKey.String(string(v.ClusterScalabilityType)) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DatabaseName != nil { + objectKey := object.Key("DatabaseName") + objectKey.String(*v.DatabaseName) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterInstanceClass != nil { + objectKey := object.Key("DBClusterInstanceClass") + objectKey.String(*v.DBClusterInstanceClass) + } + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DBSystemId != nil { + objectKey := object.Key("DBSystemId") + objectKey.String(*v.DBSystemId) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.destinationRegion != nil { + objectKey := object.Key("DestinationRegion") + objectKey.String(*v.destinationRegion) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableGlobalWriteForwarding != nil { + objectKey := object.Key("EnableGlobalWriteForwarding") + objectKey.Boolean(*v.EnableGlobalWriteForwarding) + } + + if v.EnableHttpEndpoint != nil { + objectKey := object.Key("EnableHttpEndpoint") + objectKey.Boolean(*v.EnableHttpEndpoint) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnableLimitlessDatabase != nil { + objectKey := object.Key("EnableLimitlessDatabase") + objectKey.Boolean(*v.EnableLimitlessDatabase) + } + + if v.EnableLocalWriteForwarding != nil { + objectKey := object.Key("EnableLocalWriteForwarding") + objectKey.Boolean(*v.EnableLocalWriteForwarding) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineMode != nil { + objectKey := object.Key("EngineMode") + objectKey.String(*v.EngineMode) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUsername != nil { + objectKey := object.Key("MasterUsername") + objectKey.String(*v.MasterUsername) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.PreSignedUrl != nil { + objectKey := object.Key("PreSignedUrl") + objectKey.String(*v.PreSignedUrl) + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + + if v.ReplicationSourceIdentifier != nil { + objectKey := object.Key("ReplicationSourceIdentifier") + objectKey.String(*v.ReplicationSourceIdentifier) + } + + if v.ScalingConfiguration != nil { + objectKey := object.Key("ScalingConfiguration") + if err := awsAwsquery_serializeDocumentScalingConfiguration(v.ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.ServerlessV2ScalingConfiguration != nil { + objectKey := object.Key("ServerlessV2ScalingConfiguration") + if err := awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v.ServerlessV2ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.StorageEncrypted != nil { + objectKey := object.Key("StorageEncrypted") + objectKey.Boolean(*v.StorageEncrypted) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBClusterParameterGroupInput(v *CreateDBClusterParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBParameterGroupFamily != nil { + objectKey := object.Key("DBParameterGroupFamily") + objectKey.String(*v.DBParameterGroupFamily) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBClusterSnapshotInput(v *CreateDBClusterSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBInstanceInput(v *CreateDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZone != nil { + objectKey := object.Key("AvailabilityZone") + objectKey.String(*v.AvailabilityZone) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.BackupTarget != nil { + objectKey := object.Key("BackupTarget") + objectKey.String(*v.BackupTarget) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CharacterSetName != nil { + objectKey := object.Key("CharacterSetName") + objectKey.String(*v.CharacterSetName) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.CustomIamInstanceProfile != nil { + objectKey := object.Key("CustomIamInstanceProfile") + objectKey.String(*v.CustomIamInstanceProfile) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBName != nil { + objectKey := object.Key("DBName") + objectKey.String(*v.DBName) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBSecurityGroups != nil { + objectKey := object.Key("DBSecurityGroups") + if err := awsAwsquery_serializeDocumentDBSecurityGroupNameList(v.DBSecurityGroups, objectKey); err != nil { + return err + } + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DBSystemId != nil { + objectKey := object.Key("DBSystemId") + objectKey.String(*v.DBSystemId) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainAuthSecretArn != nil { + objectKey := object.Key("DomainAuthSecretArn") + objectKey.String(*v.DomainAuthSecretArn) + } + + if v.DomainDnsIps != nil { + objectKey := object.Key("DomainDnsIps") + if err := awsAwsquery_serializeDocumentStringList(v.DomainDnsIps, objectKey); err != nil { + return err + } + } + + if v.DomainFqdn != nil { + objectKey := object.Key("DomainFqdn") + objectKey.String(*v.DomainFqdn) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.DomainOu != nil { + objectKey := object.Key("DomainOu") + objectKey.String(*v.DomainOu) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUsername != nil { + objectKey := object.Key("MasterUsername") + objectKey.String(*v.MasterUsername) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.MaxAllocatedStorage != nil { + objectKey := object.Key("MaxAllocatedStorage") + objectKey.Integer(*v.MaxAllocatedStorage) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.MultiTenant != nil { + objectKey := object.Key("MultiTenant") + objectKey.Boolean(*v.MultiTenant) + } + + if v.NcharCharacterSetName != nil { + objectKey := object.Key("NcharCharacterSetName") + objectKey.String(*v.NcharCharacterSetName) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PromotionTier != nil { + objectKey := object.Key("PromotionTier") + objectKey.Integer(*v.PromotionTier) + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.StorageEncrypted != nil { + objectKey := object.Key("StorageEncrypted") + objectKey.Boolean(*v.StorageEncrypted) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TdeCredentialArn != nil { + objectKey := object.Key("TdeCredentialArn") + objectKey.String(*v.TdeCredentialArn) + } + + if v.TdeCredentialPassword != nil { + objectKey := object.Key("TdeCredentialPassword") + objectKey.String(*v.TdeCredentialPassword) + } + + if v.Timezone != nil { + objectKey := object.Key("Timezone") + objectKey.String(*v.Timezone) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBInstanceReadReplicaInput(v *CreateDBInstanceReadReplicaInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZone != nil { + objectKey := object.Key("AvailabilityZone") + objectKey.String(*v.AvailabilityZone) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.CustomIamInstanceProfile != nil { + objectKey := object.Key("CustomIamInstanceProfile") + objectKey.String(*v.CustomIamInstanceProfile) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.destinationRegion != nil { + objectKey := object.Key("DestinationRegion") + objectKey.String(*v.destinationRegion) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainAuthSecretArn != nil { + objectKey := object.Key("DomainAuthSecretArn") + objectKey.String(*v.DomainAuthSecretArn) + } + + if v.DomainDnsIps != nil { + objectKey := object.Key("DomainDnsIps") + if err := awsAwsquery_serializeDocumentStringList(v.DomainDnsIps, objectKey); err != nil { + return err + } + } + + if v.DomainFqdn != nil { + objectKey := object.Key("DomainFqdn") + objectKey.String(*v.DomainFqdn) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.DomainOu != nil { + objectKey := object.Key("DomainOu") + objectKey.String(*v.DomainOu) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.MaxAllocatedStorage != nil { + objectKey := object.Key("MaxAllocatedStorage") + objectKey.Integer(*v.MaxAllocatedStorage) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreSignedUrl != nil { + objectKey := object.Key("PreSignedUrl") + objectKey.String(*v.PreSignedUrl) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if len(v.ReplicaMode) > 0 { + objectKey := object.Key("ReplicaMode") + objectKey.String(string(v.ReplicaMode)) + } + + if v.SourceDBClusterIdentifier != nil { + objectKey := object.Key("SourceDBClusterIdentifier") + objectKey.String(*v.SourceDBClusterIdentifier) + } + + if v.SourceDBInstanceIdentifier != nil { + objectKey := object.Key("SourceDBInstanceIdentifier") + objectKey.String(*v.SourceDBInstanceIdentifier) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.UpgradeStorageConfig != nil { + objectKey := object.Key("UpgradeStorageConfig") + objectKey.Boolean(*v.UpgradeStorageConfig) + } + + if v.UseDefaultProcessorFeatures != nil { + objectKey := object.Key("UseDefaultProcessorFeatures") + objectKey.Boolean(*v.UseDefaultProcessorFeatures) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBParameterGroupInput(v *CreateDBParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupFamily != nil { + objectKey := object.Key("DBParameterGroupFamily") + objectKey.String(*v.DBParameterGroupFamily) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBProxyEndpointInput(v *CreateDBProxyEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyEndpointName != nil { + objectKey := object.Key("DBProxyEndpointName") + objectKey.String(*v.DBProxyEndpointName) + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if len(v.TargetRole) > 0 { + objectKey := object.Key("TargetRole") + objectKey.String(string(v.TargetRole)) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentStringList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + if v.VpcSubnetIds != nil { + objectKey := object.Key("VpcSubnetIds") + if err := awsAwsquery_serializeDocumentStringList(v.VpcSubnetIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBProxyInput(v *CreateDBProxyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Auth != nil { + objectKey := object.Key("Auth") + if err := awsAwsquery_serializeDocumentUserAuthConfigList(v.Auth, objectKey); err != nil { + return err + } + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.DebugLogging != nil { + objectKey := object.Key("DebugLogging") + objectKey.Boolean(*v.DebugLogging) + } + + if len(v.EngineFamily) > 0 { + objectKey := object.Key("EngineFamily") + objectKey.String(string(v.EngineFamily)) + } + + if v.IdleClientTimeout != nil { + objectKey := object.Key("IdleClientTimeout") + objectKey.Integer(*v.IdleClientTimeout) + } + + if v.RequireTLS != nil { + objectKey := object.Key("RequireTLS") + objectKey.Boolean(*v.RequireTLS) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentStringList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + if v.VpcSubnetIds != nil { + objectKey := object.Key("VpcSubnetIds") + if err := awsAwsquery_serializeDocumentStringList(v.VpcSubnetIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBSecurityGroupInput(v *CreateDBSecurityGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSecurityGroupDescription != nil { + objectKey := object.Key("DBSecurityGroupDescription") + objectKey.String(*v.DBSecurityGroupDescription) + } + + if v.DBSecurityGroupName != nil { + objectKey := object.Key("DBSecurityGroupName") + objectKey.String(*v.DBSecurityGroupName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBShardGroupInput(v *CreateDBShardGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ComputeRedundancy != nil { + objectKey := object.Key("ComputeRedundancy") + objectKey.Integer(*v.ComputeRedundancy) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBShardGroupIdentifier != nil { + objectKey := object.Key("DBShardGroupIdentifier") + objectKey.String(*v.DBShardGroupIdentifier) + } + + if v.MaxACU != nil { + objectKey := object.Key("MaxACU") + switch { + case math.IsNaN(*v.MaxACU): + objectKey.String("NaN") + + case math.IsInf(*v.MaxACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MaxACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MaxACU) + + } + } + + if v.MinACU != nil { + objectKey := object.Key("MinACU") + switch { + case math.IsNaN(*v.MinACU): + objectKey.String("NaN") + + case math.IsInf(*v.MinACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MinACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MinACU) + + } + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBSnapshotInput(v *CreateDBSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateDBSubnetGroupInput(v *CreateDBSubnetGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSubnetGroupDescription != nil { + objectKey := object.Key("DBSubnetGroupDescription") + objectKey.String(*v.DBSubnetGroupDescription) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.SubnetIds != nil { + objectKey := object.Key("SubnetIds") + if err := awsAwsquery_serializeDocumentSubnetIdentifierList(v.SubnetIds, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateEventSubscriptionInput(v *CreateEventSubscriptionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Enabled != nil { + objectKey := object.Key("Enabled") + objectKey.Boolean(*v.Enabled) + } + + if v.EventCategories != nil { + objectKey := object.Key("EventCategories") + if err := awsAwsquery_serializeDocumentEventCategoriesList(v.EventCategories, objectKey); err != nil { + return err + } + } + + if v.SnsTopicArn != nil { + objectKey := object.Key("SnsTopicArn") + objectKey.String(*v.SnsTopicArn) + } + + if v.SourceIds != nil { + objectKey := object.Key("SourceIds") + if err := awsAwsquery_serializeDocumentSourceIdsList(v.SourceIds, objectKey); err != nil { + return err + } + } + + if v.SourceType != nil { + objectKey := object.Key("SourceType") + objectKey.String(*v.SourceType) + } + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateGlobalClusterInput(v *CreateGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DatabaseName != nil { + objectKey := object.Key("DatabaseName") + objectKey.String(*v.DatabaseName) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.SourceDBClusterIdentifier != nil { + objectKey := object.Key("SourceDBClusterIdentifier") + objectKey.String(*v.SourceDBClusterIdentifier) + } + + if v.StorageEncrypted != nil { + objectKey := object.Key("StorageEncrypted") + objectKey.Boolean(*v.StorageEncrypted) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateIntegrationInput(v *CreateIntegrationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AdditionalEncryptionContext != nil { + objectKey := object.Key("AdditionalEncryptionContext") + if err := awsAwsquery_serializeDocumentEncryptionContextMap(v.AdditionalEncryptionContext, objectKey); err != nil { + return err + } + } + + if v.DataFilter != nil { + objectKey := object.Key("DataFilter") + objectKey.String(*v.DataFilter) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.IntegrationName != nil { + objectKey := object.Key("IntegrationName") + objectKey.String(*v.IntegrationName) + } + + if v.KMSKeyId != nil { + objectKey := object.Key("KMSKeyId") + objectKey.String(*v.KMSKeyId) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetArn != nil { + objectKey := object.Key("TargetArn") + objectKey.String(*v.TargetArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateOptionGroupInput(v *CreateOptionGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EngineName != nil { + objectKey := object.Key("EngineName") + objectKey.String(*v.EngineName) + } + + if v.MajorEngineVersion != nil { + objectKey := object.Key("MajorEngineVersion") + objectKey.String(*v.MajorEngineVersion) + } + + if v.OptionGroupDescription != nil { + objectKey := object.Key("OptionGroupDescription") + objectKey.String(*v.OptionGroupDescription) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentCreateTenantDatabaseInput(v *CreateTenantDatabaseInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CharacterSetName != nil { + objectKey := object.Key("CharacterSetName") + objectKey.String(*v.CharacterSetName) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.MasterUsername != nil { + objectKey := object.Key("MasterUsername") + objectKey.String(*v.MasterUsername) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.NcharCharacterSetName != nil { + objectKey := object.Key("NcharCharacterSetName") + objectKey.String(*v.NcharCharacterSetName) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TenantDBName != nil { + objectKey := object.Key("TenantDBName") + objectKey.String(*v.TenantDBName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteBlueGreenDeploymentInput(v *DeleteBlueGreenDeploymentInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BlueGreenDeploymentIdentifier != nil { + objectKey := object.Key("BlueGreenDeploymentIdentifier") + objectKey.String(*v.BlueGreenDeploymentIdentifier) + } + + if v.DeleteTarget != nil { + objectKey := object.Key("DeleteTarget") + objectKey.Boolean(*v.DeleteTarget) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteCustomDBEngineVersionInput(v *DeleteCustomDBEngineVersionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBClusterAutomatedBackupInput(v *DeleteDBClusterAutomatedBackupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DbClusterResourceId != nil { + objectKey := object.Key("DbClusterResourceId") + objectKey.String(*v.DbClusterResourceId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBClusterEndpointInput(v *DeleteDBClusterEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterEndpointIdentifier != nil { + objectKey := object.Key("DBClusterEndpointIdentifier") + objectKey.String(*v.DBClusterEndpointIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBClusterInput(v *DeleteDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DeleteAutomatedBackups != nil { + objectKey := object.Key("DeleteAutomatedBackups") + objectKey.Boolean(*v.DeleteAutomatedBackups) + } + + if v.FinalDBSnapshotIdentifier != nil { + objectKey := object.Key("FinalDBSnapshotIdentifier") + objectKey.String(*v.FinalDBSnapshotIdentifier) + } + + if v.SkipFinalSnapshot != nil { + objectKey := object.Key("SkipFinalSnapshot") + objectKey.Boolean(*v.SkipFinalSnapshot) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBClusterParameterGroupInput(v *DeleteDBClusterParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBClusterSnapshotInput(v *DeleteDBClusterSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBInstanceAutomatedBackupInput(v *DeleteDBInstanceAutomatedBackupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceAutomatedBackupsArn != nil { + objectKey := object.Key("DBInstanceAutomatedBackupsArn") + objectKey.String(*v.DBInstanceAutomatedBackupsArn) + } + + if v.DbiResourceId != nil { + objectKey := object.Key("DbiResourceId") + objectKey.String(*v.DbiResourceId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBInstanceInput(v *DeleteDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DeleteAutomatedBackups != nil { + objectKey := object.Key("DeleteAutomatedBackups") + objectKey.Boolean(*v.DeleteAutomatedBackups) + } + + if v.FinalDBSnapshotIdentifier != nil { + objectKey := object.Key("FinalDBSnapshotIdentifier") + objectKey.String(*v.FinalDBSnapshotIdentifier) + } + + if v.SkipFinalSnapshot != nil { + objectKey := object.Key("SkipFinalSnapshot") + objectKey.Boolean(*v.SkipFinalSnapshot) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBParameterGroupInput(v *DeleteDBParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBProxyEndpointInput(v *DeleteDBProxyEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyEndpointName != nil { + objectKey := object.Key("DBProxyEndpointName") + objectKey.String(*v.DBProxyEndpointName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBProxyInput(v *DeleteDBProxyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBSecurityGroupInput(v *DeleteDBSecurityGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSecurityGroupName != nil { + objectKey := object.Key("DBSecurityGroupName") + objectKey.String(*v.DBSecurityGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBShardGroupInput(v *DeleteDBShardGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBShardGroupIdentifier != nil { + objectKey := object.Key("DBShardGroupIdentifier") + objectKey.String(*v.DBShardGroupIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBSnapshotInput(v *DeleteDBSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteDBSubnetGroupInput(v *DeleteDBSubnetGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteEventSubscriptionInput(v *DeleteEventSubscriptionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteGlobalClusterInput(v *DeleteGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteIntegrationInput(v *DeleteIntegrationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.IntegrationIdentifier != nil { + objectKey := object.Key("IntegrationIdentifier") + objectKey.String(*v.IntegrationIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteOptionGroupInput(v *DeleteOptionGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeleteTenantDatabaseInput(v *DeleteTenantDatabaseInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.FinalDBSnapshotIdentifier != nil { + objectKey := object.Key("FinalDBSnapshotIdentifier") + objectKey.String(*v.FinalDBSnapshotIdentifier) + } + + if v.SkipFinalSnapshot != nil { + objectKey := object.Key("SkipFinalSnapshot") + objectKey.Boolean(*v.SkipFinalSnapshot) + } + + if v.TenantDBName != nil { + objectKey := object.Key("TenantDBName") + objectKey.String(*v.TenantDBName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDeregisterDBProxyTargetsInput(v *DeregisterDBProxyTargetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifiers != nil { + objectKey := object.Key("DBClusterIdentifiers") + if err := awsAwsquery_serializeDocumentStringList(v.DBClusterIdentifiers, objectKey); err != nil { + return err + } + } + + if v.DBInstanceIdentifiers != nil { + objectKey := object.Key("DBInstanceIdentifiers") + if err := awsAwsquery_serializeDocumentStringList(v.DBInstanceIdentifiers, objectKey); err != nil { + return err + } + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.TargetGroupName != nil { + objectKey := object.Key("TargetGroupName") + objectKey.String(*v.TargetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeAccountAttributesInput(v *DescribeAccountAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeBlueGreenDeploymentsInput(v *DescribeBlueGreenDeploymentsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BlueGreenDeploymentIdentifier != nil { + objectKey := object.Key("BlueGreenDeploymentIdentifier") + objectKey.String(*v.BlueGreenDeploymentIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeCertificatesInput(v *DescribeCertificatesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CertificateIdentifier != nil { + objectKey := object.Key("CertificateIdentifier") + objectKey.String(*v.CertificateIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterAutomatedBackupsInput(v *DescribeDBClusterAutomatedBackupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DbClusterResourceId != nil { + objectKey := object.Key("DbClusterResourceId") + objectKey.String(*v.DbClusterResourceId) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterBacktracksInput(v *DescribeDBClusterBacktracksInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BacktrackIdentifier != nil { + objectKey := object.Key("BacktrackIdentifier") + objectKey.String(*v.BacktrackIdentifier) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterEndpointsInput(v *DescribeDBClusterEndpointsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterEndpointIdentifier != nil { + objectKey := object.Key("DBClusterEndpointIdentifier") + objectKey.String(*v.DBClusterEndpointIdentifier) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterParameterGroupsInput(v *DescribeDBClusterParameterGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterParametersInput(v *DescribeDBClusterParametersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClustersInput(v *DescribeDBClustersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IncludeShared != nil { + objectKey := object.Key("IncludeShared") + objectKey.Boolean(*v.IncludeShared) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterSnapshotAttributesInput(v *DescribeDBClusterSnapshotAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBClusterSnapshotsInput(v *DescribeDBClusterSnapshotsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DbClusterResourceId != nil { + objectKey := object.Key("DbClusterResourceId") + objectKey.String(*v.DbClusterResourceId) + } + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IncludePublic != nil { + objectKey := object.Key("IncludePublic") + objectKey.Boolean(*v.IncludePublic) + } + + if v.IncludeShared != nil { + objectKey := object.Key("IncludeShared") + objectKey.Boolean(*v.IncludeShared) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SnapshotType != nil { + objectKey := object.Key("SnapshotType") + objectKey.String(*v.SnapshotType) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBEngineVersionsInput(v *DescribeDBEngineVersionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupFamily != nil { + objectKey := object.Key("DBParameterGroupFamily") + objectKey.String(*v.DBParameterGroupFamily) + } + + if v.DefaultOnly != nil { + objectKey := object.Key("DefaultOnly") + objectKey.Boolean(*v.DefaultOnly) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IncludeAll != nil { + objectKey := object.Key("IncludeAll") + objectKey.Boolean(*v.IncludeAll) + } + + if v.ListSupportedCharacterSets != nil { + objectKey := object.Key("ListSupportedCharacterSets") + objectKey.Boolean(*v.ListSupportedCharacterSets) + } + + if v.ListSupportedTimezones != nil { + objectKey := object.Key("ListSupportedTimezones") + objectKey.Boolean(*v.ListSupportedTimezones) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBInstanceAutomatedBackupsInput(v *DescribeDBInstanceAutomatedBackupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceAutomatedBackupsArn != nil { + objectKey := object.Key("DBInstanceAutomatedBackupsArn") + objectKey.String(*v.DBInstanceAutomatedBackupsArn) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DbiResourceId != nil { + objectKey := object.Key("DbiResourceId") + objectKey.String(*v.DbiResourceId) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBInstancesInput(v *DescribeDBInstancesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBLogFilesInput(v *DescribeDBLogFilesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.FileLastWritten != nil { + objectKey := object.Key("FileLastWritten") + objectKey.Long(*v.FileLastWritten) + } + + if v.FilenameContains != nil { + objectKey := object.Key("FilenameContains") + objectKey.String(*v.FilenameContains) + } + + if v.FileSize != nil { + objectKey := object.Key("FileSize") + objectKey.Long(*v.FileSize) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBParameterGroupsInput(v *DescribeDBParameterGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBParametersInput(v *DescribeDBParametersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.Source != nil { + objectKey := object.Key("Source") + objectKey.String(*v.Source) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBProxiesInput(v *DescribeDBProxiesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBProxyEndpointsInput(v *DescribeDBProxyEndpointsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyEndpointName != nil { + objectKey := object.Key("DBProxyEndpointName") + objectKey.String(*v.DBProxyEndpointName) + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBProxyTargetGroupsInput(v *DescribeDBProxyTargetGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.TargetGroupName != nil { + objectKey := object.Key("TargetGroupName") + objectKey.String(*v.TargetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBProxyTargetsInput(v *DescribeDBProxyTargetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.TargetGroupName != nil { + objectKey := object.Key("TargetGroupName") + objectKey.String(*v.TargetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBRecommendationsInput(v *DescribeDBRecommendationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.LastUpdatedAfter != nil { + objectKey := object.Key("LastUpdatedAfter") + objectKey.String(smithytime.FormatDateTime(*v.LastUpdatedAfter)) + } + + if v.LastUpdatedBefore != nil { + objectKey := object.Key("LastUpdatedBefore") + objectKey.String(smithytime.FormatDateTime(*v.LastUpdatedBefore)) + } + + if v.Locale != nil { + objectKey := object.Key("Locale") + objectKey.String(*v.Locale) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBSecurityGroupsInput(v *DescribeDBSecurityGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSecurityGroupName != nil { + objectKey := object.Key("DBSecurityGroupName") + objectKey.String(*v.DBSecurityGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBShardGroupsInput(v *DescribeDBShardGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBShardGroupIdentifier != nil { + objectKey := object.Key("DBShardGroupIdentifier") + objectKey.String(*v.DBShardGroupIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBSnapshotAttributesInput(v *DescribeDBSnapshotAttributesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBSnapshotsInput(v *DescribeDBSnapshotsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DbiResourceId != nil { + objectKey := object.Key("DbiResourceId") + objectKey.String(*v.DbiResourceId) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IncludePublic != nil { + objectKey := object.Key("IncludePublic") + objectKey.Boolean(*v.IncludePublic) + } + + if v.IncludeShared != nil { + objectKey := object.Key("IncludeShared") + objectKey.Boolean(*v.IncludeShared) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SnapshotType != nil { + objectKey := object.Key("SnapshotType") + objectKey.String(*v.SnapshotType) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBSnapshotTenantDatabasesInput(v *DescribeDBSnapshotTenantDatabasesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DbiResourceId != nil { + objectKey := object.Key("DbiResourceId") + objectKey.String(*v.DbiResourceId) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SnapshotType != nil { + objectKey := object.Key("SnapshotType") + objectKey.String(*v.SnapshotType) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeDBSubnetGroupsInput(v *DescribeDBSubnetGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeEngineDefaultClusterParametersInput(v *DescribeEngineDefaultClusterParametersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupFamily != nil { + objectKey := object.Key("DBParameterGroupFamily") + objectKey.String(*v.DBParameterGroupFamily) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeEngineDefaultParametersInput(v *DescribeEngineDefaultParametersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupFamily != nil { + objectKey := object.Key("DBParameterGroupFamily") + objectKey.String(*v.DBParameterGroupFamily) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeEventCategoriesInput(v *DescribeEventCategoriesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.SourceType != nil { + objectKey := object.Key("SourceType") + objectKey.String(*v.SourceType) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeEventsInput(v *DescribeEventsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Duration != nil { + objectKey := object.Key("Duration") + objectKey.Integer(*v.Duration) + } + + if v.EndTime != nil { + objectKey := object.Key("EndTime") + objectKey.String(smithytime.FormatDateTime(*v.EndTime)) + } + + if v.EventCategories != nil { + objectKey := object.Key("EventCategories") + if err := awsAwsquery_serializeDocumentEventCategoriesList(v.EventCategories, objectKey); err != nil { + return err + } + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SourceIdentifier != nil { + objectKey := object.Key("SourceIdentifier") + objectKey.String(*v.SourceIdentifier) + } + + if len(v.SourceType) > 0 { + objectKey := object.Key("SourceType") + objectKey.String(string(v.SourceType)) + } + + if v.StartTime != nil { + objectKey := object.Key("StartTime") + objectKey.String(smithytime.FormatDateTime(*v.StartTime)) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeEventSubscriptionsInput(v *DescribeEventSubscriptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeExportTasksInput(v *DescribeExportTasksInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ExportTaskIdentifier != nil { + objectKey := object.Key("ExportTaskIdentifier") + objectKey.String(*v.ExportTaskIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + if len(v.SourceType) > 0 { + objectKey := object.Key("SourceType") + objectKey.String(string(v.SourceType)) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeGlobalClustersInput(v *DescribeGlobalClustersInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeIntegrationsInput(v *DescribeIntegrationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.IntegrationIdentifier != nil { + objectKey := object.Key("IntegrationIdentifier") + objectKey.String(*v.IntegrationIdentifier) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeOptionGroupOptionsInput(v *DescribeOptionGroupOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EngineName != nil { + objectKey := object.Key("EngineName") + objectKey.String(*v.EngineName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.MajorEngineVersion != nil { + objectKey := object.Key("MajorEngineVersion") + objectKey.String(*v.MajorEngineVersion) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeOptionGroupsInput(v *DescribeOptionGroupsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EngineName != nil { + objectKey := object.Key("EngineName") + objectKey.String(*v.EngineName) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.MajorEngineVersion != nil { + objectKey := object.Key("MajorEngineVersion") + objectKey.String(*v.MajorEngineVersion) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeOrderableDBInstanceOptionsInput(v *DescribeOrderableDBInstanceOptionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZoneGroup != nil { + objectKey := object.Key("AvailabilityZoneGroup") + objectKey.String(*v.AvailabilityZoneGroup) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.Vpc != nil { + objectKey := object.Key("Vpc") + objectKey.Boolean(*v.Vpc) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribePendingMaintenanceActionsInput(v *DescribePendingMaintenanceActionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.ResourceIdentifier != nil { + objectKey := object.Key("ResourceIdentifier") + objectKey.String(*v.ResourceIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeReservedDBInstancesInput(v *DescribeReservedDBInstancesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.Duration != nil { + objectKey := object.Key("Duration") + objectKey.String(*v.Duration) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.LeaseId != nil { + objectKey := object.Key("LeaseId") + objectKey.String(*v.LeaseId) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.OfferingType != nil { + objectKey := object.Key("OfferingType") + objectKey.String(*v.OfferingType) + } + + if v.ProductDescription != nil { + objectKey := object.Key("ProductDescription") + objectKey.String(*v.ProductDescription) + } + + if v.ReservedDBInstanceId != nil { + objectKey := object.Key("ReservedDBInstanceId") + objectKey.String(*v.ReservedDBInstanceId) + } + + if v.ReservedDBInstancesOfferingId != nil { + objectKey := object.Key("ReservedDBInstancesOfferingId") + objectKey.String(*v.ReservedDBInstancesOfferingId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeReservedDBInstancesOfferingsInput(v *DescribeReservedDBInstancesOfferingsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.Duration != nil { + objectKey := object.Key("Duration") + objectKey.String(*v.Duration) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.OfferingType != nil { + objectKey := object.Key("OfferingType") + objectKey.String(*v.OfferingType) + } + + if v.ProductDescription != nil { + objectKey := object.Key("ProductDescription") + objectKey.String(*v.ProductDescription) + } + + if v.ReservedDBInstancesOfferingId != nil { + objectKey := object.Key("ReservedDBInstancesOfferingId") + objectKey.String(*v.ReservedDBInstancesOfferingId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeSourceRegionsInput(v *DescribeSourceRegionsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.RegionName != nil { + objectKey := object.Key("RegionName") + objectKey.String(*v.RegionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeTenantDatabasesInput(v *DescribeTenantDatabasesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.MaxRecords != nil { + objectKey := object.Key("MaxRecords") + objectKey.Integer(*v.MaxRecords) + } + + if v.TenantDBName != nil { + objectKey := object.Key("TenantDBName") + objectKey.String(*v.TenantDBName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDescribeValidDBInstanceModificationsInput(v *DescribeValidDBInstanceModificationsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDisableHttpEndpointInput(v *DisableHttpEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDownloadDBLogFilePortionInput(v *DownloadDBLogFilePortionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.LogFileName != nil { + objectKey := object.Key("LogFileName") + objectKey.String(*v.LogFileName) + } + + if v.Marker != nil { + objectKey := object.Key("Marker") + objectKey.String(*v.Marker) + } + + if v.NumberOfLines != nil { + objectKey := object.Key("NumberOfLines") + objectKey.Integer(*v.NumberOfLines) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentEnableHttpEndpointInput(v *EnableHttpEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentFailoverDBClusterInput(v *FailoverDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.TargetDBInstanceIdentifier != nil { + objectKey := object.Key("TargetDBInstanceIdentifier") + objectKey.String(*v.TargetDBInstanceIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentFailoverGlobalClusterInput(v *FailoverGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllowDataLoss != nil { + objectKey := object.Key("AllowDataLoss") + objectKey.Boolean(*v.AllowDataLoss) + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.Switchover != nil { + objectKey := object.Key("Switchover") + objectKey.Boolean(*v.Switchover) + } + + if v.TargetDbClusterIdentifier != nil { + objectKey := object.Key("TargetDbClusterIdentifier") + objectKey.String(*v.TargetDbClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Filters != nil { + objectKey := object.Key("Filters") + if err := awsAwsquery_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.ResourceName != nil { + objectKey := object.Key("ResourceName") + objectKey.String(*v.ResourceName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyActivityStreamInput(v *ModifyActivityStreamInput, value query.Value) error { + object := value.Object() + _ = object + + if len(v.AuditPolicyState) > 0 { + objectKey := object.Key("AuditPolicyState") + objectKey.String(string(v.AuditPolicyState)) + } + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyCertificatesInput(v *ModifyCertificatesInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CertificateIdentifier != nil { + objectKey := object.Key("CertificateIdentifier") + objectKey.String(*v.CertificateIdentifier) + } + + if v.RemoveCustomerOverride != nil { + objectKey := object.Key("RemoveCustomerOverride") + objectKey.Boolean(*v.RemoveCustomerOverride) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyCurrentDBClusterCapacityInput(v *ModifyCurrentDBClusterCapacityInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Capacity != nil { + objectKey := object.Key("Capacity") + objectKey.Integer(*v.Capacity) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.SecondsBeforeTimeout != nil { + objectKey := object.Key("SecondsBeforeTimeout") + objectKey.Integer(*v.SecondsBeforeTimeout) + } + + if v.TimeoutAction != nil { + objectKey := object.Key("TimeoutAction") + objectKey.String(*v.TimeoutAction) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyCustomDBEngineVersionInput(v *ModifyCustomDBEngineVersionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if len(v.Status) > 0 { + objectKey := object.Key("Status") + objectKey.String(string(v.Status)) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBClusterEndpointInput(v *ModifyDBClusterEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterEndpointIdentifier != nil { + objectKey := object.Key("DBClusterEndpointIdentifier") + objectKey.String(*v.DBClusterEndpointIdentifier) + } + + if v.EndpointType != nil { + objectKey := object.Key("EndpointType") + objectKey.String(*v.EndpointType) + } + + if v.ExcludedMembers != nil { + objectKey := object.Key("ExcludedMembers") + if err := awsAwsquery_serializeDocumentStringList(v.ExcludedMembers, objectKey); err != nil { + return err + } + } + + if v.StaticMembers != nil { + objectKey := object.Key("StaticMembers") + if err := awsAwsquery_serializeDocumentStringList(v.StaticMembers, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBClusterInput(v *ModifyDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AllowEngineModeChange != nil { + objectKey := object.Key("AllowEngineModeChange") + objectKey.Boolean(*v.AllowEngineModeChange) + } + + if v.AllowMajorVersionUpgrade != nil { + objectKey := object.Key("AllowMajorVersionUpgrade") + objectKey.Boolean(*v.AllowMajorVersionUpgrade) + } + + if v.ApplyImmediately != nil { + objectKey := object.Key("ApplyImmediately") + objectKey.Boolean(*v.ApplyImmediately) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AwsBackupRecoveryPointArn != nil { + objectKey := object.Key("AwsBackupRecoveryPointArn") + objectKey.String(*v.AwsBackupRecoveryPointArn) + } + + if v.BacktrackWindow != nil { + objectKey := object.Key("BacktrackWindow") + objectKey.Long(*v.BacktrackWindow) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CloudwatchLogsExportConfiguration != nil { + objectKey := object.Key("CloudwatchLogsExportConfiguration") + if err := awsAwsquery_serializeDocumentCloudwatchLogsExportConfiguration(v.CloudwatchLogsExportConfiguration, objectKey); err != nil { + return err + } + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterInstanceClass != nil { + objectKey := object.Key("DBClusterInstanceClass") + objectKey.String(*v.DBClusterInstanceClass) + } + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBInstanceParameterGroupName != nil { + objectKey := object.Key("DBInstanceParameterGroupName") + objectKey.String(*v.DBInstanceParameterGroupName) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.EnableGlobalWriteForwarding != nil { + objectKey := object.Key("EnableGlobalWriteForwarding") + objectKey.Boolean(*v.EnableGlobalWriteForwarding) + } + + if v.EnableHttpEndpoint != nil { + objectKey := object.Key("EnableHttpEndpoint") + objectKey.Boolean(*v.EnableHttpEndpoint) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnableLimitlessDatabase != nil { + objectKey := object.Key("EnableLimitlessDatabase") + objectKey.Boolean(*v.EnableLimitlessDatabase) + } + + if v.EnableLocalWriteForwarding != nil { + objectKey := object.Key("EnableLocalWriteForwarding") + objectKey.Boolean(*v.EnableLocalWriteForwarding) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.EngineMode != nil { + objectKey := object.Key("EngineMode") + objectKey.String(*v.EngineMode) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.NewDBClusterIdentifier != nil { + objectKey := object.Key("NewDBClusterIdentifier") + objectKey.String(*v.NewDBClusterIdentifier) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.RotateMasterUserPassword != nil { + objectKey := object.Key("RotateMasterUserPassword") + objectKey.Boolean(*v.RotateMasterUserPassword) + } + + if v.ScalingConfiguration != nil { + objectKey := object.Key("ScalingConfiguration") + if err := awsAwsquery_serializeDocumentScalingConfiguration(v.ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.ServerlessV2ScalingConfiguration != nil { + objectKey := object.Key("ServerlessV2ScalingConfiguration") + if err := awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v.ServerlessV2ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBClusterParameterGroupInput(v *ModifyDBClusterParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.Parameters != nil { + objectKey := object.Key("Parameters") + if err := awsAwsquery_serializeDocumentParametersList(v.Parameters, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBClusterSnapshotAttributeInput(v *ModifyDBClusterSnapshotAttributeInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AttributeName != nil { + objectKey := object.Key("AttributeName") + objectKey.String(*v.AttributeName) + } + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + if v.ValuesToAdd != nil { + objectKey := object.Key("ValuesToAdd") + if err := awsAwsquery_serializeDocumentAttributeValueList(v.ValuesToAdd, objectKey); err != nil { + return err + } + } + + if v.ValuesToRemove != nil { + objectKey := object.Key("ValuesToRemove") + if err := awsAwsquery_serializeDocumentAttributeValueList(v.ValuesToRemove, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBInstanceInput(v *ModifyDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AllowMajorVersionUpgrade != nil { + objectKey := object.Key("AllowMajorVersionUpgrade") + objectKey.Boolean(*v.AllowMajorVersionUpgrade) + } + + if v.ApplyImmediately != nil { + objectKey := object.Key("ApplyImmediately") + objectKey.Boolean(*v.ApplyImmediately) + } + + if len(v.AutomationMode) > 0 { + objectKey := object.Key("AutomationMode") + objectKey.String(string(v.AutomationMode)) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AwsBackupRecoveryPointArn != nil { + objectKey := object.Key("AwsBackupRecoveryPointArn") + objectKey.String(*v.AwsBackupRecoveryPointArn) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CertificateRotationRestart != nil { + objectKey := object.Key("CertificateRotationRestart") + objectKey.Boolean(*v.CertificateRotationRestart) + } + + if v.CloudwatchLogsExportConfiguration != nil { + objectKey := object.Key("CloudwatchLogsExportConfiguration") + if err := awsAwsquery_serializeDocumentCloudwatchLogsExportConfiguration(v.CloudwatchLogsExportConfiguration, objectKey); err != nil { + return err + } + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBPortNumber != nil { + objectKey := object.Key("DBPortNumber") + objectKey.Integer(*v.DBPortNumber) + } + + if v.DBSecurityGroups != nil { + objectKey := object.Key("DBSecurityGroups") + if err := awsAwsquery_serializeDocumentDBSecurityGroupNameList(v.DBSecurityGroups, objectKey); err != nil { + return err + } + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.DisableDomain != nil { + objectKey := object.Key("DisableDomain") + objectKey.Boolean(*v.DisableDomain) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainAuthSecretArn != nil { + objectKey := object.Key("DomainAuthSecretArn") + objectKey.String(*v.DomainAuthSecretArn) + } + + if v.DomainDnsIps != nil { + objectKey := object.Key("DomainDnsIps") + if err := awsAwsquery_serializeDocumentStringList(v.DomainDnsIps, objectKey); err != nil { + return err + } + } + + if v.DomainFqdn != nil { + objectKey := object.Key("DomainFqdn") + objectKey.String(*v.DomainFqdn) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.DomainOu != nil { + objectKey := object.Key("DomainOu") + objectKey.String(*v.DomainOu) + } + + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.MaxAllocatedStorage != nil { + objectKey := object.Key("MaxAllocatedStorage") + objectKey.Integer(*v.MaxAllocatedStorage) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.MultiTenant != nil { + objectKey := object.Key("MultiTenant") + objectKey.Boolean(*v.MultiTenant) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.NewDBInstanceIdentifier != nil { + objectKey := object.Key("NewDBInstanceIdentifier") + objectKey.String(*v.NewDBInstanceIdentifier) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PromotionTier != nil { + objectKey := object.Key("PromotionTier") + objectKey.Integer(*v.PromotionTier) + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if len(v.ReplicaMode) > 0 { + objectKey := object.Key("ReplicaMode") + objectKey.String(string(v.ReplicaMode)) + } + + if v.ResumeFullAutomationModeMinutes != nil { + objectKey := object.Key("ResumeFullAutomationModeMinutes") + objectKey.Integer(*v.ResumeFullAutomationModeMinutes) + } + + if v.RotateMasterUserPassword != nil { + objectKey := object.Key("RotateMasterUserPassword") + objectKey.Boolean(*v.RotateMasterUserPassword) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.TdeCredentialArn != nil { + objectKey := object.Key("TdeCredentialArn") + objectKey.String(*v.TdeCredentialArn) + } + + if v.TdeCredentialPassword != nil { + objectKey := object.Key("TdeCredentialPassword") + objectKey.String(*v.TdeCredentialPassword) + } + + if v.UseDefaultProcessorFeatures != nil { + objectKey := object.Key("UseDefaultProcessorFeatures") + objectKey.Boolean(*v.UseDefaultProcessorFeatures) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBParameterGroupInput(v *ModifyDBParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.Parameters != nil { + objectKey := object.Key("Parameters") + if err := awsAwsquery_serializeDocumentParametersList(v.Parameters, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBProxyEndpointInput(v *ModifyDBProxyEndpointInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBProxyEndpointName != nil { + objectKey := object.Key("DBProxyEndpointName") + objectKey.String(*v.DBProxyEndpointName) + } + + if v.NewDBProxyEndpointName != nil { + objectKey := object.Key("NewDBProxyEndpointName") + objectKey.String(*v.NewDBProxyEndpointName) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentStringList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBProxyInput(v *ModifyDBProxyInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Auth != nil { + objectKey := object.Key("Auth") + if err := awsAwsquery_serializeDocumentUserAuthConfigList(v.Auth, objectKey); err != nil { + return err + } + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.DebugLogging != nil { + objectKey := object.Key("DebugLogging") + objectKey.Boolean(*v.DebugLogging) + } + + if v.IdleClientTimeout != nil { + objectKey := object.Key("IdleClientTimeout") + objectKey.Integer(*v.IdleClientTimeout) + } + + if v.NewDBProxyName != nil { + objectKey := object.Key("NewDBProxyName") + objectKey.String(*v.NewDBProxyName) + } + + if v.RequireTLS != nil { + objectKey := object.Key("RequireTLS") + objectKey.Boolean(*v.RequireTLS) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + if v.SecurityGroups != nil { + objectKey := object.Key("SecurityGroups") + if err := awsAwsquery_serializeDocumentStringList(v.SecurityGroups, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBProxyTargetGroupInput(v *ModifyDBProxyTargetGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ConnectionPoolConfig != nil { + objectKey := object.Key("ConnectionPoolConfig") + if err := awsAwsquery_serializeDocumentConnectionPoolConfiguration(v.ConnectionPoolConfig, objectKey); err != nil { + return err + } + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.NewName != nil { + objectKey := object.Key("NewName") + objectKey.String(*v.NewName) + } + + if v.TargetGroupName != nil { + objectKey := object.Key("TargetGroupName") + objectKey.String(*v.TargetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBRecommendationInput(v *ModifyDBRecommendationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Locale != nil { + objectKey := object.Key("Locale") + objectKey.String(*v.Locale) + } + + if v.RecommendationId != nil { + objectKey := object.Key("RecommendationId") + objectKey.String(*v.RecommendationId) + } + + if v.RecommendedActionUpdates != nil { + objectKey := object.Key("RecommendedActionUpdates") + if err := awsAwsquery_serializeDocumentRecommendedActionUpdateList(v.RecommendedActionUpdates, objectKey); err != nil { + return err + } + } + + if v.Status != nil { + objectKey := object.Key("Status") + objectKey.String(*v.Status) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBShardGroupInput(v *ModifyDBShardGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ComputeRedundancy != nil { + objectKey := object.Key("ComputeRedundancy") + objectKey.Integer(*v.ComputeRedundancy) + } + + if v.DBShardGroupIdentifier != nil { + objectKey := object.Key("DBShardGroupIdentifier") + objectKey.String(*v.DBShardGroupIdentifier) + } + + if v.MaxACU != nil { + objectKey := object.Key("MaxACU") + switch { + case math.IsNaN(*v.MaxACU): + objectKey.String("NaN") + + case math.IsInf(*v.MaxACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MaxACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MaxACU) + + } + } + + if v.MinACU != nil { + objectKey := object.Key("MinACU") + switch { + case math.IsNaN(*v.MinACU): + objectKey.String("NaN") + + case math.IsInf(*v.MinACU, 1): + objectKey.String("Infinity") + + case math.IsInf(*v.MinACU, -1): + objectKey.String("-Infinity") + + default: + objectKey.Double(*v.MinACU) + + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBSnapshotAttributeInput(v *ModifyDBSnapshotAttributeInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AttributeName != nil { + objectKey := object.Key("AttributeName") + objectKey.String(*v.AttributeName) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.ValuesToAdd != nil { + objectKey := object.Key("ValuesToAdd") + if err := awsAwsquery_serializeDocumentAttributeValueList(v.ValuesToAdd, objectKey); err != nil { + return err + } + } + + if v.ValuesToRemove != nil { + objectKey := object.Key("ValuesToRemove") + if err := awsAwsquery_serializeDocumentAttributeValueList(v.ValuesToRemove, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBSnapshotInput(v *ModifyDBSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyDBSubnetGroupInput(v *ModifyDBSubnetGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBSubnetGroupDescription != nil { + objectKey := object.Key("DBSubnetGroupDescription") + objectKey.String(*v.DBSubnetGroupDescription) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.SubnetIds != nil { + objectKey := object.Key("SubnetIds") + if err := awsAwsquery_serializeDocumentSubnetIdentifierList(v.SubnetIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyEventSubscriptionInput(v *ModifyEventSubscriptionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Enabled != nil { + objectKey := object.Key("Enabled") + objectKey.Boolean(*v.Enabled) + } + + if v.EventCategories != nil { + objectKey := object.Key("EventCategories") + if err := awsAwsquery_serializeDocumentEventCategoriesList(v.EventCategories, objectKey); err != nil { + return err + } + } + + if v.SnsTopicArn != nil { + objectKey := object.Key("SnsTopicArn") + objectKey.String(*v.SnsTopicArn) + } + + if v.SourceType != nil { + objectKey := object.Key("SourceType") + objectKey.String(*v.SourceType) + } + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyGlobalClusterInput(v *ModifyGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllowMajorVersionUpgrade != nil { + objectKey := object.Key("AllowMajorVersionUpgrade") + objectKey.Boolean(*v.AllowMajorVersionUpgrade) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.NewGlobalClusterIdentifier != nil { + objectKey := object.Key("NewGlobalClusterIdentifier") + objectKey.String(*v.NewGlobalClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyIntegrationInput(v *ModifyIntegrationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DataFilter != nil { + objectKey := object.Key("DataFilter") + objectKey.String(*v.DataFilter) + } + + if v.Description != nil { + objectKey := object.Key("Description") + objectKey.String(*v.Description) + } + + if v.IntegrationIdentifier != nil { + objectKey := object.Key("IntegrationIdentifier") + objectKey.String(*v.IntegrationIdentifier) + } + + if v.IntegrationName != nil { + objectKey := object.Key("IntegrationName") + objectKey.String(*v.IntegrationName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyOptionGroupInput(v *ModifyOptionGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ApplyImmediately != nil { + objectKey := object.Key("ApplyImmediately") + objectKey.Boolean(*v.ApplyImmediately) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.OptionsToInclude != nil { + objectKey := object.Key("OptionsToInclude") + if err := awsAwsquery_serializeDocumentOptionConfigurationList(v.OptionsToInclude, objectKey); err != nil { + return err + } + } + + if v.OptionsToRemove != nil { + objectKey := object.Key("OptionsToRemove") + if err := awsAwsquery_serializeDocumentOptionNamesList(v.OptionsToRemove, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentModifyTenantDatabaseInput(v *ModifyTenantDatabaseInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.NewTenantDBName != nil { + objectKey := object.Key("NewTenantDBName") + objectKey.String(*v.NewTenantDBName) + } + + if v.TenantDBName != nil { + objectKey := object.Key("TenantDBName") + objectKey.String(*v.TenantDBName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentPromoteReadReplicaDBClusterInput(v *PromoteReadReplicaDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentPromoteReadReplicaInput(v *PromoteReadReplicaInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentPurchaseReservedDBInstancesOfferingInput(v *PurchaseReservedDBInstancesOfferingInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceCount != nil { + objectKey := object.Key("DBInstanceCount") + objectKey.Integer(*v.DBInstanceCount) + } + + if v.ReservedDBInstanceId != nil { + objectKey := object.Key("ReservedDBInstanceId") + objectKey.String(*v.ReservedDBInstanceId) + } + + if v.ReservedDBInstancesOfferingId != nil { + objectKey := object.Key("ReservedDBInstancesOfferingId") + objectKey.String(*v.ReservedDBInstancesOfferingId) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRebootDBClusterInput(v *RebootDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRebootDBInstanceInput(v *RebootDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.ForceFailover != nil { + objectKey := object.Key("ForceFailover") + objectKey.Boolean(*v.ForceFailover) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRebootDBShardGroupInput(v *RebootDBShardGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBShardGroupIdentifier != nil { + objectKey := object.Key("DBShardGroupIdentifier") + objectKey.String(*v.DBShardGroupIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRegisterDBProxyTargetsInput(v *RegisterDBProxyTargetsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifiers != nil { + objectKey := object.Key("DBClusterIdentifiers") + if err := awsAwsquery_serializeDocumentStringList(v.DBClusterIdentifiers, objectKey); err != nil { + return err + } + } + + if v.DBInstanceIdentifiers != nil { + objectKey := object.Key("DBInstanceIdentifiers") + if err := awsAwsquery_serializeDocumentStringList(v.DBInstanceIdentifiers, objectKey); err != nil { + return err + } + } + + if v.DBProxyName != nil { + objectKey := object.Key("DBProxyName") + objectKey.String(*v.DBProxyName) + } + + if v.TargetGroupName != nil { + objectKey := object.Key("TargetGroupName") + objectKey.String(*v.TargetGroupName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveFromGlobalClusterInput(v *RemoveFromGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DbClusterIdentifier != nil { + objectKey := object.Key("DbClusterIdentifier") + objectKey.String(*v.DbClusterIdentifier) + } + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveRoleFromDBClusterInput(v *RemoveRoleFromDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.FeatureName != nil { + objectKey := object.Key("FeatureName") + objectKey.String(*v.FeatureName) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveRoleFromDBInstanceInput(v *RemoveRoleFromDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.FeatureName != nil { + objectKey := object.Key("FeatureName") + objectKey.String(*v.FeatureName) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveSourceIdentifierFromSubscriptionInput(v *RemoveSourceIdentifierFromSubscriptionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceIdentifier != nil { + objectKey := object.Key("SourceIdentifier") + objectKey.String(*v.SourceIdentifier) + } + + if v.SubscriptionName != nil { + objectKey := object.Key("SubscriptionName") + objectKey.String(*v.SubscriptionName) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ResourceName != nil { + objectKey := object.Key("ResourceName") + objectKey.String(*v.ResourceName) + } + + if v.TagKeys != nil { + objectKey := object.Key("TagKeys") + if err := awsAwsquery_serializeDocumentKeyList(v.TagKeys, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentResetDBClusterParameterGroupInput(v *ResetDBClusterParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.Parameters != nil { + objectKey := object.Key("Parameters") + if err := awsAwsquery_serializeDocumentParametersList(v.Parameters, objectKey); err != nil { + return err + } + } + + if v.ResetAllParameters != nil { + objectKey := object.Key("ResetAllParameters") + objectKey.Boolean(*v.ResetAllParameters) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentResetDBParameterGroupInput(v *ResetDBParameterGroupInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.Parameters != nil { + objectKey := object.Key("Parameters") + if err := awsAwsquery_serializeDocumentParametersList(v.Parameters, objectKey); err != nil { + return err + } + } + + if v.ResetAllParameters != nil { + objectKey := object.Key("ResetAllParameters") + objectKey.Boolean(*v.ResetAllParameters) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBClusterFromS3Input(v *RestoreDBClusterFromS3Input, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.BacktrackWindow != nil { + objectKey := object.Key("BacktrackWindow") + objectKey.Long(*v.BacktrackWindow) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.CharacterSetName != nil { + objectKey := object.Key("CharacterSetName") + objectKey.String(*v.CharacterSetName) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.DatabaseName != nil { + objectKey := object.Key("DatabaseName") + objectKey.String(*v.DatabaseName) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUsername != nil { + objectKey := object.Key("MasterUsername") + objectKey.String(*v.MasterUsername) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.S3BucketName != nil { + objectKey := object.Key("S3BucketName") + objectKey.String(*v.S3BucketName) + } + + if v.S3IngestionRoleArn != nil { + objectKey := object.Key("S3IngestionRoleArn") + objectKey.String(*v.S3IngestionRoleArn) + } + + if v.S3Prefix != nil { + objectKey := object.Key("S3Prefix") + objectKey.String(*v.S3Prefix) + } + + if v.ServerlessV2ScalingConfiguration != nil { + objectKey := object.Key("ServerlessV2ScalingConfiguration") + if err := awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v.ServerlessV2ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.SourceEngine != nil { + objectKey := object.Key("SourceEngine") + objectKey.String(*v.SourceEngine) + } + + if v.SourceEngineVersion != nil { + objectKey := object.Key("SourceEngineVersion") + objectKey.String(*v.SourceEngineVersion) + } + + if v.StorageEncrypted != nil { + objectKey := object.Key("StorageEncrypted") + objectKey.Boolean(*v.StorageEncrypted) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBClusterFromSnapshotInput(v *RestoreDBClusterFromSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AvailabilityZones != nil { + objectKey := object.Key("AvailabilityZones") + if err := awsAwsquery_serializeDocumentAvailabilityZones(v.AvailabilityZones, objectKey); err != nil { + return err + } + } + + if v.BacktrackWindow != nil { + objectKey := object.Key("BacktrackWindow") + objectKey.Long(*v.BacktrackWindow) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.DatabaseName != nil { + objectKey := object.Key("DatabaseName") + objectKey.String(*v.DatabaseName) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterInstanceClass != nil { + objectKey := object.Key("DBClusterInstanceClass") + objectKey.String(*v.DBClusterInstanceClass) + } + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineMode != nil { + objectKey := object.Key("EngineMode") + objectKey.String(*v.EngineMode) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + + if v.ScalingConfiguration != nil { + objectKey := object.Key("ScalingConfiguration") + if err := awsAwsquery_serializeDocumentScalingConfiguration(v.ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.ServerlessV2ScalingConfiguration != nil { + objectKey := object.Key("ServerlessV2ScalingConfiguration") + if err := awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v.ServerlessV2ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.SnapshotIdentifier != nil { + objectKey := object.Key("SnapshotIdentifier") + objectKey.String(*v.SnapshotIdentifier) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBClusterToPointInTimeInput(v *RestoreDBClusterToPointInTimeInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BacktrackWindow != nil { + objectKey := object.Key("BacktrackWindow") + objectKey.Long(*v.BacktrackWindow) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + if v.DBClusterInstanceClass != nil { + objectKey := object.Key("DBClusterInstanceClass") + objectKey.String(*v.DBClusterInstanceClass) + } + + if v.DBClusterParameterGroupName != nil { + objectKey := object.Key("DBClusterParameterGroupName") + objectKey.String(*v.DBClusterParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineMode != nil { + objectKey := object.Key("EngineMode") + objectKey.String(*v.EngineMode) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.RdsCustomClusterConfiguration != nil { + objectKey := object.Key("RdsCustomClusterConfiguration") + if err := awsAwsquery_serializeDocumentRdsCustomClusterConfiguration(v.RdsCustomClusterConfiguration, objectKey); err != nil { + return err + } + } + + if v.RestoreToTime != nil { + objectKey := object.Key("RestoreToTime") + objectKey.String(smithytime.FormatDateTime(*v.RestoreToTime)) + } + + if v.RestoreType != nil { + objectKey := object.Key("RestoreType") + objectKey.String(*v.RestoreType) + } + + if v.ScalingConfiguration != nil { + objectKey := object.Key("ScalingConfiguration") + if err := awsAwsquery_serializeDocumentScalingConfiguration(v.ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.ServerlessV2ScalingConfiguration != nil { + objectKey := object.Key("ServerlessV2ScalingConfiguration") + if err := awsAwsquery_serializeDocumentServerlessV2ScalingConfiguration(v.ServerlessV2ScalingConfiguration, objectKey); err != nil { + return err + } + } + + if v.SourceDBClusterIdentifier != nil { + objectKey := object.Key("SourceDBClusterIdentifier") + objectKey.String(*v.SourceDBClusterIdentifier) + } + + if v.SourceDbClusterResourceId != nil { + objectKey := object.Key("SourceDbClusterResourceId") + objectKey.String(*v.SourceDbClusterResourceId) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.UseLatestRestorableTime != nil { + objectKey := object.Key("UseLatestRestorableTime") + objectKey.Boolean(*v.UseLatestRestorableTime) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBInstanceFromDBSnapshotInput(v *RestoreDBInstanceFromDBSnapshotInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZone != nil { + objectKey := object.Key("AvailabilityZone") + objectKey.String(*v.AvailabilityZone) + } + + if v.BackupTarget != nil { + objectKey := object.Key("BackupTarget") + objectKey.String(*v.BackupTarget) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.CustomIamInstanceProfile != nil { + objectKey := object.Key("CustomIamInstanceProfile") + objectKey.String(*v.CustomIamInstanceProfile) + } + + if v.DBClusterSnapshotIdentifier != nil { + objectKey := object.Key("DBClusterSnapshotIdentifier") + objectKey.String(*v.DBClusterSnapshotIdentifier) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBName != nil { + objectKey := object.Key("DBName") + objectKey.String(*v.DBName) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainAuthSecretArn != nil { + objectKey := object.Key("DomainAuthSecretArn") + objectKey.String(*v.DomainAuthSecretArn) + } + + if v.DomainDnsIps != nil { + objectKey := object.Key("DomainDnsIps") + if err := awsAwsquery_serializeDocumentStringList(v.DomainDnsIps, objectKey); err != nil { + return err + } + } + + if v.DomainFqdn != nil { + objectKey := object.Key("DomainFqdn") + objectKey.String(*v.DomainFqdn) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.DomainOu != nil { + objectKey := object.Key("DomainOu") + objectKey.String(*v.DomainOu) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TdeCredentialArn != nil { + objectKey := object.Key("TdeCredentialArn") + objectKey.String(*v.TdeCredentialArn) + } + + if v.TdeCredentialPassword != nil { + objectKey := object.Key("TdeCredentialPassword") + objectKey.String(*v.TdeCredentialPassword) + } + + if v.UseDefaultProcessorFeatures != nil { + objectKey := object.Key("UseDefaultProcessorFeatures") + objectKey.Boolean(*v.UseDefaultProcessorFeatures) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBInstanceFromS3Input(v *RestoreDBInstanceFromS3Input, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZone != nil { + objectKey := object.Key("AvailabilityZone") + objectKey.String(*v.AvailabilityZone) + } + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if len(v.DatabaseInsightsMode) > 0 { + objectKey := object.Key("DatabaseInsightsMode") + objectKey.String(string(v.DatabaseInsightsMode)) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBName != nil { + objectKey := object.Key("DBName") + objectKey.String(*v.DBName) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBSecurityGroups != nil { + objectKey := object.Key("DBSecurityGroups") + if err := awsAwsquery_serializeDocumentDBSecurityGroupNameList(v.DBSecurityGroups, objectKey); err != nil { + return err + } + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.EnablePerformanceInsights != nil { + objectKey := object.Key("EnablePerformanceInsights") + objectKey.Boolean(*v.EnablePerformanceInsights) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.EngineVersion != nil { + objectKey := object.Key("EngineVersion") + objectKey.String(*v.EngineVersion) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.ManageMasterUserPassword != nil { + objectKey := object.Key("ManageMasterUserPassword") + objectKey.Boolean(*v.ManageMasterUserPassword) + } + + if v.MasterUsername != nil { + objectKey := object.Key("MasterUsername") + objectKey.String(*v.MasterUsername) + } + + if v.MasterUserPassword != nil { + objectKey := object.Key("MasterUserPassword") + objectKey.String(*v.MasterUserPassword) + } + + if v.MasterUserSecretKmsKeyId != nil { + objectKey := object.Key("MasterUserSecretKmsKeyId") + objectKey.String(*v.MasterUserSecretKmsKeyId) + } + + if v.MaxAllocatedStorage != nil { + objectKey := object.Key("MaxAllocatedStorage") + objectKey.Integer(*v.MaxAllocatedStorage) + } + + if v.MonitoringInterval != nil { + objectKey := object.Key("MonitoringInterval") + objectKey.Integer(*v.MonitoringInterval) + } + + if v.MonitoringRoleArn != nil { + objectKey := object.Key("MonitoringRoleArn") + objectKey.String(*v.MonitoringRoleArn) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.PerformanceInsightsKMSKeyId != nil { + objectKey := object.Key("PerformanceInsightsKMSKeyId") + objectKey.String(*v.PerformanceInsightsKMSKeyId) + } + + if v.PerformanceInsightsRetentionPeriod != nil { + objectKey := object.Key("PerformanceInsightsRetentionPeriod") + objectKey.Integer(*v.PerformanceInsightsRetentionPeriod) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.PreferredBackupWindow != nil { + objectKey := object.Key("PreferredBackupWindow") + objectKey.String(*v.PreferredBackupWindow) + } + + if v.PreferredMaintenanceWindow != nil { + objectKey := object.Key("PreferredMaintenanceWindow") + objectKey.String(*v.PreferredMaintenanceWindow) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.S3BucketName != nil { + objectKey := object.Key("S3BucketName") + objectKey.String(*v.S3BucketName) + } + + if v.S3IngestionRoleArn != nil { + objectKey := object.Key("S3IngestionRoleArn") + objectKey.String(*v.S3IngestionRoleArn) + } + + if v.S3Prefix != nil { + objectKey := object.Key("S3Prefix") + objectKey.String(*v.S3Prefix) + } + + if v.SourceEngine != nil { + objectKey := object.Key("SourceEngine") + objectKey.String(*v.SourceEngine) + } + + if v.SourceEngineVersion != nil { + objectKey := object.Key("SourceEngineVersion") + objectKey.String(*v.SourceEngineVersion) + } + + if v.StorageEncrypted != nil { + objectKey := object.Key("StorageEncrypted") + objectKey.Boolean(*v.StorageEncrypted) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.UseDefaultProcessorFeatures != nil { + objectKey := object.Key("UseDefaultProcessorFeatures") + objectKey.Boolean(*v.UseDefaultProcessorFeatures) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRestoreDBInstanceToPointInTimeInput(v *RestoreDBInstanceToPointInTimeInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AllocatedStorage != nil { + objectKey := object.Key("AllocatedStorage") + objectKey.Integer(*v.AllocatedStorage) + } + + if v.AutoMinorVersionUpgrade != nil { + objectKey := object.Key("AutoMinorVersionUpgrade") + objectKey.Boolean(*v.AutoMinorVersionUpgrade) + } + + if v.AvailabilityZone != nil { + objectKey := object.Key("AvailabilityZone") + objectKey.String(*v.AvailabilityZone) + } + + if v.BackupTarget != nil { + objectKey := object.Key("BackupTarget") + objectKey.String(*v.BackupTarget) + } + + if v.CACertificateIdentifier != nil { + objectKey := object.Key("CACertificateIdentifier") + objectKey.String(*v.CACertificateIdentifier) + } + + if v.CopyTagsToSnapshot != nil { + objectKey := object.Key("CopyTagsToSnapshot") + objectKey.Boolean(*v.CopyTagsToSnapshot) + } + + if v.CustomIamInstanceProfile != nil { + objectKey := object.Key("CustomIamInstanceProfile") + objectKey.String(*v.CustomIamInstanceProfile) + } + + if v.DBInstanceClass != nil { + objectKey := object.Key("DBInstanceClass") + objectKey.String(*v.DBInstanceClass) + } + + if v.DBName != nil { + objectKey := object.Key("DBName") + objectKey.String(*v.DBName) + } + + if v.DBParameterGroupName != nil { + objectKey := object.Key("DBParameterGroupName") + objectKey.String(*v.DBParameterGroupName) + } + + if v.DBSubnetGroupName != nil { + objectKey := object.Key("DBSubnetGroupName") + objectKey.String(*v.DBSubnetGroupName) + } + + if v.DedicatedLogVolume != nil { + objectKey := object.Key("DedicatedLogVolume") + objectKey.Boolean(*v.DedicatedLogVolume) + } + + if v.DeletionProtection != nil { + objectKey := object.Key("DeletionProtection") + objectKey.Boolean(*v.DeletionProtection) + } + + if v.Domain != nil { + objectKey := object.Key("Domain") + objectKey.String(*v.Domain) + } + + if v.DomainAuthSecretArn != nil { + objectKey := object.Key("DomainAuthSecretArn") + objectKey.String(*v.DomainAuthSecretArn) + } + + if v.DomainDnsIps != nil { + objectKey := object.Key("DomainDnsIps") + if err := awsAwsquery_serializeDocumentStringList(v.DomainDnsIps, objectKey); err != nil { + return err + } + } + + if v.DomainFqdn != nil { + objectKey := object.Key("DomainFqdn") + objectKey.String(*v.DomainFqdn) + } + + if v.DomainIAMRoleName != nil { + objectKey := object.Key("DomainIAMRoleName") + objectKey.String(*v.DomainIAMRoleName) + } + + if v.DomainOu != nil { + objectKey := object.Key("DomainOu") + objectKey.String(*v.DomainOu) + } + + if v.EnableCloudwatchLogsExports != nil { + objectKey := object.Key("EnableCloudwatchLogsExports") + if err := awsAwsquery_serializeDocumentLogTypeList(v.EnableCloudwatchLogsExports, objectKey); err != nil { + return err + } + } + + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + + if v.EnableIAMDatabaseAuthentication != nil { + objectKey := object.Key("EnableIAMDatabaseAuthentication") + objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) + } + + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + + if v.EngineLifecycleSupport != nil { + objectKey := object.Key("EngineLifecycleSupport") + objectKey.String(*v.EngineLifecycleSupport) + } + + if v.Iops != nil { + objectKey := object.Key("Iops") + objectKey.Integer(*v.Iops) + } + + if v.LicenseModel != nil { + objectKey := object.Key("LicenseModel") + objectKey.String(*v.LicenseModel) + } + + if v.MaxAllocatedStorage != nil { + objectKey := object.Key("MaxAllocatedStorage") + objectKey.Integer(*v.MaxAllocatedStorage) + } + + if v.MultiAZ != nil { + objectKey := object.Key("MultiAZ") + objectKey.Boolean(*v.MultiAZ) + } + + if v.NetworkType != nil { + objectKey := object.Key("NetworkType") + objectKey.String(*v.NetworkType) + } + + if v.OptionGroupName != nil { + objectKey := object.Key("OptionGroupName") + objectKey.String(*v.OptionGroupName) + } + + if v.Port != nil { + objectKey := object.Key("Port") + objectKey.Integer(*v.Port) + } + + if v.ProcessorFeatures != nil { + objectKey := object.Key("ProcessorFeatures") + if err := awsAwsquery_serializeDocumentProcessorFeatureList(v.ProcessorFeatures, objectKey); err != nil { + return err + } + } + + if v.PubliclyAccessible != nil { + objectKey := object.Key("PubliclyAccessible") + objectKey.Boolean(*v.PubliclyAccessible) + } + + if v.RestoreTime != nil { + objectKey := object.Key("RestoreTime") + objectKey.String(smithytime.FormatDateTime(*v.RestoreTime)) + } + + if v.SourceDBInstanceAutomatedBackupsArn != nil { + objectKey := object.Key("SourceDBInstanceAutomatedBackupsArn") + objectKey.String(*v.SourceDBInstanceAutomatedBackupsArn) + } + + if v.SourceDBInstanceIdentifier != nil { + objectKey := object.Key("SourceDBInstanceIdentifier") + objectKey.String(*v.SourceDBInstanceIdentifier) + } + + if v.SourceDbiResourceId != nil { + objectKey := object.Key("SourceDbiResourceId") + objectKey.String(*v.SourceDbiResourceId) + } + + if v.StorageThroughput != nil { + objectKey := object.Key("StorageThroughput") + objectKey.Integer(*v.StorageThroughput) + } + + if v.StorageType != nil { + objectKey := object.Key("StorageType") + objectKey.String(*v.StorageType) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagList(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TargetDBInstanceIdentifier != nil { + objectKey := object.Key("TargetDBInstanceIdentifier") + objectKey.String(*v.TargetDBInstanceIdentifier) + } + + if v.TdeCredentialArn != nil { + objectKey := object.Key("TdeCredentialArn") + objectKey.String(*v.TdeCredentialArn) + } + + if v.TdeCredentialPassword != nil { + objectKey := object.Key("TdeCredentialPassword") + objectKey.String(*v.TdeCredentialPassword) + } + + if v.UseDefaultProcessorFeatures != nil { + objectKey := object.Key("UseDefaultProcessorFeatures") + objectKey.Boolean(*v.UseDefaultProcessorFeatures) + } + + if v.UseLatestRestorableTime != nil { + objectKey := object.Key("UseLatestRestorableTime") + objectKey.Boolean(*v.UseLatestRestorableTime) + } + + if v.VpcSecurityGroupIds != nil { + objectKey := object.Key("VpcSecurityGroupIds") + if err := awsAwsquery_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentRevokeDBSecurityGroupIngressInput(v *RevokeDBSecurityGroupIngressInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CIDRIP != nil { + objectKey := object.Key("CIDRIP") + objectKey.String(*v.CIDRIP) + } + + if v.DBSecurityGroupName != nil { + objectKey := object.Key("DBSecurityGroupName") + objectKey.String(*v.DBSecurityGroupName) + } + + if v.EC2SecurityGroupId != nil { + objectKey := object.Key("EC2SecurityGroupId") + objectKey.String(*v.EC2SecurityGroupId) + } + + if v.EC2SecurityGroupName != nil { + objectKey := object.Key("EC2SecurityGroupName") + objectKey.String(*v.EC2SecurityGroupName) + } + + if v.EC2SecurityGroupOwnerId != nil { + objectKey := object.Key("EC2SecurityGroupOwnerId") + objectKey.String(*v.EC2SecurityGroupOwnerId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStartActivityStreamInput(v *StartActivityStreamInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ApplyImmediately != nil { + objectKey := object.Key("ApplyImmediately") + objectKey.Boolean(*v.ApplyImmediately) + } + + if v.EngineNativeAuditFieldsIncluded != nil { + objectKey := object.Key("EngineNativeAuditFieldsIncluded") + objectKey.Boolean(*v.EngineNativeAuditFieldsIncluded) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if len(v.Mode) > 0 { + objectKey := object.Key("Mode") + objectKey.String(string(v.Mode)) + } + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStartDBClusterInput(v *StartDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStartDBInstanceAutomatedBackupsReplicationInput(v *StartDBInstanceAutomatedBackupsReplicationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BackupRetentionPeriod != nil { + objectKey := object.Key("BackupRetentionPeriod") + objectKey.Integer(*v.BackupRetentionPeriod) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.PreSignedUrl != nil { + objectKey := object.Key("PreSignedUrl") + objectKey.String(*v.PreSignedUrl) + } + + if v.SourceDBInstanceArn != nil { + objectKey := object.Key("SourceDBInstanceArn") + objectKey.String(*v.SourceDBInstanceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStartDBInstanceInput(v *StartDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStartExportTaskInput(v *StartExportTaskInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ExportOnly != nil { + objectKey := object.Key("ExportOnly") + if err := awsAwsquery_serializeDocumentStringList(v.ExportOnly, objectKey); err != nil { + return err + } + } + + if v.ExportTaskIdentifier != nil { + objectKey := object.Key("ExportTaskIdentifier") + objectKey.String(*v.ExportTaskIdentifier) + } + + if v.IamRoleArn != nil { + objectKey := object.Key("IamRoleArn") + objectKey.String(*v.IamRoleArn) + } + + if v.KmsKeyId != nil { + objectKey := object.Key("KmsKeyId") + objectKey.String(*v.KmsKeyId) + } + + if v.S3BucketName != nil { + objectKey := object.Key("S3BucketName") + objectKey.String(*v.S3BucketName) + } + + if v.S3Prefix != nil { + objectKey := object.Key("S3Prefix") + objectKey.String(*v.S3Prefix) + } + + if v.SourceArn != nil { + objectKey := object.Key("SourceArn") + objectKey.String(*v.SourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStopActivityStreamInput(v *StopActivityStreamInput, value query.Value) error { + object := value.Object() + _ = object + + if v.ApplyImmediately != nil { + objectKey := object.Key("ApplyImmediately") + objectKey.Boolean(*v.ApplyImmediately) + } + + if v.ResourceArn != nil { + objectKey := object.Key("ResourceArn") + objectKey.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStopDBClusterInput(v *StopDBClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBClusterIdentifier != nil { + objectKey := object.Key("DBClusterIdentifier") + objectKey.String(*v.DBClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStopDBInstanceAutomatedBackupsReplicationInput(v *StopDBInstanceAutomatedBackupsReplicationInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SourceDBInstanceArn != nil { + objectKey := object.Key("SourceDBInstanceArn") + objectKey.String(*v.SourceDBInstanceArn) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentStopDBInstanceInput(v *StopDBInstanceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + if v.DBSnapshotIdentifier != nil { + objectKey := object.Key("DBSnapshotIdentifier") + objectKey.String(*v.DBSnapshotIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSwitchoverBlueGreenDeploymentInput(v *SwitchoverBlueGreenDeploymentInput, value query.Value) error { + object := value.Object() + _ = object + + if v.BlueGreenDeploymentIdentifier != nil { + objectKey := object.Key("BlueGreenDeploymentIdentifier") + objectKey.String(*v.BlueGreenDeploymentIdentifier) + } + + if v.SwitchoverTimeout != nil { + objectKey := object.Key("SwitchoverTimeout") + objectKey.Integer(*v.SwitchoverTimeout) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSwitchoverGlobalClusterInput(v *SwitchoverGlobalClusterInput, value query.Value) error { + object := value.Object() + _ = object + + if v.GlobalClusterIdentifier != nil { + objectKey := object.Key("GlobalClusterIdentifier") + objectKey.String(*v.GlobalClusterIdentifier) + } + + if v.TargetDbClusterIdentifier != nil { + objectKey := object.Key("TargetDbClusterIdentifier") + objectKey.String(*v.TargetDbClusterIdentifier) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentSwitchoverReadReplicaInput(v *SwitchoverReadReplicaInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/enums.go new file mode 100644 index 00000000..8391cd72 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/enums.go @@ -0,0 +1,657 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ActivityStreamMode string + +// Enum values for ActivityStreamMode +const ( + ActivityStreamModeSync ActivityStreamMode = "sync" + ActivityStreamModeAsync ActivityStreamMode = "async" +) + +// Values returns all known values for ActivityStreamMode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ActivityStreamMode) Values() []ActivityStreamMode { + return []ActivityStreamMode{ + "sync", + "async", + } +} + +type ActivityStreamPolicyStatus string + +// Enum values for ActivityStreamPolicyStatus +const ( + ActivityStreamPolicyStatusLocked ActivityStreamPolicyStatus = "locked" + ActivityStreamPolicyStatusUnlocked ActivityStreamPolicyStatus = "unlocked" + ActivityStreamPolicyStatusLockingPolicy ActivityStreamPolicyStatus = "locking-policy" + ActivityStreamPolicyStatusUnlockingPolicy ActivityStreamPolicyStatus = "unlocking-policy" +) + +// Values returns all known values for ActivityStreamPolicyStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ActivityStreamPolicyStatus) Values() []ActivityStreamPolicyStatus { + return []ActivityStreamPolicyStatus{ + "locked", + "unlocked", + "locking-policy", + "unlocking-policy", + } +} + +type ActivityStreamStatus string + +// Enum values for ActivityStreamStatus +const ( + ActivityStreamStatusStopped ActivityStreamStatus = "stopped" + ActivityStreamStatusStarting ActivityStreamStatus = "starting" + ActivityStreamStatusStarted ActivityStreamStatus = "started" + ActivityStreamStatusStopping ActivityStreamStatus = "stopping" +) + +// Values returns all known values for ActivityStreamStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ActivityStreamStatus) Values() []ActivityStreamStatus { + return []ActivityStreamStatus{ + "stopped", + "starting", + "started", + "stopping", + } +} + +type ApplyMethod string + +// Enum values for ApplyMethod +const ( + ApplyMethodImmediate ApplyMethod = "immediate" + ApplyMethodPendingReboot ApplyMethod = "pending-reboot" +) + +// Values returns all known values for ApplyMethod. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ApplyMethod) Values() []ApplyMethod { + return []ApplyMethod{ + "immediate", + "pending-reboot", + } +} + +type AuditPolicyState string + +// Enum values for AuditPolicyState +const ( + AuditPolicyStateLockedPolicy AuditPolicyState = "locked" + AuditPolicyStateUnlockedPolicy AuditPolicyState = "unlocked" +) + +// Values returns all known values for AuditPolicyState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AuditPolicyState) Values() []AuditPolicyState { + return []AuditPolicyState{ + "locked", + "unlocked", + } +} + +type AuthScheme string + +// Enum values for AuthScheme +const ( + AuthSchemeSecrets AuthScheme = "SECRETS" +) + +// Values returns all known values for AuthScheme. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AuthScheme) Values() []AuthScheme { + return []AuthScheme{ + "SECRETS", + } +} + +type AutomationMode string + +// Enum values for AutomationMode +const ( + AutomationModeFull AutomationMode = "full" + AutomationModeAllPaused AutomationMode = "all-paused" +) + +// Values returns all known values for AutomationMode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AutomationMode) Values() []AutomationMode { + return []AutomationMode{ + "full", + "all-paused", + } +} + +type ClientPasswordAuthType string + +// Enum values for ClientPasswordAuthType +const ( + ClientPasswordAuthTypeMysqlNativePassword ClientPasswordAuthType = "MYSQL_NATIVE_PASSWORD" + ClientPasswordAuthTypeMysqlCachingSha2Password ClientPasswordAuthType = "MYSQL_CACHING_SHA2_PASSWORD" + ClientPasswordAuthTypePostgresScramSha256 ClientPasswordAuthType = "POSTGRES_SCRAM_SHA_256" + ClientPasswordAuthTypePostgresMd5 ClientPasswordAuthType = "POSTGRES_MD5" + ClientPasswordAuthTypeSqlServerAuthentication ClientPasswordAuthType = "SQL_SERVER_AUTHENTICATION" +) + +// Values returns all known values for ClientPasswordAuthType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ClientPasswordAuthType) Values() []ClientPasswordAuthType { + return []ClientPasswordAuthType{ + "MYSQL_NATIVE_PASSWORD", + "MYSQL_CACHING_SHA2_PASSWORD", + "POSTGRES_SCRAM_SHA_256", + "POSTGRES_MD5", + "SQL_SERVER_AUTHENTICATION", + } +} + +type ClusterScalabilityType string + +// Enum values for ClusterScalabilityType +const ( + ClusterScalabilityTypeStandard ClusterScalabilityType = "standard" + ClusterScalabilityTypeLimitless ClusterScalabilityType = "limitless" +) + +// Values returns all known values for ClusterScalabilityType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ClusterScalabilityType) Values() []ClusterScalabilityType { + return []ClusterScalabilityType{ + "standard", + "limitless", + } +} + +type CustomEngineVersionStatus string + +// Enum values for CustomEngineVersionStatus +const ( + CustomEngineVersionStatusAvailable CustomEngineVersionStatus = "available" + CustomEngineVersionStatusInactive CustomEngineVersionStatus = "inactive" + CustomEngineVersionStatusInactiveExceptRestore CustomEngineVersionStatus = "inactive-except-restore" +) + +// Values returns all known values for CustomEngineVersionStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CustomEngineVersionStatus) Values() []CustomEngineVersionStatus { + return []CustomEngineVersionStatus{ + "available", + "inactive", + "inactive-except-restore", + } +} + +type DatabaseInsightsMode string + +// Enum values for DatabaseInsightsMode +const ( + DatabaseInsightsModeStandard DatabaseInsightsMode = "standard" + DatabaseInsightsModeAdvanced DatabaseInsightsMode = "advanced" +) + +// Values returns all known values for DatabaseInsightsMode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DatabaseInsightsMode) Values() []DatabaseInsightsMode { + return []DatabaseInsightsMode{ + "standard", + "advanced", + } +} + +type DBProxyEndpointStatus string + +// Enum values for DBProxyEndpointStatus +const ( + DBProxyEndpointStatusAvailable DBProxyEndpointStatus = "available" + DBProxyEndpointStatusModifying DBProxyEndpointStatus = "modifying" + DBProxyEndpointStatusIncompatibleNetwork DBProxyEndpointStatus = "incompatible-network" + DBProxyEndpointStatusInsufficientResourceLimits DBProxyEndpointStatus = "insufficient-resource-limits" + DBProxyEndpointStatusCreating DBProxyEndpointStatus = "creating" + DBProxyEndpointStatusDeleting DBProxyEndpointStatus = "deleting" +) + +// Values returns all known values for DBProxyEndpointStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DBProxyEndpointStatus) Values() []DBProxyEndpointStatus { + return []DBProxyEndpointStatus{ + "available", + "modifying", + "incompatible-network", + "insufficient-resource-limits", + "creating", + "deleting", + } +} + +type DBProxyEndpointTargetRole string + +// Enum values for DBProxyEndpointTargetRole +const ( + DBProxyEndpointTargetRoleReadWrite DBProxyEndpointTargetRole = "READ_WRITE" + DBProxyEndpointTargetRoleReadOnly DBProxyEndpointTargetRole = "READ_ONLY" +) + +// Values returns all known values for DBProxyEndpointTargetRole. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DBProxyEndpointTargetRole) Values() []DBProxyEndpointTargetRole { + return []DBProxyEndpointTargetRole{ + "READ_WRITE", + "READ_ONLY", + } +} + +type DBProxyStatus string + +// Enum values for DBProxyStatus +const ( + DBProxyStatusAvailable DBProxyStatus = "available" + DBProxyStatusModifying DBProxyStatus = "modifying" + DBProxyStatusIncompatibleNetwork DBProxyStatus = "incompatible-network" + DBProxyStatusInsufficientResourceLimits DBProxyStatus = "insufficient-resource-limits" + DBProxyStatusCreating DBProxyStatus = "creating" + DBProxyStatusDeleting DBProxyStatus = "deleting" + DBProxyStatusSuspended DBProxyStatus = "suspended" + DBProxyStatusSuspending DBProxyStatus = "suspending" + DBProxyStatusReactivating DBProxyStatus = "reactivating" +) + +// Values returns all known values for DBProxyStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DBProxyStatus) Values() []DBProxyStatus { + return []DBProxyStatus{ + "available", + "modifying", + "incompatible-network", + "insufficient-resource-limits", + "creating", + "deleting", + "suspended", + "suspending", + "reactivating", + } +} + +type EngineFamily string + +// Enum values for EngineFamily +const ( + EngineFamilyMysql EngineFamily = "MYSQL" + EngineFamilyPostgresql EngineFamily = "POSTGRESQL" + EngineFamilySqlserver EngineFamily = "SQLSERVER" +) + +// Values returns all known values for EngineFamily. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EngineFamily) Values() []EngineFamily { + return []EngineFamily{ + "MYSQL", + "POSTGRESQL", + "SQLSERVER", + } +} + +type ExportSourceType string + +// Enum values for ExportSourceType +const ( + ExportSourceTypeSnapshot ExportSourceType = "SNAPSHOT" + ExportSourceTypeCluster ExportSourceType = "CLUSTER" +) + +// Values returns all known values for ExportSourceType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ExportSourceType) Values() []ExportSourceType { + return []ExportSourceType{ + "SNAPSHOT", + "CLUSTER", + } +} + +type FailoverStatus string + +// Enum values for FailoverStatus +const ( + FailoverStatusPending FailoverStatus = "pending" + FailoverStatusFailingOver FailoverStatus = "failing-over" + FailoverStatusCancelling FailoverStatus = "cancelling" +) + +// Values returns all known values for FailoverStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FailoverStatus) Values() []FailoverStatus { + return []FailoverStatus{ + "pending", + "failing-over", + "cancelling", + } +} + +type GlobalClusterMemberSynchronizationStatus string + +// Enum values for GlobalClusterMemberSynchronizationStatus +const ( + GlobalClusterMemberSynchronizationStatusConnected GlobalClusterMemberSynchronizationStatus = "connected" + GlobalClusterMemberSynchronizationStatusPendingResync GlobalClusterMemberSynchronizationStatus = "pending-resync" +) + +// Values returns all known values for GlobalClusterMemberSynchronizationStatus. +// Note that this can be expanded in the future, and so it is only as up to date as +// the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (GlobalClusterMemberSynchronizationStatus) Values() []GlobalClusterMemberSynchronizationStatus { + return []GlobalClusterMemberSynchronizationStatus{ + "connected", + "pending-resync", + } +} + +type IAMAuthMode string + +// Enum values for IAMAuthMode +const ( + IAMAuthModeDisabled IAMAuthMode = "DISABLED" + IAMAuthModeRequired IAMAuthMode = "REQUIRED" + IAMAuthModeEnabled IAMAuthMode = "ENABLED" +) + +// Values returns all known values for IAMAuthMode. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IAMAuthMode) Values() []IAMAuthMode { + return []IAMAuthMode{ + "DISABLED", + "REQUIRED", + "ENABLED", + } +} + +type IntegrationStatus string + +// Enum values for IntegrationStatus +const ( + IntegrationStatusCreating IntegrationStatus = "creating" + IntegrationStatusActive IntegrationStatus = "active" + IntegrationStatusModifying IntegrationStatus = "modifying" + IntegrationStatusFailed IntegrationStatus = "failed" + IntegrationStatusDeleting IntegrationStatus = "deleting" + IntegrationStatusSyncing IntegrationStatus = "syncing" + IntegrationStatusNeedsAttention IntegrationStatus = "needs_attention" +) + +// Values returns all known values for IntegrationStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IntegrationStatus) Values() []IntegrationStatus { + return []IntegrationStatus{ + "creating", + "active", + "modifying", + "failed", + "deleting", + "syncing", + "needs_attention", + } +} + +type LimitlessDatabaseStatus string + +// Enum values for LimitlessDatabaseStatus +const ( + LimitlessDatabaseStatusActive LimitlessDatabaseStatus = "active" + LimitlessDatabaseStatusNotInUse LimitlessDatabaseStatus = "not-in-use" + LimitlessDatabaseStatusEnabled LimitlessDatabaseStatus = "enabled" + LimitlessDatabaseStatusDisabled LimitlessDatabaseStatus = "disabled" + LimitlessDatabaseStatusEnabling LimitlessDatabaseStatus = "enabling" + LimitlessDatabaseStatusDisabling LimitlessDatabaseStatus = "disabling" + LimitlessDatabaseStatusModifyingMaxCapacity LimitlessDatabaseStatus = "modifying-max-capacity" + LimitlessDatabaseStatusError LimitlessDatabaseStatus = "error" +) + +// Values returns all known values for LimitlessDatabaseStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (LimitlessDatabaseStatus) Values() []LimitlessDatabaseStatus { + return []LimitlessDatabaseStatus{ + "active", + "not-in-use", + "enabled", + "disabled", + "enabling", + "disabling", + "modifying-max-capacity", + "error", + } +} + +type LocalWriteForwardingStatus string + +// Enum values for LocalWriteForwardingStatus +const ( + LocalWriteForwardingStatusEnabled LocalWriteForwardingStatus = "enabled" + LocalWriteForwardingStatusDisabled LocalWriteForwardingStatus = "disabled" + LocalWriteForwardingStatusEnabling LocalWriteForwardingStatus = "enabling" + LocalWriteForwardingStatusDisabling LocalWriteForwardingStatus = "disabling" + LocalWriteForwardingStatusRequested LocalWriteForwardingStatus = "requested" +) + +// Values returns all known values for LocalWriteForwardingStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (LocalWriteForwardingStatus) Values() []LocalWriteForwardingStatus { + return []LocalWriteForwardingStatus{ + "enabled", + "disabled", + "enabling", + "disabling", + "requested", + } +} + +type ReplicaMode string + +// Enum values for ReplicaMode +const ( + ReplicaModeOpenReadOnly ReplicaMode = "open-read-only" + ReplicaModeMounted ReplicaMode = "mounted" +) + +// Values returns all known values for ReplicaMode. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ReplicaMode) Values() []ReplicaMode { + return []ReplicaMode{ + "open-read-only", + "mounted", + } +} + +type SourceType string + +// Enum values for SourceType +const ( + SourceTypeDbInstance SourceType = "db-instance" + SourceTypeDbParameterGroup SourceType = "db-parameter-group" + SourceTypeDbSecurityGroup SourceType = "db-security-group" + SourceTypeDbSnapshot SourceType = "db-snapshot" + SourceTypeDbCluster SourceType = "db-cluster" + SourceTypeDbClusterSnapshot SourceType = "db-cluster-snapshot" + SourceTypeCustomEngineVersion SourceType = "custom-engine-version" + SourceTypeDbProxy SourceType = "db-proxy" + SourceTypeBlueGreenDeployment SourceType = "blue-green-deployment" +) + +// Values returns all known values for SourceType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SourceType) Values() []SourceType { + return []SourceType{ + "db-instance", + "db-parameter-group", + "db-security-group", + "db-snapshot", + "db-cluster", + "db-cluster-snapshot", + "custom-engine-version", + "db-proxy", + "blue-green-deployment", + } +} + +type TargetHealthReason string + +// Enum values for TargetHealthReason +const ( + TargetHealthReasonUnreachable TargetHealthReason = "UNREACHABLE" + TargetHealthReasonConnectionFailed TargetHealthReason = "CONNECTION_FAILED" + TargetHealthReasonAuthFailure TargetHealthReason = "AUTH_FAILURE" + TargetHealthReasonPendingProxyCapacity TargetHealthReason = "PENDING_PROXY_CAPACITY" + TargetHealthReasonInvalidReplicationState TargetHealthReason = "INVALID_REPLICATION_STATE" +) + +// Values returns all known values for TargetHealthReason. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetHealthReason) Values() []TargetHealthReason { + return []TargetHealthReason{ + "UNREACHABLE", + "CONNECTION_FAILED", + "AUTH_FAILURE", + "PENDING_PROXY_CAPACITY", + "INVALID_REPLICATION_STATE", + } +} + +type TargetRole string + +// Enum values for TargetRole +const ( + TargetRoleReadWrite TargetRole = "READ_WRITE" + TargetRoleReadOnly TargetRole = "READ_ONLY" + TargetRoleUnknown TargetRole = "UNKNOWN" +) + +// Values returns all known values for TargetRole. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetRole) Values() []TargetRole { + return []TargetRole{ + "READ_WRITE", + "READ_ONLY", + "UNKNOWN", + } +} + +type TargetState string + +// Enum values for TargetState +const ( + TargetStateRegistering TargetState = "REGISTERING" + TargetStateAvailable TargetState = "AVAILABLE" + TargetStateUnavailable TargetState = "UNAVAILABLE" +) + +// Values returns all known values for TargetState. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetState) Values() []TargetState { + return []TargetState{ + "REGISTERING", + "AVAILABLE", + "UNAVAILABLE", + } +} + +type TargetType string + +// Enum values for TargetType +const ( + TargetTypeRdsInstance TargetType = "RDS_INSTANCE" + TargetTypeRdsServerlessEndpoint TargetType = "RDS_SERVERLESS_ENDPOINT" + TargetTypeTrackedCluster TargetType = "TRACKED_CLUSTER" +) + +// Values returns all known values for TargetType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TargetType) Values() []TargetType { + return []TargetType{ + "RDS_INSTANCE", + "RDS_SERVERLESS_ENDPOINT", + "TRACKED_CLUSTER", + } +} + +type WriteForwardingStatus string + +// Enum values for WriteForwardingStatus +const ( + WriteForwardingStatusEnabled WriteForwardingStatus = "enabled" + WriteForwardingStatusDisabled WriteForwardingStatus = "disabled" + WriteForwardingStatusEnabling WriteForwardingStatus = "enabling" + WriteForwardingStatusDisabling WriteForwardingStatus = "disabling" + WriteForwardingStatusUnknown WriteForwardingStatus = "unknown" +) + +// Values returns all known values for WriteForwardingStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (WriteForwardingStatus) Values() []WriteForwardingStatus { + return []WriteForwardingStatus{ + "enabled", + "disabled", + "enabling", + "disabling", + "unknown", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/errors.go new file mode 100644 index 00000000..3c2e6fa6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/errors.go @@ -0,0 +1,3923 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The specified CIDR IP range or Amazon EC2 security group is already authorized +// for the specified DB security group. +type AuthorizationAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AuthorizationAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AuthorizationAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AuthorizationAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AuthorizationAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *AuthorizationAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified CIDR IP range or Amazon EC2 security group might not be +// authorized for the specified DB security group. +// +// Or, RDS might not be authorized to perform necessary actions using IAM on your +// behalf. +type AuthorizationNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AuthorizationNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AuthorizationNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AuthorizationNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AuthorizationNotFound" + } + return *e.ErrorCodeOverride +} +func (e *AuthorizationNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB security group authorization quota has been reached. +type AuthorizationQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AuthorizationQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AuthorizationQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AuthorizationQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AuthorizationQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *AuthorizationQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type BackupPolicyNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *BackupPolicyNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BackupPolicyNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BackupPolicyNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "BackupPolicyNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *BackupPolicyNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A blue/green deployment with the specified name already exists. +type BlueGreenDeploymentAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *BlueGreenDeploymentAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BlueGreenDeploymentAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BlueGreenDeploymentAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "BlueGreenDeploymentAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *BlueGreenDeploymentAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// BlueGreenDeploymentIdentifier doesn't refer to an existing blue/green +// deployment. +type BlueGreenDeploymentNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *BlueGreenDeploymentNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BlueGreenDeploymentNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BlueGreenDeploymentNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "BlueGreenDeploymentNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *BlueGreenDeploymentNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// CertificateIdentifier doesn't refer to an existing certificate. +type CertificateNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CertificateNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CertificateNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CertificateNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CertificateNotFound" + } + return *e.ErrorCodeOverride +} +func (e *CertificateNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An error occurred while trying to create the CEV. +type CreateCustomDBEngineVersionFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CreateCustomDBEngineVersionFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CreateCustomDBEngineVersionFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CreateCustomDBEngineVersionFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CreateCustomDBEngineVersionFault" + } + return *e.ErrorCodeOverride +} +func (e *CreateCustomDBEngineVersionFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// CustomAvailabilityZoneId doesn't refer to an existing custom Availability Zone +// identifier. +type CustomAvailabilityZoneNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CustomAvailabilityZoneNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomAvailabilityZoneNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomAvailabilityZoneNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomAvailabilityZoneNotFound" + } + return *e.ErrorCodeOverride +} +func (e *CustomAvailabilityZoneNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// A CEV with the specified name already exists. +type CustomDBEngineVersionAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CustomDBEngineVersionAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomDBEngineVersionAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomDBEngineVersionAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomDBEngineVersionAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *CustomDBEngineVersionAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified CEV was not found. +type CustomDBEngineVersionNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CustomDBEngineVersionNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomDBEngineVersionNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomDBEngineVersionNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomDBEngineVersionNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *CustomDBEngineVersionNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// You have exceeded your CEV quota. +type CustomDBEngineVersionQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *CustomDBEngineVersionQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *CustomDBEngineVersionQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *CustomDBEngineVersionQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "CustomDBEngineVersionQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *CustomDBEngineVersionQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The user already has a DB cluster with the given identifier. +type DBClusterAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// No automated backup for this DB cluster was found. +type DBClusterAutomatedBackupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterAutomatedBackupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterAutomatedBackupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterAutomatedBackupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterAutomatedBackupNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterAutomatedBackupNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The quota for retained automated backups was exceeded. This prevents you from +// retaining any additional automated backups. The retained automated backups quota +// is the same as your DB cluster quota. +type DBClusterAutomatedBackupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterAutomatedBackupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterAutomatedBackupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterAutomatedBackupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterAutomatedBackupQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterAutomatedBackupQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// BacktrackIdentifier doesn't refer to an existing backtrack. +type DBClusterBacktrackNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterBacktrackNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterBacktrackNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterBacktrackNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterBacktrackNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterBacktrackNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified custom endpoint can't be created because it already exists. +type DBClusterEndpointAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterEndpointAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterEndpointAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterEndpointAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterEndpointAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterEndpointAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified custom endpoint doesn't exist. +type DBClusterEndpointNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterEndpointNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterEndpointNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterEndpointNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterEndpointNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterEndpointNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The cluster already has the maximum number of custom endpoints. +type DBClusterEndpointQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterEndpointQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterEndpointQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterEndpointQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterEndpointQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterEndpointQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// DBClusterIdentifier doesn't refer to an existing DB cluster. +type DBClusterNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// DBClusterParameterGroupName doesn't refer to an existing DB cluster parameter +// group. +type DBClusterParameterGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterParameterGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterParameterGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterParameterGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterParameterGroupNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterParameterGroupNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The user attempted to create a new DB cluster and the user has already reached +// the maximum allowed DB cluster quota. +type DBClusterQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified IAM role Amazon Resource Name (ARN) is already associated with +// the specified DB cluster. +type DBClusterRoleAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterRoleAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterRoleAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterRoleAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterRoleAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterRoleAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified IAM role Amazon Resource Name (ARN) isn't associated with the +// specified DB cluster. +type DBClusterRoleNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterRoleNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterRoleNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterRoleNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterRoleNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterRoleNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You have exceeded the maximum number of IAM roles that can be associated with +// the specified DB cluster. +type DBClusterRoleQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterRoleQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterRoleQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterRoleQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterRoleQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterRoleQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The user already has a DB cluster snapshot with the given identifier. +type DBClusterSnapshotAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterSnapshotAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterSnapshotAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterSnapshotAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterSnapshotAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterSnapshotAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +type DBClusterSnapshotNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBClusterSnapshotNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBClusterSnapshotNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBClusterSnapshotNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBClusterSnapshotNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBClusterSnapshotNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The user already has a DB instance with the given identifier. +type DBInstanceAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// No automated backup for this DB instance was found. +type DBInstanceAutomatedBackupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceAutomatedBackupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceAutomatedBackupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceAutomatedBackupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceAutomatedBackupNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceAutomatedBackupNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The quota for retained automated backups was exceeded. This prevents you from +// retaining any additional automated backups. The retained automated backups quota +// is the same as your DB instance quota. +type DBInstanceAutomatedBackupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceAutomatedBackupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceAutomatedBackupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceAutomatedBackupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceAutomatedBackupQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceAutomatedBackupQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// DBInstanceIdentifier doesn't refer to an existing DB instance. +type DBInstanceNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An attempt to download or examine log files didn't succeed because an Aurora +// Serverless v2 instance was paused. +type DBInstanceNotReadyFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceNotReadyFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceNotReadyFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceNotReadyFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceNotReady" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceNotReadyFault) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The specified RoleArn or FeatureName value is already associated with the DB +// instance. +type DBInstanceRoleAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceRoleAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceRoleAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceRoleAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceRoleAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceRoleAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified RoleArn value doesn't match the specified feature for the DB +// instance. +type DBInstanceRoleNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceRoleNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceRoleNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceRoleNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceRoleNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceRoleNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You can't associate any more Amazon Web Services Identity and Access Management +// (IAM) roles with the DB instance because the quota has been reached. +type DBInstanceRoleQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBInstanceRoleQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBInstanceRoleQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBInstanceRoleQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBInstanceRoleQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *DBInstanceRoleQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// LogFileName doesn't refer to an existing DB log file. +type DBLogFileNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBLogFileNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBLogFileNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBLogFileNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBLogFileNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBLogFileNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A DB parameter group with the same name exists. +type DBParameterGroupAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBParameterGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBParameterGroupAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBParameterGroupAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBParameterGroupAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBParameterGroupAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// DBParameterGroupName doesn't refer to an existing DB parameter group. +type DBParameterGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBParameterGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBParameterGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBParameterGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBParameterGroupNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBParameterGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of DB +// parameter groups. +type DBParameterGroupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBParameterGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBParameterGroupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBParameterGroupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBParameterGroupQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *DBParameterGroupQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified proxy name must be unique for all proxies owned by your Amazon +// Web Services account in the specified Amazon Web Services Region. +type DBProxyAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified DB proxy endpoint name must be unique for all DB proxy endpoints +// owned by your Amazon Web Services account in the specified Amazon Web Services +// Region. +type DBProxyEndpointAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyEndpointAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyEndpointAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyEndpointAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyEndpointAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyEndpointAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB proxy endpoint doesn't exist. +type DBProxyEndpointNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyEndpointNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyEndpointNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyEndpointNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyEndpointNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyEndpointNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB proxy already has the maximum number of endpoints. +type DBProxyEndpointQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyEndpointQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyEndpointQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyEndpointQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyEndpointQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyEndpointQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified proxy name doesn't correspond to a proxy owned by your Amazon Web +// Services account in the specified Amazon Web Services Region. +type DBProxyNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Your Amazon Web Services account already has the maximum number of proxies in +// the specified Amazon Web Services Region. +type DBProxyQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The proxy is already associated with the specified RDS DB instance or Aurora DB +// cluster. +type DBProxyTargetAlreadyRegisteredFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyTargetAlreadyRegisteredFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyTargetAlreadyRegisteredFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyTargetAlreadyRegisteredFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyTargetAlreadyRegisteredFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyTargetAlreadyRegisteredFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified target group isn't available for a proxy owned by your Amazon Web +// Services account in the specified Amazon Web Services Region. +type DBProxyTargetGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyTargetGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyTargetGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyTargetGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyTargetGroupNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyTargetGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified RDS DB instance or Aurora DB cluster isn't available for a proxy +// owned by your Amazon Web Services account in the specified Amazon Web Services +// Region. +type DBProxyTargetNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBProxyTargetNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBProxyTargetNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBProxyTargetNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBProxyTargetNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBProxyTargetNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A DB security group with the name specified in DBSecurityGroupName already +// exists. +type DBSecurityGroupAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSecurityGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSecurityGroupAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSecurityGroupAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSecurityGroupAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBSecurityGroupAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// DBSecurityGroupName doesn't refer to an existing DB security group. +type DBSecurityGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSecurityGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSecurityGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSecurityGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSecurityGroupNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBSecurityGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A DB security group isn't allowed for this action. +type DBSecurityGroupNotSupportedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSecurityGroupNotSupportedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSecurityGroupNotSupportedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSecurityGroupNotSupportedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSecurityGroupNotSupported" + } + return *e.ErrorCodeOverride +} +func (e *DBSecurityGroupNotSupportedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of DB +// security groups. +type DBSecurityGroupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSecurityGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSecurityGroupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSecurityGroupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "QuotaExceeded.DBSecurityGroup" + } + return *e.ErrorCodeOverride +} +func (e *DBSecurityGroupQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified DB shard group name must be unique in your Amazon Web Services +// account in the specified Amazon Web Services Region. +type DBShardGroupAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBShardGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBShardGroupAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBShardGroupAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBShardGroupAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBShardGroupAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified DB shard group name wasn't found. +type DBShardGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBShardGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBShardGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBShardGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBShardGroupNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBShardGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// DBSnapshotIdentifier is already used by an existing snapshot. +type DBSnapshotAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSnapshotAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSnapshotAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSnapshotAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSnapshotAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBSnapshotAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +type DBSnapshotNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSnapshotNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSnapshotNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSnapshotNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSnapshotNotFound" + } + return *e.ErrorCodeOverride +} +func (e *DBSnapshotNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified snapshot tenant database wasn't found. +type DBSnapshotTenantDatabaseNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSnapshotTenantDatabaseNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSnapshotTenantDatabaseNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSnapshotTenantDatabaseNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSnapshotTenantDatabaseNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBSnapshotTenantDatabaseNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// DBSubnetGroupName is already used by an existing DB subnet group. +type DBSubnetGroupAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetGroupAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetGroupAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetGroupAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetGroupAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Subnets in the DB subnet group should cover at least two Availability Zones +// unless there is only one Availability Zone. +type DBSubnetGroupDoesNotCoverEnoughAZs struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetGroupDoesNotCoverEnoughAZs) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetGroupDoesNotCoverEnoughAZs) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetGroupDoesNotCoverEnoughAZs) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetGroupDoesNotCoverEnoughAZs" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetGroupDoesNotCoverEnoughAZs) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The DBSubnetGroup shouldn't be specified while creating read replicas that lie +// in the same region as the source instance. +type DBSubnetGroupNotAllowedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetGroupNotAllowedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetGroupNotAllowedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetGroupNotAllowedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetGroupNotAllowedFault" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetGroupNotAllowedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// DBSubnetGroupName doesn't refer to an existing DB subnet group. +type DBSubnetGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetGroupNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of DB subnet +// groups. +type DBSubnetGroupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetGroupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetGroupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetGroupQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetGroupQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of subnets in +// a DB subnet groups. +type DBSubnetQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBSubnetQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBSubnetQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBSubnetQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBSubnetQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *DBSubnetQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB upgrade failed because a resource the DB depends on can't be modified. +type DBUpgradeDependencyFailureFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DBUpgradeDependencyFailureFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DBUpgradeDependencyFailureFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DBUpgradeDependencyFailureFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DBUpgradeDependencyFailure" + } + return *e.ErrorCodeOverride +} +func (e *DBUpgradeDependencyFailureFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Domain doesn't refer to an existing Active Directory domain. +type DomainNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *DomainNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DomainNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DomainNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "DomainNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *DomainNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The AMI configuration prerequisite has not been met. +type Ec2ImagePropertiesNotSupportedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *Ec2ImagePropertiesNotSupportedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *Ec2ImagePropertiesNotSupportedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *Ec2ImagePropertiesNotSupportedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "Ec2ImagePropertiesNotSupportedFault" + } + return *e.ErrorCodeOverride +} +func (e *Ec2ImagePropertiesNotSupportedFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// You have reached the maximum number of event subscriptions. +type EventSubscriptionQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EventSubscriptionQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EventSubscriptionQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EventSubscriptionQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EventSubscriptionQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *EventSubscriptionQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// You can't start an export task that's already running. +type ExportTaskAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ExportTaskAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExportTaskAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExportTaskAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExportTaskAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *ExportTaskAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The export task doesn't exist. +type ExportTaskNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ExportTaskNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExportTaskNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExportTaskNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExportTaskNotFound" + } + return *e.ErrorCodeOverride +} +func (e *ExportTaskNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The GlobalClusterIdentifier already exists. Specify a new global database +// identifier (unique name) to create a new global database cluster or to rename an +// existing one. +type GlobalClusterAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *GlobalClusterAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *GlobalClusterAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *GlobalClusterAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "GlobalClusterAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *GlobalClusterAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The GlobalClusterIdentifier doesn't refer to an existing global database +// cluster. +type GlobalClusterNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *GlobalClusterNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *GlobalClusterNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *GlobalClusterNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "GlobalClusterNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *GlobalClusterNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The number of global database clusters for this account is already at the +// maximum allowed. +type GlobalClusterQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *GlobalClusterQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *GlobalClusterQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *GlobalClusterQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "GlobalClusterQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *GlobalClusterQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The IAM role requires additional permissions to export to an Amazon S3 bucket. +type IamRoleMissingPermissionsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IamRoleMissingPermissionsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IamRoleMissingPermissionsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IamRoleMissingPermissionsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IamRoleMissingPermissions" + } + return *e.ErrorCodeOverride +} +func (e *IamRoleMissingPermissionsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The IAM role is missing for exporting to an Amazon S3 bucket. +type IamRoleNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IamRoleNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IamRoleNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IamRoleNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IamRoleNotFound" + } + return *e.ErrorCodeOverride +} +func (e *IamRoleNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of DB +// instances. +type InstanceQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InstanceQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InstanceQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InstanceQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InstanceQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *InstanceQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested operation can't be performed because there aren't enough +// available IP addresses in the proxy's subnets. Add more CIDR blocks to the VPC +// or remove IP address that aren't required from the subnets. +type InsufficientAvailableIPsInSubnetFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InsufficientAvailableIPsInSubnetFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InsufficientAvailableIPsInSubnetFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InsufficientAvailableIPsInSubnetFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InsufficientAvailableIPsInSubnetFault" + } + return *e.ErrorCodeOverride +} +func (e *InsufficientAvailableIPsInSubnetFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The DB cluster doesn't have enough capacity for the current operation. +type InsufficientDBClusterCapacityFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InsufficientDBClusterCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InsufficientDBClusterCapacityFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InsufficientDBClusterCapacityFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InsufficientDBClusterCapacityFault" + } + return *e.ErrorCodeOverride +} +func (e *InsufficientDBClusterCapacityFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified DB instance class isn't available in the specified Availability +// Zone. +type InsufficientDBInstanceCapacityFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InsufficientDBInstanceCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InsufficientDBInstanceCapacityFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InsufficientDBInstanceCapacityFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InsufficientDBInstanceCapacity" + } + return *e.ErrorCodeOverride +} +func (e *InsufficientDBInstanceCapacityFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// There is insufficient storage available for the current action. You might be +// able to resolve this error by updating your subnet group to use different +// Availability Zones that have more storage available. +type InsufficientStorageClusterCapacityFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InsufficientStorageClusterCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InsufficientStorageClusterCapacityFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InsufficientStorageClusterCapacityFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InsufficientStorageClusterCapacity" + } + return *e.ErrorCodeOverride +} +func (e *InsufficientStorageClusterCapacityFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The integration you are trying to create already exists. +type IntegrationAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IntegrationAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IntegrationAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IntegrationAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IntegrationAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *IntegrationAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A conflicting conditional operation is currently in progress against this +// resource. Typically occurs when there are multiple requests being made to the +// same resource at the same time, and these requests conflict with each other. +type IntegrationConflictOperationFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IntegrationConflictOperationFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IntegrationConflictOperationFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IntegrationConflictOperationFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IntegrationConflictOperationFault" + } + return *e.ErrorCodeOverride +} +func (e *IntegrationConflictOperationFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified integration could not be found. +type IntegrationNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IntegrationNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IntegrationNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IntegrationNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IntegrationNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *IntegrationNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You can't crate any more zero-ETL integrations because the quota has been +// reached. +type IntegrationQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IntegrationQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IntegrationQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IntegrationQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IntegrationQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *IntegrationQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The blue/green deployment can't be switched over or deleted because there is an +// invalid configuration in the green environment. +type InvalidBlueGreenDeploymentStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidBlueGreenDeploymentStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidBlueGreenDeploymentStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidBlueGreenDeploymentStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidBlueGreenDeploymentStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidBlueGreenDeploymentStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// You can't delete the CEV. +type InvalidCustomDBEngineVersionStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidCustomDBEngineVersionStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidCustomDBEngineVersionStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidCustomDBEngineVersionStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidCustomDBEngineVersionStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidCustomDBEngineVersionStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The automated backup is in an invalid state. For example, this automated backup +// is associated with an active cluster. +type InvalidDBClusterAutomatedBackupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBClusterAutomatedBackupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBClusterAutomatedBackupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBClusterAutomatedBackupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBClusterAutomatedBackupStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBClusterAutomatedBackupStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Capacity isn't a valid Aurora Serverless DB cluster capacity. Valid capacity +// values are 2 , 4 , 8 , 16 , 32 , 64 , 128 , and 256 . +type InvalidDBClusterCapacityFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBClusterCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBClusterCapacityFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBClusterCapacityFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBClusterCapacityFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBClusterCapacityFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested operation can't be performed on the endpoint while the endpoint +// is in this state. +type InvalidDBClusterEndpointStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBClusterEndpointStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBClusterEndpointStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBClusterEndpointStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBClusterEndpointStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBClusterEndpointStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The supplied value isn't a valid DB cluster snapshot state. +type InvalidDBClusterSnapshotStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBClusterSnapshotStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBClusterSnapshotStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBClusterSnapshotStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBClusterSnapshotStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBClusterSnapshotStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The requested operation can't be performed while the cluster is in this state. +type InvalidDBClusterStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBClusterStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBClusterStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBClusterStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBClusterStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBClusterStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The automated backup is in an invalid state. For example, this automated backup +// is associated with an active instance. +type InvalidDBInstanceAutomatedBackupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBInstanceAutomatedBackupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBInstanceAutomatedBackupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBInstanceAutomatedBackupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBInstanceAutomatedBackupState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBInstanceAutomatedBackupStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The DB instance isn't in a valid state. +type InvalidDBInstanceStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBInstanceStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBInstanceStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBInstanceStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBInstanceState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBInstanceStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB parameter group is in use or is in an invalid state. If you are +// attempting to delete the parameter group, you can't delete it when the parameter +// group is in this state. +type InvalidDBParameterGroupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBParameterGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBParameterGroupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBParameterGroupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBParameterGroupState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBParameterGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You can't perform this operation while the DB proxy endpoint is in a particular +// state. +type InvalidDBProxyEndpointStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBProxyEndpointStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBProxyEndpointStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBProxyEndpointStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBProxyEndpointStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBProxyEndpointStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested operation can't be performed while the proxy is in this state. +type InvalidDBProxyStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBProxyStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBProxyStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBProxyStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBProxyStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBProxyStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The state of the DB security group doesn't allow deletion. +type InvalidDBSecurityGroupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBSecurityGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBSecurityGroupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBSecurityGroupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBSecurityGroupState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBSecurityGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB shard group must be in the available state. +type InvalidDBShardGroupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBShardGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBShardGroupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBShardGroupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBShardGroupState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBShardGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The state of the DB snapshot doesn't allow deletion. +type InvalidDBSnapshotStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBSnapshotStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBSnapshotStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBSnapshotStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBSnapshotState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBSnapshotStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DBSubnetGroup doesn't belong to the same VPC as that of an existing +// cross-region read replica of the same source instance. +type InvalidDBSubnetGroupFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBSubnetGroupFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBSubnetGroupFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBSubnetGroupFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBSubnetGroupFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBSubnetGroupFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB subnet group cannot be deleted because it's in use. +type InvalidDBSubnetGroupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBSubnetGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBSubnetGroupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBSubnetGroupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBSubnetGroupStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBSubnetGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB subnet isn't in the available state. +type InvalidDBSubnetStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidDBSubnetStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidDBSubnetStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidDBSubnetStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidDBSubnetStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidDBSubnetStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// This error can occur if someone else is modifying a subscription. You should +// retry the action. +type InvalidEventSubscriptionStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidEventSubscriptionStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidEventSubscriptionStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidEventSubscriptionStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidEventSubscriptionState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidEventSubscriptionStateFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The export is invalid for exporting to an Amazon S3 bucket. +type InvalidExportOnlyFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidExportOnlyFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidExportOnlyFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidExportOnlyFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidExportOnly" + } + return *e.ErrorCodeOverride +} +func (e *InvalidExportOnlyFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The state of the export snapshot is invalid for exporting to an Amazon S3 +// bucket. +type InvalidExportSourceStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidExportSourceStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidExportSourceStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidExportSourceStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidExportSourceState" + } + return *e.ErrorCodeOverride +} +func (e *InvalidExportSourceStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You can't cancel an export task that has completed. +type InvalidExportTaskStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidExportTaskStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidExportTaskStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidExportTaskStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidExportTaskStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidExportTaskStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The global cluster is in an invalid state and can't perform the requested +// operation. +type InvalidGlobalClusterStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidGlobalClusterStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidGlobalClusterStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidGlobalClusterStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidGlobalClusterStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidGlobalClusterStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The integration is in an invalid state and can't perform the requested +// operation. +type InvalidIntegrationStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidIntegrationStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidIntegrationStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidIntegrationStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidIntegrationStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidIntegrationStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The option group isn't in the available state. +type InvalidOptionGroupStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidOptionGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidOptionGroupStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidOptionGroupStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidOptionGroupStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidOptionGroupStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The operation can't be performed because another operation is in progress. +type InvalidResourceStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidResourceStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidResourceStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidResourceStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidResourceStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidResourceStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Cannot restore from VPC backup to non-VPC DB instance. +type InvalidRestoreFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRestoreFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRestoreFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRestoreFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRestoreFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRestoreFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified Amazon S3 bucket name can't be found or Amazon RDS isn't +// authorized to access the specified Amazon S3 bucket. Verify the +// SourceS3BucketName and S3IngestionRoleArn values and try again. +type InvalidS3BucketFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidS3BucketFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidS3BucketFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidS3BucketFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidS3BucketFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidS3BucketFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested subnet is invalid, or multiple subnets were requested that are +// not all in a common VPC. +type InvalidSubnet struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidSubnet) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSubnet) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSubnet) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidSubnet" + } + return *e.ErrorCodeOverride +} +func (e *InvalidSubnet) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB subnet group doesn't cover all Availability Zones after it's created +// because of users' change. +type InvalidVPCNetworkStateFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidVPCNetworkStateFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidVPCNetworkStateFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidVPCNetworkStateFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidVPCNetworkStateFault" + } + return *e.ErrorCodeOverride +} +func (e *InvalidVPCNetworkStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An error occurred accessing an Amazon Web Services KMS key. +type KMSKeyNotAccessibleFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *KMSKeyNotAccessibleFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KMSKeyNotAccessibleFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KMSKeyNotAccessibleFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "KMSKeyNotAccessibleFault" + } + return *e.ErrorCodeOverride +} +func (e *KMSKeyNotAccessibleFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The maximum number of DB shard groups for your Amazon Web Services account in +// the specified Amazon Web Services Region has been reached. +type MaxDBShardGroupLimitReached struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MaxDBShardGroupLimitReached) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MaxDBShardGroupLimitReached) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MaxDBShardGroupLimitReached) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MaxDBShardGroupLimitReached" + } + return *e.ErrorCodeOverride +} +func (e *MaxDBShardGroupLimitReached) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The network type is invalid for the DB instance. Valid nework type values are +// IPV4 and DUAL . +type NetworkTypeNotSupported struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *NetworkTypeNotSupported) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NetworkTypeNotSupported) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NetworkTypeNotSupported) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "NetworkTypeNotSupported" + } + return *e.ErrorCodeOverride +} +func (e *NetworkTypeNotSupported) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The option group you are trying to create already exists. +type OptionGroupAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OptionGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OptionGroupAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OptionGroupAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OptionGroupAlreadyExistsFault" + } + return *e.ErrorCodeOverride +} +func (e *OptionGroupAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified option group could not be found. +type OptionGroupNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OptionGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OptionGroupNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OptionGroupNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OptionGroupNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *OptionGroupNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The quota of 20 option groups was exceeded for this Amazon Web Services account. +type OptionGroupQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OptionGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OptionGroupQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OptionGroupQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OptionGroupQuotaExceededFault" + } + return *e.ErrorCodeOverride +} +func (e *OptionGroupQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// SourceDBInstanceIdentifier refers to a DB instance with BackupRetentionPeriod +// equal to 0. +type PointInTimeRestoreNotEnabledFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PointInTimeRestoreNotEnabledFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PointInTimeRestoreNotEnabledFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PointInTimeRestoreNotEnabledFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PointInTimeRestoreNotEnabled" + } + return *e.ErrorCodeOverride +} +func (e *PointInTimeRestoreNotEnabledFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Provisioned IOPS not available in the specified Availability Zone. +type ProvisionedIopsNotAvailableInAZFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ProvisionedIopsNotAvailableInAZFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ProvisionedIopsNotAvailableInAZFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ProvisionedIopsNotAvailableInAZFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ProvisionedIopsNotAvailableInAZFault" + } + return *e.ErrorCodeOverride +} +func (e *ProvisionedIopsNotAvailableInAZFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// User already has a reservation with the given identifier. +type ReservedDBInstanceAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ReservedDBInstanceAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ReservedDBInstanceAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ReservedDBInstanceAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ReservedDBInstanceAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *ReservedDBInstanceAlreadyExistsFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified reserved DB Instance not found. +type ReservedDBInstanceNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ReservedDBInstanceNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ReservedDBInstanceNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ReservedDBInstanceNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ReservedDBInstanceNotFound" + } + return *e.ErrorCodeOverride +} +func (e *ReservedDBInstanceNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request would exceed the user's DB Instance quota. +type ReservedDBInstanceQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ReservedDBInstanceQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ReservedDBInstanceQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ReservedDBInstanceQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ReservedDBInstanceQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *ReservedDBInstanceQuotaExceededFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// Specified offering does not exist. +type ReservedDBInstancesOfferingNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ReservedDBInstancesOfferingNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ReservedDBInstancesOfferingNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ReservedDBInstancesOfferingNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ReservedDBInstancesOfferingNotFound" + } + return *e.ErrorCodeOverride +} +func (e *ReservedDBInstancesOfferingNotFoundFault) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The specified resource ID was not found. +type ResourceNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundFault" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You have exceeded the maximum number of accounts that you can share a manual DB +// snapshot with. +type SharedSnapshotQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SharedSnapshotQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SharedSnapshotQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SharedSnapshotQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SharedSnapshotQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *SharedSnapshotQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed number of DB +// snapshots. +type SnapshotQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SnapshotQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SnapshotQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SnapshotQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SnapshotQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *SnapshotQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// SNS has responded that there is a problem with the SNS topic specified. +type SNSInvalidTopicFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SNSInvalidTopicFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SNSInvalidTopicFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SNSInvalidTopicFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SNSInvalidTopic" + } + return *e.ErrorCodeOverride +} +func (e *SNSInvalidTopicFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You do not have permission to publish to the SNS topic ARN. +type SNSNoAuthorizationFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SNSNoAuthorizationFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SNSNoAuthorizationFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SNSNoAuthorizationFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SNSNoAuthorization" + } + return *e.ErrorCodeOverride +} +func (e *SNSNoAuthorizationFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The SNS topic ARN does not exist. +type SNSTopicArnNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SNSTopicArnNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SNSTopicArnNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SNSTopicArnNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SNSTopicArnNotFound" + } + return *e.ErrorCodeOverride +} +func (e *SNSTopicArnNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The source DB cluster isn't supported for a blue/green deployment. +type SourceClusterNotSupportedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SourceClusterNotSupportedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SourceClusterNotSupportedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SourceClusterNotSupportedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SourceClusterNotSupportedFault" + } + return *e.ErrorCodeOverride +} +func (e *SourceClusterNotSupportedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The source DB instance isn't supported for a blue/green deployment. +type SourceDatabaseNotSupportedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SourceDatabaseNotSupportedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SourceDatabaseNotSupportedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SourceDatabaseNotSupportedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SourceDatabaseNotSupportedFault" + } + return *e.ErrorCodeOverride +} +func (e *SourceDatabaseNotSupportedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested source could not be found. +type SourceNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SourceNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SourceNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SourceNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SourceNotFound" + } + return *e.ErrorCodeOverride +} +func (e *SourceNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request would result in the user exceeding the allowed amount of storage +// available across all DB instances. +type StorageQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *StorageQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *StorageQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *StorageQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "StorageQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *StorageQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The aurora-iopt1 storage type isn't available, because you modified the DB +// cluster to use this storage type less than one month ago. +type StorageTypeNotAvailableFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *StorageTypeNotAvailableFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *StorageTypeNotAvailableFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *StorageTypeNotAvailableFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "StorageTypeNotAvailableFault" + } + return *e.ErrorCodeOverride +} +func (e *StorageTypeNotAvailableFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified StorageType can't be associated with the DB instance. +type StorageTypeNotSupportedFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *StorageTypeNotSupportedFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *StorageTypeNotSupportedFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *StorageTypeNotSupportedFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "StorageTypeNotSupported" + } + return *e.ErrorCodeOverride +} +func (e *StorageTypeNotSupportedFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The DB subnet is already in use in the Availability Zone. +type SubnetAlreadyInUse struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SubnetAlreadyInUse) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SubnetAlreadyInUse) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SubnetAlreadyInUse) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SubnetAlreadyInUse" + } + return *e.ErrorCodeOverride +} +func (e *SubnetAlreadyInUse) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The supplied subscription name already exists. +type SubscriptionAlreadyExistFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SubscriptionAlreadyExistFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SubscriptionAlreadyExistFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SubscriptionAlreadyExistFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SubscriptionAlreadyExist" + } + return *e.ErrorCodeOverride +} +func (e *SubscriptionAlreadyExistFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The supplied category does not exist. +type SubscriptionCategoryNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SubscriptionCategoryNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SubscriptionCategoryNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SubscriptionCategoryNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SubscriptionCategoryNotFound" + } + return *e.ErrorCodeOverride +} +func (e *SubscriptionCategoryNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The subscription name does not exist. +type SubscriptionNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SubscriptionNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SubscriptionNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SubscriptionNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SubscriptionNotFound" + } + return *e.ErrorCodeOverride +} +func (e *SubscriptionNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You attempted to either create a tenant database that already exists or modify +// a tenant database to use the name of an existing tenant database. +type TenantDatabaseAlreadyExistsFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TenantDatabaseAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TenantDatabaseAlreadyExistsFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TenantDatabaseAlreadyExistsFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TenantDatabaseAlreadyExists" + } + return *e.ErrorCodeOverride +} +func (e *TenantDatabaseAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified tenant database wasn't found in the DB instance. +type TenantDatabaseNotFoundFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TenantDatabaseNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TenantDatabaseNotFoundFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TenantDatabaseNotFoundFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TenantDatabaseNotFound" + } + return *e.ErrorCodeOverride +} +func (e *TenantDatabaseNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You attempted to create more tenant databases than are permitted in your Amazon +// Web Services account. +type TenantDatabaseQuotaExceededFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TenantDatabaseQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TenantDatabaseQuotaExceededFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TenantDatabaseQuotaExceededFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TenantDatabaseQuotaExceeded" + } + return *e.ErrorCodeOverride +} +func (e *TenantDatabaseQuotaExceededFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified DB engine version isn't supported for Aurora Limitless Database. +type UnsupportedDBEngineVersionFault struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedDBEngineVersionFault) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedDBEngineVersionFault) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedDBEngineVersionFault) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedDBEngineVersion" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedDBEngineVersionFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/types.go new file mode 100644 index 00000000..d03dd191 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/types/types.go @@ -0,0 +1,5385 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Describes a quota for an Amazon Web Services account. +// +// The following are account quotas: +// +// - AllocatedStorage - The total allocated storage per account, in GiB. The used +// value is the total allocated storage in the account, in GiB. +// +// - AuthorizationsPerDBSecurityGroup - The number of ingress rules per DB +// security group. The used value is the highest number of ingress rules in a DB +// security group in the account. Other DB security groups in the account might +// have a lower number of ingress rules. +// +// - CustomEndpointsPerDBCluster - The number of custom endpoints per DB cluster. +// The used value is the highest number of custom endpoints in a DB clusters in the +// account. Other DB clusters in the account might have a lower number of custom +// endpoints. +// +// - DBClusterParameterGroups - The number of DB cluster parameter groups per +// account, excluding default parameter groups. The used value is the count of +// nondefault DB cluster parameter groups in the account. +// +// - DBClusterRoles - The number of associated Amazon Web Services Identity and +// Access Management (IAM) roles per DB cluster. The used value is the highest +// number of associated IAM roles for a DB cluster in the account. Other DB +// clusters in the account might have a lower number of associated IAM roles. +// +// - DBClusters - The number of DB clusters per account. The used value is the +// count of DB clusters in the account. +// +// - DBInstanceRoles - The number of associated IAM roles per DB instance. The +// used value is the highest number of associated IAM roles for a DB instance in +// the account. Other DB instances in the account might have a lower number of +// associated IAM roles. +// +// - DBInstances - The number of DB instances per account. The used value is the +// count of the DB instances in the account. +// +// Amazon RDS DB instances, Amazon Aurora DB instances, Amazon Neptune instances, +// +// and Amazon DocumentDB instances apply to this quota. +// +// - DBParameterGroups - The number of DB parameter groups per account, excluding +// default parameter groups. The used value is the count of nondefault DB parameter +// groups in the account. +// +// - DBSecurityGroups - The number of DB security groups (not VPC security +// groups) per account, excluding the default security group. The used value is the +// count of nondefault DB security groups in the account. +// +// - DBSubnetGroups - The number of DB subnet groups per account. The used value +// is the count of the DB subnet groups in the account. +// +// - EventSubscriptions - The number of event subscriptions per account. The used +// value is the count of the event subscriptions in the account. +// +// - ManualClusterSnapshots - The number of manual DB cluster snapshots per +// account. The used value is the count of the manual DB cluster snapshots in the +// account. +// +// - ManualSnapshots - The number of manual DB instance snapshots per account. +// The used value is the count of the manual DB instance snapshots in the account. +// +// - OptionGroups - The number of DB option groups per account, excluding default +// option groups. The used value is the count of nondefault DB option groups in the +// account. +// +// - ReadReplicasPerMaster - The number of read replicas per DB instance. The +// used value is the highest number of read replicas for a DB instance in the +// account. Other DB instances in the account might have a lower number of read +// replicas. +// +// - ReservedDBInstances - The number of reserved DB instances per account. The +// used value is the count of the active reserved DB instances in the account. +// +// - SubnetsPerDBSubnetGroup - The number of subnets per DB subnet group. The +// used value is highest number of subnets for a DB subnet group in the account. +// Other DB subnet groups in the account might have a lower number of subnets. +// +// For more information, see [Quotas for Amazon RDS] in the Amazon RDS User Guide and [Quotas for Amazon Aurora] in the Amazon +// Aurora User Guide. +// +// [Quotas for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html +// [Quotas for Amazon Aurora]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_Limits.html +type AccountQuota struct { + + // The name of the Amazon RDS quota for this Amazon Web Services account. + AccountQuotaName *string + + // The maximum allowed value for the quota. + Max *int64 + + // The amount currently used toward the quota maximum. + Used *int64 + + noSmithyDocumentSerde +} + +// Contains Availability Zone information. +// +// This data type is used as an element in the OrderableDBInstanceOption data type. +type AvailabilityZone struct { + + // The name of the Availability Zone. + Name *string + + noSmithyDocumentSerde +} + +// Contains the available processor feature information for the DB instance class +// of a DB instance. +// +// For more information, see [Configuring the Processor of the DB Instance Class] in the Amazon RDS User Guide. +// +// [Configuring the Processor of the DB Instance Class]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor +type AvailableProcessorFeature struct { + + // The allowed values for the processor feature of the DB instance class. + AllowedValues *string + + // The default value for the processor feature of the DB instance class. + DefaultValue *string + + // The name of the processor feature. Valid names are coreCount and threadsPerCore . + Name *string + + noSmithyDocumentSerde +} + +// Details about a blue/green deployment. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +type BlueGreenDeployment struct { + + // The unique identifier of the blue/green deployment. + BlueGreenDeploymentIdentifier *string + + // The user-supplied name of the blue/green deployment. + BlueGreenDeploymentName *string + + // The time when the blue/green deployment was created, in Universal Coordinated + // Time (UTC). + CreateTime *time.Time + + // The time when the blue/green deployment was deleted, in Universal Coordinated + // Time (UTC). + DeleteTime *time.Time + + // The source database for the blue/green deployment. + // + // Before switchover, the source database is the production database in the blue + // environment. + Source *string + + // The status of the blue/green deployment. + // + // Valid Values: + // + // - PROVISIONING - Resources are being created in the green environment. + // + // - AVAILABLE - Resources are available in the green environment. + // + // - SWITCHOVER_IN_PROGRESS - The deployment is being switched from the blue + // environment to the green environment. + // + // - SWITCHOVER_COMPLETED - Switchover from the blue environment to the green + // environment is complete. + // + // - INVALID_CONFIGURATION - Resources in the green environment are invalid, so + // switchover isn't possible. + // + // - SWITCHOVER_FAILED - Switchover was attempted but failed. + // + // - DELETING - The blue/green deployment is being deleted. + Status *string + + // Additional information about the status of the blue/green deployment. + StatusDetails *string + + // The details about each source and target resource in the blue/green deployment. + SwitchoverDetails []SwitchoverDetail + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The target database for the blue/green deployment. + // + // Before switchover, the target database is the clone database in the green + // environment. + Target *string + + // Either tasks to be performed or tasks that have been completed on the target + // database before switchover. + Tasks []BlueGreenDeploymentTask + + noSmithyDocumentSerde +} + +// Details about a task for a blue/green deployment. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +type BlueGreenDeploymentTask struct { + + // The name of the blue/green deployment task. + Name *string + + // The status of the blue/green deployment task. + // + // Valid Values: + // + // - PENDING - The resource is being prepared for deployment. + // + // - IN_PROGRESS - The resource is being deployed. + // + // - COMPLETED - The resource has been deployed. + // + // - FAILED - Deployment of the resource failed. + Status *string + + noSmithyDocumentSerde +} + +// A CA certificate for an Amazon Web Services account. +// +// For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon +// Aurora User Guide. +// +// [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html +// [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html +type Certificate struct { + + // The Amazon Resource Name (ARN) for the certificate. + CertificateArn *string + + // The unique key that identifies a certificate. + CertificateIdentifier *string + + // The type of the certificate. + CertificateType *string + + // Indicates whether there is an override for the default certificate identifier. + CustomerOverride *bool + + // If there is an override for the default certificate identifier, when the + // override expires. + CustomerOverrideValidTill *time.Time + + // The thumbprint of the certificate. + Thumbprint *string + + // The starting date from which the certificate is valid. + ValidFrom *time.Time + + // The final date that the certificate continues to be valid. + ValidTill *time.Time + + noSmithyDocumentSerde +} + +// The details of the DB instance’s server certificate. +// +// For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon +// Aurora User Guide. +// +// [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html +// [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html +type CertificateDetails struct { + + // The CA identifier of the CA certificate used for the DB instance's server + // certificate. + CAIdentifier *string + + // The expiration date of the DB instance’s server certificate. + ValidTill *time.Time + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the action +// DescribeDBEngineVersions . +type CharacterSet struct { + + // The description of the character set. + CharacterSetDescription *string + + // The name of the character set. + CharacterSetName *string + + noSmithyDocumentSerde +} + +// The configuration setting for the log types to be enabled for export to +// CloudWatch Logs for a specific DB instance or DB cluster. +// +// The EnableLogTypes and DisableLogTypes arrays determine which logs will be +// exported (or not exported) to CloudWatch Logs. The values within these arrays +// depend on the DB engine being used. +// +// For more information about exporting CloudWatch Logs for Amazon RDS DB +// instances, see [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon RDS User Guide. +// +// For more information about exporting CloudWatch Logs for Amazon Aurora DB +// clusters, see [Publishing Database Logs to Amazon CloudWatch Logs]in the Amazon Aurora User Guide. +// +// [Publishing Database Logs to Amazon CloudWatch Logs]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch +type CloudwatchLogsExportConfiguration struct { + + // The list of log types to disable. + // + // The following values are valid for each DB engine: + // + // - Aurora MySQL - audit | error | general | slowquery + // + // - Aurora PostgreSQL - postgresql + // + // - RDS for MySQL - error | general | slowquery + // + // - RDS for PostgreSQL - postgresql | upgrade + DisableLogTypes []string + + // The list of log types to enable. + // + // The following values are valid for each DB engine: + // + // - Aurora MySQL - audit | error | general | slowquery + // + // - Aurora PostgreSQL - postgresql + // + // - RDS for MySQL - error | general | slowquery + // + // - RDS for PostgreSQL - postgresql | upgrade + EnableLogTypes []string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the ModifyDBCluster operation +// and contains changes that will be applied during the next maintenance window. +type ClusterPendingModifiedValues struct { + + // The allocated storage size in gibibytes (GiB) for all database engines except + // Amazon Aurora. For Aurora, AllocatedStorage always returns 1, because Aurora DB + // cluster storage size isn't fixed, but instead automatically adjusts as needed. + AllocatedStorage *int32 + + // The number of days for which automatic DB snapshots are retained. + BackupRetentionPeriod *int32 + + // The details of the DB instance’s server certificate. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CertificateDetails *CertificateDetails + + // The DBClusterIdentifier value for the DB cluster. + DBClusterIdentifier *string + + // The database engine version. + EngineVersion *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The Provisioned IOPS (I/O operations per second) value. This setting is only + // for non-Aurora Multi-AZ DB clusters. + Iops *int32 + + // The master credentials for the DB cluster. + MasterUserPassword *string + + // A list of the log types whose configuration is still pending. In other words, + // these log types are in the process of being activated or deactivated. + PendingCloudwatchLogsExports *PendingCloudwatchLogsExports + + // Reserved for future use. + RdsCustomClusterConfiguration *RdsCustomClusterConfiguration + + // The storage type for the DB cluster. + StorageType *string + + noSmithyDocumentSerde +} + +// Specifies the settings that control the size and behavior of the connection +// pool associated with a DBProxyTargetGroup . +type ConnectionPoolConfiguration struct { + + // The number of seconds for a proxy to wait for a connection to become available + // in the connection pool. This setting only applies when the proxy has opened its + // maximum number of connections and all connections are busy with client sessions. + // + // Default: 120 + // + // Constraints: + // + // - Must be between 0 and 3600. + ConnectionBorrowTimeout *int32 + + // One or more SQL statements for the proxy to run when opening each new database + // connection. Typically used with SET statements to make sure that each + // connection has identical settings such as time zone and character set. For + // multiple statements, use semicolons as the separator. You can also include + // multiple variables in a single SET statement, such as SET x=1, y=2 . + // + // Default: no initialization query + InitQuery *string + + // The maximum size of the connection pool for each target in a target group. The + // value is expressed as a percentage of the max_connections setting for the RDS + // DB instance or Aurora DB cluster used by the target group. + // + // If you specify MaxIdleConnectionsPercent , then you must also include a value + // for this parameter. + // + // Default: 10 for RDS for Microsoft SQL Server, and 100 for all other engines + // + // Constraints: + // + // - Must be between 1 and 100. + MaxConnectionsPercent *int32 + + // A value that controls how actively the proxy closes idle database connections + // in the connection pool. The value is expressed as a percentage of the + // max_connections setting for the RDS DB instance or Aurora DB cluster used by the + // target group. With a high value, the proxy leaves a high percentage of idle + // database connections open. A low value causes the proxy to close more idle + // connections and return them to the database. + // + // If you specify this parameter, then you must also include a value for + // MaxConnectionsPercent . + // + // Default: The default value is half of the value of MaxConnectionsPercent . For + // example, if MaxConnectionsPercent is 80, then the default value of + // MaxIdleConnectionsPercent is 40. If the value of MaxConnectionsPercent isn't + // specified, then for SQL Server, MaxIdleConnectionsPercent is 5 , and for all + // other engines, the default is 50 . + // + // Constraints: + // + // - Must be between 0 and the value of MaxConnectionsPercent . + MaxIdleConnectionsPercent *int32 + + // Each item in the list represents a class of SQL operations that normally cause + // all later statements in a session using a proxy to be pinned to the same + // underlying database connection. Including an item in the list exempts that class + // of SQL operations from the pinning behavior. + // + // Default: no session pinning filters + SessionPinningFilters []string + + noSmithyDocumentSerde +} + +// Displays the settings that control the size and behavior of the connection pool +// associated with a DBProxyTarget . +type ConnectionPoolConfigurationInfo struct { + + // The number of seconds for a proxy to wait for a connection to become available + // in the connection pool. Only applies when the proxy has opened its maximum + // number of connections and all connections are busy with client sessions. + ConnectionBorrowTimeout *int32 + + // One or more SQL statements for the proxy to run when opening each new database + // connection. Typically used with SET statements to make sure that each + // connection has identical settings such as time zone and character set. This + // setting is empty by default. For multiple statements, use semicolons as the + // separator. You can also include multiple variables in a single SET statement, + // such as SET x=1, y=2 . + InitQuery *string + + // The maximum size of the connection pool for each target in a target group. The + // value is expressed as a percentage of the max_connections setting for the RDS + // DB instance or Aurora DB cluster used by the target group. + MaxConnectionsPercent *int32 + + // Controls how actively the proxy closes idle database connections in the + // connection pool. The value is expressed as a percentage of the max_connections + // setting for the RDS DB instance or Aurora DB cluster used by the target group. + // With a high value, the proxy leaves a high percentage of idle database + // connections open. A low value causes the proxy to close more idle connections + // and return them to the database. + MaxIdleConnectionsPercent *int32 + + // Each item in the list represents a class of SQL operations that normally cause + // all later statements in a session using a proxy to be pinned to the same + // underlying database connection. Including an item in the list exempts that class + // of SQL operations from the pinning behavior. This setting is only supported for + // MySQL engine family databases. Currently, the only allowed value is + // EXCLUDE_VARIABLE_SETS . + SessionPinningFilters []string + + noSmithyDocumentSerde +} + +// The additional attributes of RecommendedAction data type. +type ContextAttribute struct { + + // The key of ContextAttribute . + Key *string + + // The value of ContextAttribute . + Value *string + + noSmithyDocumentSerde +} + +// A value that indicates the AMI information. +type CustomDBEngineVersionAMI struct { + + // A value that indicates the ID of the AMI. + ImageId *string + + // A value that indicates the status of a custom engine version (CEV). + Status *string + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon Aurora DB cluster or Multi-AZ DB cluster. +// +// For an Amazon Aurora DB cluster, this data type is used as a response element +// in the operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , +// FailoverDBCluster , ModifyDBCluster , PromoteReadReplicaDBCluster , +// RestoreDBClusterFromS3 , RestoreDBClusterFromSnapshot , +// RestoreDBClusterToPointInTime , StartDBCluster , and StopDBCluster . +// +// For a Multi-AZ DB cluster, this data type is used as a response element in the +// operations CreateDBCluster , DeleteDBCluster , DescribeDBClusters , +// FailoverDBCluster , ModifyDBCluster , RebootDBCluster , +// RestoreDBClusterFromSnapshot , and RestoreDBClusterToPointInTime . +// +// For more information on Amazon Aurora DB clusters, see [What is Amazon Aurora?] in the Amazon Aurora +// User Guide. +// +// For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User +// Guide. +// +// [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html +// [What is Amazon Aurora?]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html +type DBCluster struct { + + // The name of the Amazon Kinesis data stream used for the database activity + // stream. + ActivityStreamKinesisStreamName *string + + // The Amazon Web Services KMS key identifier used for encrypting messages in the + // database activity stream. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + ActivityStreamKmsKeyId *string + + // The mode of the database activity stream. Database events such as a change or + // access generate an activity stream event. The database session can handle these + // events either synchronously or asynchronously. + ActivityStreamMode ActivityStreamMode + + // The status of the database activity stream. + ActivityStreamStatus ActivityStreamStatus + + // For all database engines except Amazon Aurora, AllocatedStorage specifies the + // allocated storage size in gibibytes (GiB). For Aurora, AllocatedStorage always + // returns 1, because Aurora DB cluster storage size isn't fixed, but instead + // automatically adjusts as needed. + AllocatedStorage *int32 + + // A list of the Amazon Web Services Identity and Access Management (IAM) roles + // that are associated with the DB cluster. IAM roles that are associated with a DB + // cluster grant permission for the DB cluster to access other Amazon Web Services + // on your behalf. + AssociatedRoles []DBClusterRole + + // Indicates whether minor version patches are applied automatically. + // + // This setting is for Aurora DB clusters and Multi-AZ DB clusters. + AutoMinorVersionUpgrade *bool + + // The time when a stopped DB cluster is restarted automatically. + AutomaticRestartTime *time.Time + + // The list of Availability Zones (AZs) where instances in the DB cluster can be + // created. + AvailabilityZones []string + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + AwsBackupRecoveryPointArn *string + + // The number of change records stored for Backtrack. + BacktrackConsumedChangeRecords *int64 + + // The target backtrack window, in seconds. If this value is set to 0 , + // backtracking is disabled for the DB cluster. Otherwise, backtracking is enabled. + BacktrackWindow *int64 + + // The number of days for which automatic DB snapshots are retained. + BackupRetentionPeriod *int32 + + // The current capacity of an Aurora Serverless v1 DB cluster. The capacity is 0 + // (zero) when the cluster is paused. + // + // For more information about Aurora Serverless v1, see [Using Amazon Aurora Serverless v1] in the Amazon Aurora User + // Guide. + // + // [Using Amazon Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html + Capacity *int32 + + // The details of the DB instance’s server certificate. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CertificateDetails *CertificateDetails + + // If present, specifies the name of the character set that this cluster is + // associated with. + CharacterSetName *string + + // The ID of the clone group with which the DB cluster is associated. + CloneGroupId *string + + // The time when the DB cluster was created, in Universal Coordinated Time (UTC). + ClusterCreateTime *time.Time + + // The scalability mode of the Aurora DB cluster. When set to limitless , the + // cluster operates as an Aurora Limitless Database. When set to standard (the + // default), the cluster uses normal DB instance creation. + ClusterScalabilityType ClusterScalabilityType + + // Indicates whether tags are copied from the DB cluster to snapshots of the DB + // cluster. + CopyTagsToSnapshot *bool + + // Indicates whether the DB cluster is a clone of a DB cluster owned by a + // different Amazon Web Services account. + CrossAccountClone *bool + + // The custom endpoints associated with the DB cluster. + CustomEndpoints []string + + // The Amazon Resource Name (ARN) for the DB cluster. + DBClusterArn *string + + // The user-supplied identifier for the DB cluster. This identifier is the unique + // key that identifies a DB cluster. + DBClusterIdentifier *string + + // The name of the compute and memory capacity class of the DB instance. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + DBClusterInstanceClass *string + + // The list of DB instances that make up the DB cluster. + DBClusterMembers []DBClusterMember + + // The list of option group memberships for this DB cluster. + DBClusterOptionGroupMemberships []DBClusterOptionGroupStatus + + // The name of the DB cluster parameter group for the DB cluster. + DBClusterParameterGroup *string + + // Information about the subnet group associated with the DB cluster, including + // the name, description, and subnets in the subnet group. + DBSubnetGroup *string + + // Reserved for future use. + DBSystemId *string + + // The mode of Database Insights that is enabled for the DB cluster. + DatabaseInsightsMode DatabaseInsightsMode + + // The name of the initial database that was specified for the DB cluster when it + // was created, if one was provided. This same name is returned for the life of the + // DB cluster. + DatabaseName *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB cluster. + // This identifier is found in Amazon Web Services CloudTrail log entries whenever + // the KMS key for the DB cluster is accessed. + DbClusterResourceId *string + + // Indicates whether the DB cluster has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. + DeletionProtection *bool + + // The Active Directory Domain membership records associated with the DB cluster. + DomainMemberships []DomainMembership + + // The earliest time to which a DB cluster can be backtracked. + EarliestBacktrackTime *time.Time + + // The earliest time to which a database can be restored with point-in-time + // restore. + EarliestRestorableTime *time.Time + + // A list of log types that this DB cluster is configured to export to CloudWatch + // Logs. + // + // Log types vary by DB engine. For information about the log types for each DB + // engine, see [Amazon RDS Database Log Files]in the Amazon Aurora User Guide. + // + // [Amazon RDS Database Log Files]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html + EnabledCloudwatchLogsExports []string + + // The connection endpoint for the primary instance of the DB cluster. + Endpoint *string + + // The database engine used for this DB cluster. + Engine *string + + // The life cycle type for the DB cluster. + // + // For more information, see CreateDBCluster. + EngineLifecycleSupport *string + + // The DB engine mode of the DB cluster, either provisioned or serverless . + // + // For more information, see [CreateDBCluster]. + // + // [CreateDBCluster]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBCluster.html + EngineMode *string + + // The version of the database engine. + EngineVersion *string + + // Indicates whether write forwarding is enabled for a secondary cluster in an + // Aurora global database. Because write forwarding takes time to enable, check the + // value of GlobalWriteForwardingStatus to confirm that the request has completed + // before using the write forwarding feature for this cluster. + GlobalWriteForwardingRequested *bool + + // The status of write forwarding for a secondary cluster in an Aurora global + // database. + GlobalWriteForwardingStatus WriteForwardingStatus + + // The ID that Amazon Route 53 assigns when you create a hosted zone. + HostedZoneId *string + + // Indicates whether the HTTP endpoint is enabled for an Aurora DB cluster. + // + // When enabled, the HTTP endpoint provides a connectionless web service API (RDS + // Data API) for running SQL queries on the DB cluster. You can also query your + // database from inside the RDS console with the RDS query editor. + // + // For more information, see [Using RDS Data API] in the Amazon Aurora User Guide. + // + // [Using RDS Data API]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html + HttpEndpointEnabled *bool + + // Indicates whether the mapping of Amazon Web Services Identity and Access + // Management (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The next time you can modify the DB cluster to use the aurora-iopt1 storage + // type. + // + // This setting is only for Aurora DB clusters. + IOOptimizedNextAllowedModificationTime *time.Time + + // The Provisioned IOPS (I/O operations per second) value. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + Iops *int32 + + // If StorageEncrypted is enabled, the Amazon Web Services KMS key identifier for + // the encrypted DB cluster. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The latest time to which a database can be restored with point-in-time restore. + LatestRestorableTime *time.Time + + // The details for Aurora Limitless Database. + LimitlessDatabase *LimitlessDatabase + + // Indicates whether an Aurora DB cluster has in-cluster write forwarding enabled, + // not enabled, requested, or is in the process of enabling it. + LocalWriteForwardingStatus LocalWriteForwardingStatus + + // The secret managed by RDS in Amazon Web Services Secrets Manager for the master + // user password. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon + // Aurora User Guide. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html + MasterUserSecret *MasterUserSecret + + // The master username for the DB cluster. + MasterUsername *string + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB cluster. + // + // This setting is only for -Aurora DB clusters and Multi-AZ DB clusters. + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics + // to Amazon CloudWatch Logs. + // + // This setting is only for Aurora DB clusters and Multi-AZ DB clusters. + MonitoringRoleArn *string + + // Indicates whether the DB cluster has instances in multiple Availability Zones. + MultiAZ *bool + + // The network type of the DB instance. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the + // IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon Aurora User Guide. + // + // This setting is only for Aurora DB clusters. + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // Information about pending changes to the DB cluster. This information is + // returned only when there are pending changes. Specific changes are identified by + // subelements. + PendingModifiedValues *ClusterPendingModifiedValues + + // The progress of the operation as a percentage. + PercentProgress *string + + // Indicates whether Performance Insights is enabled for the DB cluster. + // + // This setting is only for Aurora DB clusters and Multi-AZ DB clusters. + PerformanceInsightsEnabled *bool + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + // + // This setting is only for Aurora DB clusters and Multi-AZ DB clusters. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // This setting is only for Aurora DB clusters and Multi-AZ DB clusters. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + PerformanceInsightsRetentionPeriod *int32 + + // The port that the database engine is listening on. + Port *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, as determined by the BackupRetentionPeriod . + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur, in Universal + // Coordinated Time (UTC). + PreferredMaintenanceWindow *string + + // Indicates whether the DB cluster is publicly accessible. + // + // When the DB cluster is publicly accessible and you connect from outside of the + // DB cluster's virtual private cloud (VPC), its Domain Name System (DNS) endpoint + // resolves to the public IP address. When you connect from within the same VPC as + // the DB cluster, the endpoint resolves to the private IP address. Access to the + // DB cluster is ultimately controlled by the security group it uses. That public + // access isn't permitted if the security group assigned to the DB cluster doesn't + // permit it. + // + // When the DB cluster isn't publicly accessible, it is an internal DB cluster + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBCluster. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + PubliclyAccessible *bool + + // Reserved for future use. + RdsCustomClusterConfiguration *RdsCustomClusterConfiguration + + // Contains one or more identifiers of the read replicas associated with this DB + // cluster. + ReadReplicaIdentifiers []string + + // The reader endpoint for the DB cluster. The reader endpoint for a DB cluster + // load-balances connections across the Aurora Replicas that are available in a DB + // cluster. As clients request new connections to the reader endpoint, Aurora + // distributes the connection requests among the Aurora Replicas in the DB cluster. + // This functionality can help balance your read workload across multiple Aurora + // Replicas in your DB cluster. + // + // If a failover occurs, and the Aurora Replica that you are connected to is + // promoted to be the primary instance, your connection is dropped. To continue + // sending your read workload to other Aurora Replicas in the cluster, you can then + // reconnect to the reader endpoint. + ReaderEndpoint *string + + // The identifier of the source DB cluster if this DB cluster is a read replica. + ReplicationSourceIdentifier *string + + // The scaling configuration for an Aurora DB cluster in serverless DB engine mode. + // + // For more information, see [Using Amazon Aurora Serverless v1] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html + ScalingConfigurationInfo *ScalingConfigurationInfo + + // The scaling configuration for an Aurora Serverless v2 DB cluster. + // + // For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. + // + // [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html + ServerlessV2ScalingConfiguration *ServerlessV2ScalingConfigurationInfo + + // The current state of this DB cluster. + Status *string + + // Reserved for future use. + StatusInfos []DBClusterStatusInfo + + // Indicates whether the DB cluster is encrypted. + StorageEncrypted *bool + + // The storage throughput for the DB cluster. The throughput is automatically set + // based on the IOPS that you provision, and is not configurable. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + StorageThroughput *int32 + + // The storage type associated with the DB cluster. + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The list of VPC security groups that the DB cluster belongs to. + VpcSecurityGroups []VpcSecurityGroupMembership + + noSmithyDocumentSerde +} + +// An automated backup of a DB cluster. It consists of system backups, transaction +// logs, and the database cluster properties that existed at the time you deleted +// the source cluster. +type DBClusterAutomatedBackup struct { + + // For all database engines except Amazon Aurora, AllocatedStorage specifies the + // allocated storage size in gibibytes (GiB). For Aurora, AllocatedStorage always + // returns 1, because Aurora DB cluster storage size isn't fixed, but instead + // automatically adjusts as needed. + AllocatedStorage *int32 + + // The Availability Zones where instances in the DB cluster can be created. For + // information on Amazon Web Services Regions and Availability Zones, see [Regions and Availability Zones]. + // + // [Regions and Availability Zones]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html + AvailabilityZones []string + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + AwsBackupRecoveryPointArn *string + + // The retention period for the automated backups. + BackupRetentionPeriod *int32 + + // The time when the DB cluster was created, in Universal Coordinated Time (UTC). + ClusterCreateTime *time.Time + + // The Amazon Resource Name (ARN) for the source DB cluster. + DBClusterArn *string + + // The Amazon Resource Name (ARN) for the automated backups. + DBClusterAutomatedBackupsArn *string + + // The identifier for the source DB cluster, which can't be changed and which is + // unique to an Amazon Web Services Region. + DBClusterIdentifier *string + + // The resource ID for the source DB cluster, which can't be changed and which is + // unique to an Amazon Web Services Region. + DbClusterResourceId *string + + // The name of the database engine for this automated backup. + Engine *string + + // The engine mode of the database engine for the automated backup. + EngineMode *string + + // The version of the database engine for the automated backup. + EngineVersion *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The IOPS (I/O operations per second) value for the automated backup. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + Iops *int32 + + // The Amazon Web Services KMS key ID for an automated backup. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The license model information for this DB cluster automated backup. + LicenseModel *string + + // The master user name of the automated backup. + MasterUsername *string + + // The port number that the automated backup used for connections. + // + // Default: Inherits from the source DB cluster + // + // Valid Values: 1150-65535 + Port *int32 + + // The Amazon Web Services Region associated with the automated backup. + Region *string + + // Earliest and latest time an instance can be restored to: + RestoreWindow *RestoreWindow + + // A list of status information for an automated backup: + // + // - retained - Automated backups for deleted clusters. + Status *string + + // Indicates whether the source DB cluster is encrypted. + StorageEncrypted *bool + + // The storage throughput for the automated backup. The throughput is + // automatically set based on the IOPS that you provision, and is not configurable. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + StorageThroughput *int32 + + // The storage type associated with the DB cluster. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + StorageType *string + + // The VPC ID associated with the DB cluster. + VpcId *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the DescribeDBClusterBacktracks +// action. +type DBClusterBacktrack struct { + + // Contains the backtrack identifier. + BacktrackIdentifier *string + + // The timestamp of the time at which the backtrack was requested. + BacktrackRequestCreationTime *time.Time + + // The timestamp of the time to which the DB cluster was backtracked. + BacktrackTo *time.Time + + // The timestamp of the time from which the DB cluster was backtracked. + BacktrackedFrom *time.Time + + // Contains a user-supplied DB cluster identifier. This identifier is the unique + // key that identifies a DB cluster. + DBClusterIdentifier *string + + // The status of the backtrack. This property returns one of the following values: + // + // - applying - The backtrack is currently being applied to or rolled back from + // the DB cluster. + // + // - completed - The backtrack has successfully been applied to or rolled back + // from the DB cluster. + // + // - failed - An error occurred while the backtrack was applied to or rolled back + // from the DB cluster. + // + // - pending - The backtrack is currently pending application to or rollback from + // the DB cluster. + Status *string + + noSmithyDocumentSerde +} + +// This data type represents the information you need to connect to an Amazon +// Aurora DB cluster. This data type is used as a response element in the following +// actions: +// +// - CreateDBClusterEndpoint +// +// - DescribeDBClusterEndpoints +// +// - ModifyDBClusterEndpoint +// +// - DeleteDBClusterEndpoint +// +// For the data structure that represents Amazon RDS DB instance endpoints, see +// Endpoint . +type DBClusterEndpoint struct { + + // The type associated with a custom endpoint. One of: READER , WRITER , ANY . + CustomEndpointType *string + + // The Amazon Resource Name (ARN) for the endpoint. + DBClusterEndpointArn *string + + // The identifier associated with the endpoint. This parameter is stored as a + // lowercase string. + DBClusterEndpointIdentifier *string + + // A unique system-generated identifier for an endpoint. It remains the same for + // the whole life of the endpoint. + DBClusterEndpointResourceIdentifier *string + + // The DB cluster identifier of the DB cluster associated with the endpoint. This + // parameter is stored as a lowercase string. + DBClusterIdentifier *string + + // The DNS address of the endpoint. + Endpoint *string + + // The type of the endpoint. One of: READER , WRITER , CUSTOM . + EndpointType *string + + // List of DB instance identifiers that aren't part of the custom endpoint group. + // All other eligible instances are reachable through the custom endpoint. Only + // relevant if the list of static members is empty. + ExcludedMembers []string + + // List of DB instance identifiers that are part of the custom endpoint group. + StaticMembers []string + + // The current status of the endpoint. One of: creating , available , deleting , + // inactive , modifying . The inactive state applies to an endpoint that can't be + // used for a certain kind of cluster, such as a writer endpoint for a read-only + // secondary cluster in a global database. + Status *string + + noSmithyDocumentSerde +} + +// Contains information about an instance that is part of a DB cluster. +type DBClusterMember struct { + + // Specifies the status of the DB cluster parameter group for this member of the + // DB cluster. + DBClusterParameterGroupStatus *string + + // Specifies the instance identifier for this member of the DB cluster. + DBInstanceIdentifier *string + + // Indicates whether the cluster member is the primary DB instance for the DB + // cluster. + IsClusterWriter *bool + + // A value that specifies the order in which an Aurora Replica is promoted to the + // primary instance after a failure of the existing primary instance. For more + // information, see [Fault Tolerance for an Aurora DB Cluster]in the Amazon Aurora User Guide. + // + // [Fault Tolerance for an Aurora DB Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance + PromotionTier *int32 + + noSmithyDocumentSerde +} + +// Contains status information for a DB cluster option group. +type DBClusterOptionGroupStatus struct { + + // Specifies the name of the DB cluster option group. + DBClusterOptionGroupName *string + + // Specifies the status of the DB cluster option group. + Status *string + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon RDS DB cluster parameter group. +// +// This data type is used as a response element in the +// DescribeDBClusterParameterGroups action. +type DBClusterParameterGroup struct { + + // The Amazon Resource Name (ARN) for the DB cluster parameter group. + DBClusterParameterGroupArn *string + + // The name of the DB cluster parameter group. + DBClusterParameterGroupName *string + + // The name of the DB parameter group family that this DB cluster parameter group + // is compatible with. + DBParameterGroupFamily *string + + // Provides the customer-specified description for this DB cluster parameter group. + Description *string + + noSmithyDocumentSerde +} + +// Describes an Amazon Web Services Identity and Access Management (IAM) role that +// is associated with a DB cluster. +type DBClusterRole struct { + + // The name of the feature associated with the Amazon Web Services Identity and + // Access Management (IAM) role. For information about supported feature names, see + // DBEngineVersion. + FeatureName *string + + // The Amazon Resource Name (ARN) of the IAM role that is associated with the DB + // cluster. + RoleArn *string + + // Describes the state of association between the IAM role and the DB cluster. The + // Status property returns one of the following values: + // + // - ACTIVE - the IAM role ARN is associated with the DB cluster and can be used + // to access other Amazon Web Services on your behalf. + // + // - PENDING - the IAM role ARN is being associated with the DB cluster. + // + // - INVALID - the IAM role ARN is associated with the DB cluster, but the DB + // cluster is unable to assume the IAM role in order to access other Amazon Web + // Services on your behalf. + Status *string + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB cluster snapshot +// +// This data type is used as a response element in the DescribeDBClusterSnapshots +// action. +type DBClusterSnapshot struct { + + // The allocated storage size of the DB cluster snapshot in gibibytes (GiB). + AllocatedStorage *int32 + + // The list of Availability Zones (AZs) where instances in the DB cluster snapshot + // can be restored. + AvailabilityZones []string + + // The time when the DB cluster was created, in Universal Coordinated Time (UTC). + ClusterCreateTime *time.Time + + // The DB cluster identifier of the DB cluster that this DB cluster snapshot was + // created from. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB cluster snapshot. + DBClusterSnapshotArn *string + + // The identifier for the DB cluster snapshot. + DBClusterSnapshotIdentifier *string + + // Reserved for future use. + DBSystemId *string + + // The resource ID of the DB cluster that this DB cluster snapshot was created + // from. + DbClusterResourceId *string + + // The name of the database engine for this DB cluster snapshot. + Engine *string + + // The engine mode of the database engine for this DB cluster snapshot. + EngineMode *string + + // The version of the database engine for this DB cluster snapshot. + EngineVersion *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // If StorageEncrypted is true, the Amazon Web Services KMS key identifier for the + // encrypted DB cluster snapshot. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The license model information for this DB cluster snapshot. + LicenseModel *string + + // The master username for this DB cluster snapshot. + MasterUsername *string + + // The percentage of the estimated data that has been transferred. + PercentProgress *int32 + + // The port that the DB cluster was listening on at the time of the snapshot. + Port *int32 + + // The time when the snapshot was taken, in Universal Coordinated Time (UTC). + SnapshotCreateTime *time.Time + + // The type of the DB cluster snapshot. + SnapshotType *string + + // If the DB cluster snapshot was copied from a source DB cluster snapshot, the + // Amazon Resource Name (ARN) for the source DB cluster snapshot, otherwise, a null + // value. + SourceDBClusterSnapshotArn *string + + // The status of this DB cluster snapshot. Valid statuses are the following: + // + // - available + // + // - copying + // + // - creating + Status *string + + // Indicates whether the DB cluster snapshot is encrypted. + StorageEncrypted *bool + + // The storage throughput for the DB cluster snapshot. The throughput is + // automatically set based on the IOPS that you provision, and is not configurable. + // + // This setting is only for non-Aurora Multi-AZ DB clusters. + StorageThroughput *int32 + + // The storage type associated with the DB cluster snapshot. + // + // This setting is only for Aurora DB clusters. + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The VPC ID associated with the DB cluster snapshot. + VpcId *string + + noSmithyDocumentSerde +} + +// Contains the name and values of a manual DB cluster snapshot attribute. +// +// Manual DB cluster snapshot attributes are used to authorize other Amazon Web +// Services accounts to restore a manual DB cluster snapshot. For more information, +// see the ModifyDBClusterSnapshotAttribute API action. +type DBClusterSnapshotAttribute struct { + + // The name of the manual DB cluster snapshot attribute. + // + // The attribute named restore refers to the list of Amazon Web Services accounts + // that have permission to copy or restore the manual DB cluster snapshot. For more + // information, see the ModifyDBClusterSnapshotAttribute API action. + AttributeName *string + + // The value(s) for the manual DB cluster snapshot attribute. + // + // If the AttributeName field is set to restore , then this element returns a list + // of IDs of the Amazon Web Services accounts that are authorized to copy or + // restore the manual DB cluster snapshot. If a value of all is in the list, then + // the manual DB cluster snapshot is public and available for any Amazon Web + // Services account to copy or restore. + AttributeValues []string + + noSmithyDocumentSerde +} + +// Contains the results of a successful call to the +// DescribeDBClusterSnapshotAttributes API action. +// +// Manual DB cluster snapshot attributes are used to authorize other Amazon Web +// Services accounts to copy or restore a manual DB cluster snapshot. For more +// information, see the ModifyDBClusterSnapshotAttribute API action. +type DBClusterSnapshotAttributesResult struct { + + // The list of attributes and values for the manual DB cluster snapshot. + DBClusterSnapshotAttributes []DBClusterSnapshotAttribute + + // The identifier of the manual DB cluster snapshot that the attributes apply to. + DBClusterSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +// Reserved for future use. +type DBClusterStatusInfo struct { + + // Reserved for future use. + Message *string + + // Reserved for future use. + Normal *bool + + // Reserved for future use. + Status *string + + // Reserved for future use. + StatusType *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the action +// DescribeDBEngineVersions . +type DBEngineVersion struct { + + // The creation time of the DB engine version. + CreateTime *time.Time + + // JSON string that lists the installation files and parameters that RDS Custom + // uses to create a custom engine version (CEV). RDS Custom applies the patches in + // the order in which they're listed in the manifest. You can set the Oracle home, + // Oracle base, and UNIX/Linux user and group using the installation parameters. + // For more information, see [JSON fields in the CEV manifest]in the Amazon RDS User Guide. + // + // [JSON fields in the CEV manifest]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-cev.preparing.html#custom-cev.preparing.manifest.fields + CustomDBEngineVersionManifest *string + + // The description of the database engine. + DBEngineDescription *string + + // A value that indicates the source media provider of the AMI based on the usage + // operation. Applicable for RDS Custom for SQL Server. + DBEngineMediaType *string + + // The ARN of the custom engine version. + DBEngineVersionArn *string + + // The description of the database engine version. + DBEngineVersionDescription *string + + // The name of the DB parameter group family for the database engine. + DBParameterGroupFamily *string + + // The name of the Amazon S3 bucket that contains your database installation files. + DatabaseInstallationFilesS3BucketName *string + + // The Amazon S3 directory that contains the database installation files. If not + // specified, then no prefix is assumed. + DatabaseInstallationFilesS3Prefix *string + + // The default character set for new instances of this engine version, if the + // CharacterSetName parameter of the CreateDBInstance API isn't specified. + DefaultCharacterSet *CharacterSet + + // The name of the database engine. + Engine *string + + // The version number of the database engine. + EngineVersion *string + + // The types of logs that the database engine has available for export to + // CloudWatch Logs. + ExportableLogTypes []string + + // The EC2 image + Image *CustomDBEngineVersionAMI + + // The Amazon Web Services KMS key identifier for an encrypted CEV. This parameter + // is required for RDS Custom, but optional for Amazon RDS. + KMSKeyId *string + + // The major engine version of the CEV. + MajorEngineVersion *string + + // Specifies any Aurora Serverless v2 properties or limits that differ between + // Aurora engine versions. You can test the values of this attribute when deciding + // which Aurora version to use in a new or upgraded DB cluster. You can also + // retrieve the version of an existing DB cluster and check whether that version + // supports certain Aurora Serverless v2 features before you attempt to use those + // features. + ServerlessV2FeaturesSupport *ServerlessV2FeaturesSupport + + // The status of the DB engine version, either available or deprecated . + Status *string + + // A list of the supported CA certificate identifiers. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + SupportedCACertificateIdentifiers []string + + // A list of the character sets supported by this engine for the CharacterSetName + // parameter of the CreateDBInstance operation. + SupportedCharacterSets []CharacterSet + + // A list of the supported DB engine modes. + SupportedEngineModes []string + + // A list of features supported by the DB engine. + // + // The supported features vary by DB engine and DB engine version. + // + // To determine the supported features for a specific DB engine and DB engine + // version using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine --engine-version + // + // For example, to determine the supported features for RDS for PostgreSQL version + // 13.3 using the CLI, use the following command: + // + // aws rds describe-db-engine-versions --engine postgres --engine-version 13.3 + // + // The supported features are listed under SupportedFeatureNames in the output. + SupportedFeatureNames []string + + // A list of the character sets supported by the Oracle DB engine for the + // NcharCharacterSetName parameter of the CreateDBInstance operation. + SupportedNcharCharacterSets []CharacterSet + + // A list of the time zones supported by this engine for the Timezone parameter of + // the CreateDBInstance action. + SupportedTimezones []Timezone + + // Indicates whether the engine version supports Babelfish for Aurora PostgreSQL. + SupportsBabelfish *bool + + // Indicates whether the engine version supports rotating the server certificate + // without rebooting the DB instance. + SupportsCertificateRotationWithoutRestart *bool + + // Indicates whether you can use Aurora global databases with a specific DB engine + // version. + SupportsGlobalDatabases *bool + + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. + SupportsIntegrations *bool + + // Indicates whether the DB engine version supports Aurora Limitless Database. + SupportsLimitlessDatabase *bool + + // Indicates whether the DB engine version supports forwarding write operations + // from reader DB instances to the writer DB instance in the DB cluster. By + // default, write operations aren't allowed on reader DB instances. + // + // Valid for: Aurora DB clusters only + SupportsLocalWriteForwarding *bool + + // Indicates whether the engine version supports exporting the log types specified + // by ExportableLogTypes to CloudWatch Logs. + SupportsLogExportsToCloudwatchLogs *bool + + // Indicates whether you can use Aurora parallel query with a specific DB engine + // version. + SupportsParallelQuery *bool + + // Indicates whether the database engine version supports read replicas. + SupportsReadReplica *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // A list of engine versions that this database engine version can be upgraded to. + ValidUpgradeTarget []UpgradeTarget + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon RDS DB instance. +// +// This data type is used as a response element in the operations CreateDBInstance +// , CreateDBInstanceReadReplica , DeleteDBInstance , DescribeDBInstances , +// ModifyDBInstance , PromoteReadReplica , RebootDBInstance , +// RestoreDBInstanceFromDBSnapshot , RestoreDBInstanceFromS3 , +// RestoreDBInstanceToPointInTime , StartDBInstance , and StopDBInstance . +type DBInstance struct { + + // Indicates whether engine-native audit fields are included in the database + // activity stream. + ActivityStreamEngineNativeAuditFieldsIncluded *bool + + // The name of the Amazon Kinesis data stream used for the database activity + // stream. + ActivityStreamKinesisStreamName *string + + // The Amazon Web Services KMS key identifier used for encrypting messages in the + // database activity stream. The Amazon Web Services KMS key identifier is the key + // ARN, key ID, alias ARN, or alias name for the KMS key. + ActivityStreamKmsKeyId *string + + // The mode of the database activity stream. Database events such as a change or + // access generate an activity stream event. RDS for Oracle always handles these + // events asynchronously. + ActivityStreamMode ActivityStreamMode + + // The status of the policy state of the activity stream. + ActivityStreamPolicyStatus ActivityStreamPolicyStatus + + // The status of the database activity stream. + ActivityStreamStatus ActivityStreamStatus + + // The amount of storage in gibibytes (GiB) allocated for the DB instance. + AllocatedStorage *int32 + + // The Amazon Web Services Identity and Access Management (IAM) roles associated + // with the DB instance. + AssociatedRoles []DBInstanceRole + + // Indicates whether minor version patches are applied automatically. + AutoMinorVersionUpgrade *bool + + // The time when a stopped DB instance is restarted automatically. + AutomaticRestartTime *time.Time + + // The automation mode of the RDS Custom DB instance: full or all paused . If full + // , the DB instance automates monitoring and instance recovery. If all paused , + // the instance pauses automation for the duration set by + // --resume-full-automation-mode-minutes . + AutomationMode AutomationMode + + // The name of the Availability Zone where the DB instance is located. + AvailabilityZone *string + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + AwsBackupRecoveryPointArn *string + + // The number of days for which automatic DB snapshots are retained. + BackupRetentionPeriod *int32 + + // The location where automated backups and manual snapshots are stored: Amazon + // Web Services Outposts or the Amazon Web Services Region. + BackupTarget *string + + // The identifier of the CA certificate for this DB instance. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // The details of the DB instance's server certificate. + CertificateDetails *CertificateDetails + + // If present, specifies the name of the character set that this instance is + // associated with. + CharacterSetName *string + + // Indicates whether tags are copied from the DB instance to snapshots of the DB + // instance. + // + // This setting doesn't apply to Amazon Aurora DB instances. Copying tags to + // snapshots is managed by the DB cluster. Setting this value for an Aurora DB + // instance has no effect on the DB cluster setting. For more information, see + // DBCluster . + CopyTagsToSnapshot *bool + + // The instance profile associated with the underlying Amazon EC2 instance of an + // RDS Custom DB instance. The instance profile must meet the following + // requirements: + // + // - The profile must exist in your account. + // + // - The profile must have an IAM role that Amazon EC2 has permissions to assume. + // + // - The instance profile name and the associated IAM role name must start with + // the prefix AWSRDSCustom . + // + // For the list of permissions required for the IAM role, see [Configure IAM and your VPC] in the Amazon RDS + // User Guide. + // + // [Configure IAM and your VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/custom-setup-orcl.html#custom-setup-orcl.iam-vpc + CustomIamInstanceProfile *string + + // Indicates whether a customer-owned IP address (CoIP) is enabled for an RDS on + // Outposts DB instance. + // + // A CoIP provides local or external connectivity to resources in your Outpost + // subnets through your on-premises network. For some use cases, a CoIP can provide + // lower latency for connections to the DB instance from outside of its virtual + // private cloud (VPC) on your local network. + // + // For more information about RDS on Outposts, see [Working with Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // For more information about CoIPs, see [Customer-owned IP addresses] in the Amazon Web Services Outposts User + // Guide. + // + // [Working with Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + // [Customer-owned IP addresses]: https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing + CustomerOwnedIpEnabled *bool + + // If the DB instance is a member of a DB cluster, indicates the name of the DB + // cluster that the DB instance is a member of. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB instance. + DBInstanceArn *string + + // The list of replicated automated backups associated with the DB instance. + DBInstanceAutomatedBackupsReplications []DBInstanceAutomatedBackupsReplication + + // The name of the compute and memory capacity class of the DB instance. + DBInstanceClass *string + + // The user-supplied database identifier. This identifier is the unique key that + // identifies a DB instance. + DBInstanceIdentifier *string + + // The current state of this database. + // + // For information about DB instance statuses, see [Viewing DB instance status] in the Amazon RDS User Guide. + // + // [Viewing DB instance status]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/accessing-monitoring.html#Overview.DBInstance.Status + DBInstanceStatus *string + + // The initial database name that you provided (if required) when you created the + // DB instance. This name is returned for the life of your DB instance. For an RDS + // for Oracle CDB instance, the name identifies the PDB rather than the CDB. + DBName *string + + // The list of DB parameter groups applied to this DB instance. + DBParameterGroups []DBParameterGroupStatus + + // A list of DB security group elements containing DBSecurityGroup.Name and + // DBSecurityGroup.Status subelements. + DBSecurityGroups []DBSecurityGroupMembership + + // Information about the subnet group associated with the DB instance, including + // the name, description, and subnets in the subnet group. + DBSubnetGroup *DBSubnetGroup + + // The Oracle system ID (Oracle SID) for a container database (CDB). The Oracle + // SID is also the name of the CDB. This setting is only valid for RDS Custom DB + // instances. + DBSystemId *string + + // The mode of Database Insights that is enabled for the instance. + DatabaseInsightsMode DatabaseInsightsMode + + // The port that the DB instance listens on. If the DB instance is part of a DB + // cluster, this can be a different port than the DB cluster port. + DbInstancePort *int32 + + // The Amazon Web Services Region-unique, immutable identifier for the DB + // instance. This identifier is found in Amazon Web Services CloudTrail log entries + // whenever the Amazon Web Services KMS key for the DB instance is accessed. + DbiResourceId *string + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Indicates whether the DB instance has deletion protection enabled. The database + // can't be deleted when deletion protection is enabled. For more information, see [Deleting a DB Instance] + // . + // + // [Deleting a DB Instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html + DeletionProtection *bool + + // The Active Directory Domain membership records associated with the DB instance. + DomainMemberships []DomainMembership + + // A list of log types that this DB instance is configured to export to CloudWatch + // Logs. + // + // Log types vary by DB engine. For information about the log types for each DB + // engine, see [Monitoring Amazon RDS log files]in the Amazon RDS User Guide. + // + // [Monitoring Amazon RDS log files]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html + EnabledCloudwatchLogsExports []string + + // The connection endpoint for the DB instance. + // + // The endpoint might not be shown for instances with the status of creating . + Endpoint *Endpoint + + // The database engine used for this DB instance. + Engine *string + + // The life cycle type for the DB instance. + // + // For more information, see CreateDBInstance. + EngineLifecycleSupport *string + + // The version of the database engine. + EngineVersion *string + + // The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log stream that + // receives the Enhanced Monitoring metrics data for the DB instance. + EnhancedMonitoringResourceArn *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled for the DB instance. + // + // For a list of engine versions that support IAM database authentication, see [IAM database authentication] in + // the Amazon RDS User Guide and [IAM database authentication in Aurora]in the Amazon Aurora User Guide. + // + // [IAM database authentication]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RDS_Fea_Regions_DB-eng.Feature.IamDatabaseAuthentication.html + // [IAM database authentication in Aurora]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.Aurora_Fea_Regions_DB-eng.Feature.IAMdbauth.html + IAMDatabaseAuthenticationEnabled *bool + + // The date and time when the DB instance was created. + InstanceCreateTime *time.Time + + // The Provisioned IOPS (I/O operations per second) value for the DB instance. + Iops *int32 + + // Indicates whether an upgrade is recommended for the storage file system + // configuration on the DB instance. To migrate to the preferred configuration, you + // can either create a blue/green deployment, or create a read replica from the DB + // instance. For more information, see [Upgrading the storage file system for a DB instance]. + // + // [Upgrading the storage file system for a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.UpgradeFileSystem + IsStorageConfigUpgradeAvailable *bool + + // If StorageEncrypted is enabled, the Amazon Web Services KMS key identifier for + // the encrypted DB instance. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The latest time to which a database in this DB instance can be restored with + // point-in-time restore. + LatestRestorableTime *time.Time + + // The license model information for this DB instance. This setting doesn't apply + // to Amazon Aurora or RDS Custom DB instances. + LicenseModel *string + + // The listener connection endpoint for SQL Server Always On. + ListenerEndpoint *Endpoint + + // The secret managed by RDS in Amazon Web Services Secrets Manager for the master + // user password. + // + // For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide. + // + // [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-manager.html + MasterUserSecret *MasterUserSecret + + // The master username for the DB instance. + MasterUsername *string + + // The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale + // the storage of the DB instance. + MaxAllocatedStorage *int32 + + // The interval, in seconds, between points when Enhanced Monitoring metrics are + // collected for the DB instance. + MonitoringInterval *int32 + + // The ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics + // to Amazon CloudWatch Logs. + MonitoringRoleArn *string + + // Indicates whether the DB instance is a Multi-AZ deployment. This setting + // doesn't apply to RDS Custom DB instances. + MultiAZ *bool + + // Specifies whether the DB instance is in the multi-tenant configuration (TRUE) + // or the single-tenant configuration (FALSE). + MultiTenant *bool + + // The name of the NCHAR character set for the Oracle DB instance. This character + // set specifies the Unicode encoding for data stored in table columns of type + // NCHAR, NCLOB, or NVARCHAR2. + NcharCharacterSetName *string + + // The network type of the DB instance. + // + // The network type is determined by the DBSubnetGroup specified for the DB + // instance. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and + // the IPv6 protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide and [Working with a DB instance in a VPC] in the Amazon + // Aurora User Guide. + // + // Valid Values: IPV4 | DUAL + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + NetworkType *string + + // The list of option group memberships for this DB instance. + OptionGroupMemberships []OptionGroupMembership + + // Information about pending changes to the DB instance. This information is + // returned only when there are pending changes. Specific changes are identified by + // subelements. + PendingModifiedValues *PendingModifiedValues + + // The progress of the storage optimization operation as a percentage. + PercentProgress *string + + // Indicates whether Performance Insights is enabled for the DB instance. + PerformanceInsightsEnabled *bool + + // The Amazon Web Services KMS key identifier for encryption of Performance + // Insights data. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + PerformanceInsightsKMSKeyId *string + + // The number of days to retain Performance Insights data. + // + // Valid Values: + // + // - 7 + // + // - month * 31, where month is a number of months from 1-23. Examples: 93 (3 + // months * 31), 341 (11 months * 31), 589 (19 months * 31) + // + // - 731 + // + // Default: 7 days + PerformanceInsightsRetentionPeriod *int32 + + // The daily time range during which automated backups are created if automated + // backups are enabled, as determined by the BackupRetentionPeriod . + PreferredBackupWindow *string + + // The weekly time range during which system maintenance can occur, in Universal + // Coordinated Time (UTC). + PreferredMaintenanceWindow *string + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + ProcessorFeatures []ProcessorFeature + + // The order of priority in which an Aurora Replica is promoted to the primary + // instance after a failure of the existing primary instance. For more information, + // see [Fault Tolerance for an Aurora DB Cluster]in the Amazon Aurora User Guide. + // + // [Fault Tolerance for an Aurora DB Cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html#Aurora.Managing.FaultTolerance + PromotionTier *int32 + + // Indicates whether the DB instance is publicly accessible. + // + // When the DB instance is publicly accessible and you connect from outside of the + // DB instance's virtual private cloud (VPC), its Domain Name System (DNS) endpoint + // resolves to the public IP address. When you connect from within the same VPC as + // the DB instance, the endpoint resolves to the private IP address. Access to the + // DB cluster is ultimately controlled by the security group it uses. That public + // access isn't permitted if the security group assigned to the DB cluster doesn't + // permit it. + // + // When the DB instance isn't publicly accessible, it is an internal DB instance + // with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBInstance. + PubliclyAccessible *bool + + // The identifiers of Aurora DB clusters to which the RDS DB instance is + // replicated as a read replica. For example, when you create an Aurora read + // replica of an RDS for MySQL DB instance, the Aurora MySQL DB cluster for the + // Aurora read replica is shown. This output doesn't contain information about + // cross-Region Aurora read replicas. + // + // Currently, each RDS DB instance can have only one Aurora read replica. + ReadReplicaDBClusterIdentifiers []string + + // The identifiers of the read replicas associated with this DB instance. + ReadReplicaDBInstanceIdentifiers []string + + // The identifier of the source DB cluster if this DB instance is a read replica. + ReadReplicaSourceDBClusterIdentifier *string + + // The identifier of the source DB instance if this DB instance is a read replica. + ReadReplicaSourceDBInstanceIdentifier *string + + // The open mode of an Oracle read replica. The default is open-read-only . For + // more information, see [Working with Oracle Read Replicas for Amazon RDS]in the Amazon RDS User Guide. + // + // This attribute is only supported in RDS for Oracle. + // + // [Working with Oracle Read Replicas for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html + ReplicaMode ReplicaMode + + // The number of minutes to pause the automation. When the time period ends, RDS + // Custom resumes full automation. The minimum value is 60 (default). The maximum + // value is 1,440. + ResumeFullAutomationModeTime *time.Time + + // If present, specifies the name of the secondary Availability Zone for a DB + // instance with multi-AZ support. + SecondaryAvailabilityZone *string + + // The status of a read replica. If the DB instance isn't a read replica, the + // value is blank. + StatusInfos []DBInstanceStatusInfo + + // Indicates whether the DB instance is encrypted. + StorageEncrypted *bool + + // The storage throughput for the DB instance. + // + // This setting applies only to the gp3 storage type. + StorageThroughput *int32 + + // The storage type associated with the DB instance. + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The ARN from the key store with which the instance is associated for TDE + // encryption. + TdeCredentialArn *string + + // The time zone of the DB instance. In most cases, the Timezone element is empty. + // Timezone content appears only for RDS for Db2 and RDS for SQL Server DB + // instances that were created with a time zone specified. + Timezone *string + + // The list of Amazon EC2 VPC security groups that the DB instance belongs to. + VpcSecurityGroups []VpcSecurityGroupMembership + + noSmithyDocumentSerde +} + +// An automated backup of a DB instance. It consists of system backups, +// transaction logs, and the database instance properties that existed at the time +// you deleted the source instance. +type DBInstanceAutomatedBackup struct { + + // The allocated storage size for the the automated backup in gibibytes (GiB). + AllocatedStorage *int32 + + // The Availability Zone that the automated backup was created in. For information + // on Amazon Web Services Regions and Availability Zones, see [Regions and Availability Zones]. + // + // [Regions and Availability Zones]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html + AvailabilityZone *string + + // The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services + // Backup. + AwsBackupRecoveryPointArn *string + + // The retention period for the automated backups. + BackupRetentionPeriod *int32 + + // The location where automated backups are stored: Amazon Web Services Outposts + // or the Amazon Web Services Region. + BackupTarget *string + + // The Amazon Resource Name (ARN) for the automated backups. + DBInstanceArn *string + + // The Amazon Resource Name (ARN) for the replicated automated backups. + DBInstanceAutomatedBackupsArn *string + + // The list of replications to different Amazon Web Services Regions associated + // with the automated backup. + DBInstanceAutomatedBackupsReplications []DBInstanceAutomatedBackupsReplication + + // The identifier for the source DB instance, which can't be changed and which is + // unique to an Amazon Web Services Region. + DBInstanceIdentifier *string + + // The resource ID for the source DB instance, which can't be changed and which is + // unique to an Amazon Web Services Region. + DbiResourceId *string + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Indicates whether the automated backup is encrypted. + Encrypted *bool + + // The name of the database engine for this automated backup. + Engine *string + + // The version of the database engine for the automated backup. + EngineVersion *string + + // True if mapping of Amazon Web Services Identity and Access Management (IAM) + // accounts to database accounts is enabled, and otherwise false. + IAMDatabaseAuthenticationEnabled *bool + + // The date and time when the DB instance was created. + InstanceCreateTime *time.Time + + // The IOPS (I/O operations per second) value for the automated backup. + Iops *int32 + + // The Amazon Web Services KMS key ID for an automated backup. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // The license model information for the automated backup. + LicenseModel *string + + // The master user name of an automated backup. + MasterUsername *string + + // Specifies whether the automatic backup is for a DB instance in the multi-tenant + // configuration (TRUE) or the single-tenant configuration (FALSE). + MultiTenant *bool + + // The option group the automated backup is associated with. If omitted, the + // default option group for the engine specified is used. + OptionGroupName *string + + // The port number that the automated backup used for connections. + // + // Default: Inherits from the source DB instance + // + // Valid Values: 1150-65535 + Port *int32 + + // The Amazon Web Services Region associated with the automated backup. + Region *string + + // The earliest and latest time a DB instance can be restored to. + RestoreWindow *RestoreWindow + + // A list of status information for an automated backup: + // + // - active - Automated backups for current instances. + // + // - retained - Automated backups for deleted instances. + // + // - creating - Automated backups that are waiting for the first automated + // snapshot to be available. + Status *string + + // The storage throughput for the automated backup. + StorageThroughput *int32 + + // The storage type associated with the automated backup. + StorageType *string + + // The ARN from the key store with which the automated backup is associated for + // TDE encryption. + TdeCredentialArn *string + + // The time zone of the automated backup. In most cases, the Timezone element is + // empty. Timezone content appears only for Microsoft SQL Server DB instances that + // were created with a time zone specified. + Timezone *string + + // The VPC ID associated with the DB instance. + VpcId *string + + noSmithyDocumentSerde +} + +// Automated backups of a DB instance replicated to another Amazon Web Services +// Region. They consist of system backups, transaction logs, and database instance +// properties. +type DBInstanceAutomatedBackupsReplication struct { + + // The Amazon Resource Name (ARN) of the replicated automated backups. + DBInstanceAutomatedBackupsArn *string + + noSmithyDocumentSerde +} + +// Information about an Amazon Web Services Identity and Access Management (IAM) +// role that is associated with a DB instance. +type DBInstanceRole struct { + + // The name of the feature associated with the Amazon Web Services Identity and + // Access Management (IAM) role. For information about supported feature names, see + // DBEngineVersion . + FeatureName *string + + // The Amazon Resource Name (ARN) of the IAM role that is associated with the DB + // instance. + RoleArn *string + + // Information about the state of association between the IAM role and the DB + // instance. The Status property returns one of the following values: + // + // - ACTIVE - the IAM role ARN is associated with the DB instance and can be used + // to access other Amazon Web Services services on your behalf. + // + // - PENDING - the IAM role ARN is being associated with the DB instance. + // + // - INVALID - the IAM role ARN is associated with the DB instance, but the DB + // instance is unable to assume the IAM role in order to access other Amazon Web + // Services services on your behalf. + Status *string + + noSmithyDocumentSerde +} + +// Provides a list of status information for a DB instance. +type DBInstanceStatusInfo struct { + + // Details of the error if there is an error for the instance. If the instance + // isn't in an error state, this value is blank. + Message *string + + // Indicates whether the instance is operating normally (TRUE) or is in an error + // state (FALSE). + Normal *bool + + // The status of the DB instance. For a StatusType of read replica, the values can + // be replicating, replication stop point set, replication stop point reached, + // error, stopped, or terminated. + Status *string + + // This value is currently "read replication." + StatusType *string + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon RDS DB parameter group. +// +// This data type is used as a response element in the DescribeDBParameterGroups +// action. +type DBParameterGroup struct { + + // The Amazon Resource Name (ARN) for the DB parameter group. + DBParameterGroupArn *string + + // The name of the DB parameter group family that this DB parameter group is + // compatible with. + DBParameterGroupFamily *string + + // The name of the DB parameter group. + DBParameterGroupName *string + + // Provides the customer-specified description for this DB parameter group. + Description *string + + noSmithyDocumentSerde +} + +// The status of the DB parameter group. +// +// This data type is used as a response element in the following actions: +// +// - CreateDBInstance +// +// - CreateDBInstanceReadReplica +// +// - DeleteDBInstance +// +// - ModifyDBInstance +// +// - RebootDBInstance +// +// - RestoreDBInstanceFromDBSnapshot +type DBParameterGroupStatus struct { + + // The name of the DB parameter group. + DBParameterGroupName *string + + // The status of parameter updates. Valid values are: + // + // - applying : The parameter group change is being applied to the database. + // + // - failed-to-apply : The parameter group is in an invalid state. + // + // - in-sync : The parameter group change is synchronized with the database. + // + // - pending-database-upgrade : The parameter group change will be applied after + // the DB instance is upgraded. + // + // - pending-reboot : The parameter group change will be applied after the DB + // instance reboots. + ParameterApplyStatus *string + + noSmithyDocumentSerde +} + +// The data structure representing a proxy managed by the RDS Proxy. +// +// This data type is used as a response element in the DescribeDBProxies action. +type DBProxy struct { + + // One or more data structures specifying the authorization mechanism to connect + // to the associated RDS DB instance or Aurora DB cluster. + Auth []UserAuthConfigInfo + + // The date and time when the proxy was first created. + CreatedDate *time.Time + + // The Amazon Resource Name (ARN) for the proxy. + DBProxyArn *string + + // The identifier for the proxy. This name must be unique for all proxies owned by + // your Amazon Web Services account in the specified Amazon Web Services Region. + DBProxyName *string + + // Indicates whether the proxy includes detailed information about SQL statements + // in its logs. This information helps you to debug issues involving SQL behavior + // or the performance and scalability of the proxy connections. The debug + // information includes the text of SQL statements that you submit through the + // proxy. Thus, only enable this setting when needed for debugging, and only when + // you have security measures in place to safeguard any sensitive information that + // appears in the logs. + DebugLogging *bool + + // The endpoint that you can use to connect to the DB proxy. You include the + // endpoint value in the connection string for a database client application. + Endpoint *string + + // The kinds of databases that the proxy can connect to. This value determines + // which database network protocol the proxy recognizes when it interprets network + // traffic to and from the database. MYSQL supports Aurora MySQL, RDS for MariaDB, + // and RDS for MySQL databases. POSTGRESQL supports Aurora PostgreSQL and RDS for + // PostgreSQL databases. SQLSERVER supports RDS for Microsoft SQL Server databases. + EngineFamily *string + + // The number of seconds a connection to the proxy can have no activity before the + // proxy drops the client connection. The proxy keeps the underlying database + // connection open and puts it back into the connection pool for reuse by later + // connection requests. + // + // Default: 1800 (30 minutes) + // + // Constraints: 1 to 28,800 + IdleClientTimeout *int32 + + // Indicates whether Transport Layer Security (TLS) encryption is required for + // connections to the proxy. + RequireTLS *bool + + // The Amazon Resource Name (ARN) for the IAM role that the proxy uses to access + // Amazon Secrets Manager. + RoleArn *string + + // The current status of this proxy. A status of available means the proxy is + // ready to handle requests. Other values indicate that you must wait for the proxy + // to be ready, or take some action to resolve an issue. + Status DBProxyStatus + + // The date and time when the proxy was last updated. + UpdatedDate *time.Time + + // Provides the VPC ID of the DB proxy. + VpcId *string + + // Provides a list of VPC security groups that the proxy belongs to. + VpcSecurityGroupIds []string + + // The EC2 subnet IDs for the proxy. + VpcSubnetIds []string + + noSmithyDocumentSerde +} + +// The data structure representing an endpoint associated with a DB proxy. RDS +// automatically creates one endpoint for each DB proxy. For Aurora DB clusters, +// you can associate additional endpoints with the same DB proxy. These endpoints +// can be read/write or read-only. They can also reside in different VPCs than the +// associated DB proxy. +// +// This data type is used as a response element in the DescribeDBProxyEndpoints +// operation. +type DBProxyEndpoint struct { + + // The date and time when the DB proxy endpoint was first created. + CreatedDate *time.Time + + // The Amazon Resource Name (ARN) for the DB proxy endpoint. + DBProxyEndpointArn *string + + // The name for the DB proxy endpoint. An identifier must begin with a letter and + // must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen + // or contain two consecutive hyphens. + DBProxyEndpointName *string + + // The identifier for the DB proxy that is associated with this DB proxy endpoint. + DBProxyName *string + + // The endpoint that you can use to connect to the DB proxy. You include the + // endpoint value in the connection string for a database client application. + Endpoint *string + + // Indicates whether this endpoint is the default endpoint for the associated DB + // proxy. Default DB proxy endpoints always have read/write capability. Other + // endpoints that you associate with the DB proxy can be either read/write or + // read-only. + IsDefault *bool + + // The current status of this DB proxy endpoint. A status of available means the + // endpoint is ready to handle requests. Other values indicate that you must wait + // for the endpoint to be ready, or take some action to resolve an issue. + Status DBProxyEndpointStatus + + // A value that indicates whether the DB proxy endpoint can be used for read/write + // or read-only operations. + TargetRole DBProxyEndpointTargetRole + + // Provides the VPC ID of the DB proxy endpoint. + VpcId *string + + // Provides a list of VPC security groups that the DB proxy endpoint belongs to. + VpcSecurityGroupIds []string + + // The EC2 subnet IDs for the DB proxy endpoint. + VpcSubnetIds []string + + noSmithyDocumentSerde +} + +// Contains the details for an RDS Proxy target. It represents an RDS DB instance +// or Aurora DB cluster that the proxy can connect to. One or more targets are +// associated with an RDS Proxy target group. +// +// This data type is used as a response element in the DescribeDBProxyTargets +// action. +type DBProxyTarget struct { + + // The writer endpoint for the RDS DB instance or Aurora DB cluster. + Endpoint *string + + // The port that the RDS Proxy uses to connect to the target RDS DB instance or + // Aurora DB cluster. + Port *int32 + + // The identifier representing the target. It can be the instance identifier for + // an RDS DB instance, or the cluster identifier for an Aurora DB cluster. + RdsResourceId *string + + // A value that indicates whether the target of the proxy can be used for + // read/write or read-only operations. + Role TargetRole + + // The Amazon Resource Name (ARN) for the RDS DB instance or Aurora DB cluster. + TargetArn *string + + // Information about the connection health of the RDS Proxy target. + TargetHealth *TargetHealth + + // The DB cluster identifier when the target represents an Aurora DB cluster. This + // field is blank when the target represents an RDS DB instance. + TrackedClusterId *string + + // Specifies the kind of database, such as an RDS DB instance or an Aurora DB + // cluster, that the target represents. + Type TargetType + + noSmithyDocumentSerde +} + +// Represents a set of RDS DB instances, Aurora DB clusters, or both that a proxy +// can connect to. Currently, each target group is associated with exactly one RDS +// DB instance or Aurora DB cluster. +// +// This data type is used as a response element in the DescribeDBProxyTargetGroups +// action. +type DBProxyTargetGroup struct { + + // The settings that determine the size and behavior of the connection pool for + // the target group. + ConnectionPoolConfig *ConnectionPoolConfigurationInfo + + // The date and time when the target group was first created. + CreatedDate *time.Time + + // The identifier for the RDS proxy associated with this target group. + DBProxyName *string + + // Indicates whether this target group is the first one used for connection + // requests by the associated proxy. Because each proxy is currently associated + // with a single target group, currently this setting is always true . + IsDefault *bool + + // The current status of this target group. A status of available means the target + // group is correctly associated with a database. Other values indicate that you + // must wait for the target group to be ready, or take some action to resolve an + // issue. + Status *string + + // The Amazon Resource Name (ARN) representing the target group. + TargetGroupArn *string + + // The identifier for the target group. This name must be unique for all target + // groups owned by your Amazon Web Services account in the specified Amazon Web + // Services Region. + TargetGroupName *string + + // The date and time when the target group was last updated. + UpdatedDate *time.Time + + noSmithyDocumentSerde +} + +// The recommendation for your DB instances, DB clusters, and DB parameter groups. +type DBRecommendation struct { + + // Additional information about the recommendation. The information might contain + // markdown. + AdditionalInfo *string + + // The category of the recommendation. + // + // Valid values: + // + // - performance efficiency + // + // - security + // + // - reliability + // + // - cost optimization + // + // - operational excellence + // + // - sustainability + Category *string + + // The time when the recommendation was created. For example, + // 2023-09-28T01:13:53.931000+00:00 . + CreatedTime *time.Time + + // A detailed description of the recommendation. The description might contain + // markdown. + Description *string + + // A short description of the issue identified for this recommendation. The + // description might contain markdown. + Detection *string + + // A short description that explains the possible impact of an issue. + Impact *string + + // Details of the issue that caused the recommendation. + IssueDetails *IssueDetails + + // A link to documentation that provides additional information about the + // recommendation. + Links []DocLink + + // The reason why this recommendation was created. The information might contain + // markdown. + Reason *string + + // A short description of the recommendation to resolve an issue. The description + // might contain markdown. + Recommendation *string + + // The unique identifier of the recommendation. + RecommendationId *string + + // A list of recommended actions. + RecommendedActions []RecommendedAction + + // The Amazon Resource Name (ARN) of the RDS resource associated with the + // recommendation. + ResourceArn *string + + // The severity level of the recommendation. The severity level can help you + // decide the urgency with which to address the recommendation. + // + // Valid values: + // + // - high + // + // - medium + // + // - low + // + // - informational + Severity *string + + // The Amazon Web Services service that generated the recommendations. + Source *string + + // The current status of the recommendation. + // + // Valid values: + // + // - active - The recommendations which are ready for you to apply. + // + // - pending - The applied or scheduled recommendations which are in progress. + // + // - resolved - The recommendations which are completed. + // + // - dismissed - The recommendations that you dismissed. + Status *string + + // A short description of the recommendation type. The description might contain + // markdown. + TypeDetection *string + + // A value that indicates the type of recommendation. This value determines how + // the description is rendered. + TypeId *string + + // A short description that summarizes the recommendation to fix all the issues of + // the recommendation type. The description might contain markdown. + TypeRecommendation *string + + // The time when the recommendation was last updated. + UpdatedTime *time.Time + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB security group. +// +// This data type is used as a response element in the DescribeDBSecurityGroups +// action. +type DBSecurityGroup struct { + + // The Amazon Resource Name (ARN) for the DB security group. + DBSecurityGroupArn *string + + // Provides the description of the DB security group. + DBSecurityGroupDescription *string + + // Specifies the name of the DB security group. + DBSecurityGroupName *string + + // Contains a list of EC2SecurityGroup elements. + EC2SecurityGroups []EC2SecurityGroup + + // Contains a list of IPRange elements. + IPRanges []IPRange + + // Provides the Amazon Web Services ID of the owner of a specific DB security + // group. + OwnerId *string + + // Provides the VpcId of the DB security group. + VpcId *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the following actions: +// +// - ModifyDBInstance +// +// - RebootDBInstance +// +// - RestoreDBInstanceFromDBSnapshot +// +// - RestoreDBInstanceToPointInTime +type DBSecurityGroupMembership struct { + + // The name of the DB security group. + DBSecurityGroupName *string + + // The status of the DB security group. + Status *string + + noSmithyDocumentSerde +} + +// Contains the details for an Amazon RDS DB shard group. +type DBShardGroup struct { + + // Specifies whether to create standby DB shard groups for the DB shard group. + // Valid values are the following: + // + // - 0 - Creates a DB shard group without a standby DB shard group. This is the + // default value. + // + // - 1 - Creates a DB shard group with a standby DB shard group in a different + // Availability Zone (AZ). + // + // - 2 - Creates a DB shard group with two standby DB shard groups in two + // different AZs. + ComputeRedundancy *int32 + + // The name of the primary DB cluster for the DB shard group. + DBClusterIdentifier *string + + // The Amazon Resource Name (ARN) for the DB shard group. + DBShardGroupArn *string + + // The name of the DB shard group. + DBShardGroupIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB shard + // group. + DBShardGroupResourceId *string + + // The connection endpoint for the DB shard group. + Endpoint *string + + // The maximum capacity of the DB shard group in Aurora capacity units (ACUs). + MaxACU *float64 + + // The minimum capacity of the DB shard group in Aurora capacity units (ACUs). + MinACU *float64 + + // Indicates whether the DB shard group is publicly accessible. + // + // When the DB shard group is publicly accessible, its Domain Name System (DNS) + // endpoint resolves to the private IP address from within the DB shard group's + // virtual private cloud (VPC). It resolves to the public IP address from outside + // of the DB shard group's VPC. Access to the DB shard group is ultimately + // controlled by the security group it uses. That public access isn't permitted if + // the security group assigned to the DB shard group doesn't permit it. + // + // When the DB shard group isn't publicly accessible, it is an internal DB shard + // group with a DNS name that resolves to a private IP address. + // + // For more information, see CreateDBShardGroup. + // + // This setting is only for Aurora Limitless Database. + PubliclyAccessible *bool + + // The status of the DB shard group. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon RDS DB snapshot. +// +// This data type is used as a response element in the DescribeDBSnapshots action. +type DBSnapshot struct { + + // Specifies the allocated storage size in gibibytes (GiB). + AllocatedStorage *int32 + + // Specifies the name of the Availability Zone the DB instance was located in at + // the time of the DB snapshot. + AvailabilityZone *string + + // Specifies the DB instance identifier of the DB instance this DB snapshot was + // created from. + DBInstanceIdentifier *string + + // The Amazon Resource Name (ARN) for the DB snapshot. + DBSnapshotArn *string + + // Specifies the identifier for the DB snapshot. + DBSnapshotIdentifier *string + + // The Oracle system identifier (SID), which is the name of the Oracle database + // instance that manages your database files. The Oracle SID is also the name of + // your CDB. + DBSystemId *string + + // The identifier for the source DB instance, which can't be changed and which is + // unique to an Amazon Web Services Region. + DbiResourceId *string + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled. + DedicatedLogVolume *bool + + // Indicates whether the DB snapshot is encrypted. + Encrypted *bool + + // Specifies the name of the database engine. + Engine *string + + // Specifies the version of the database engine. + EngineVersion *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // Specifies the time in Coordinated Universal Time (UTC) when the DB instance, + // from which the snapshot was taken, was created. + InstanceCreateTime *time.Time + + // Specifies the Provisioned IOPS (I/O operations per second) value of the DB + // instance at the time of the snapshot. + Iops *int32 + + // If Encrypted is true, the Amazon Web Services KMS key identifier for the + // encrypted DB snapshot. + // + // The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, + // or alias name for the KMS key. + KmsKeyId *string + + // License model information for the restored DB instance. + LicenseModel *string + + // Provides the master username for the DB snapshot. + MasterUsername *string + + // Indicates whether the snapshot is of a DB instance using the multi-tenant + // configuration (TRUE) or the single-tenant configuration (FALSE). + MultiTenant *bool + + // Provides the option group name for the DB snapshot. + OptionGroupName *string + + // Specifies the time of the CreateDBSnapshot operation in Coordinated Universal + // Time (UTC). Doesn't change when the snapshot is copied. + OriginalSnapshotCreateTime *time.Time + + // The percentage of the estimated data that has been transferred. + PercentProgress *int32 + + // Specifies the port that the database engine was listening on at the time of the + // snapshot. + Port *int32 + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance when the DB snapshot was created. + ProcessorFeatures []ProcessorFeature + + // Specifies when the snapshot was taken in Coordinated Universal Time (UTC). + // Changes for the copy when the snapshot is copied. + SnapshotCreateTime *time.Time + + // The timestamp of the most recent transaction applied to the database that + // you're backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the + // most recent transaction in the restored DB instance. In contrast, + // originalSnapshotCreateTime specifies the system time that the snapshot + // completed. + // + // If you back up a read replica, you can determine the replica lag by comparing + // SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if + // originalSnapshotCreateTime is two hours later than SnapshotDatabaseTime, then + // the replica lag is two hours. + SnapshotDatabaseTime *time.Time + + // Specifies where manual snapshots are stored: Amazon Web Services Outposts or + // the Amazon Web Services Region. + SnapshotTarget *string + + // Provides the type of the DB snapshot. + SnapshotType *string + + // The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was copied + // from. It only has a value in the case of a cross-account or cross-Region copy. + SourceDBSnapshotIdentifier *string + + // The Amazon Web Services Region that the DB snapshot was created in or copied + // from. + SourceRegion *string + + // Specifies the status of this DB snapshot. + Status *string + + // Specifies the storage throughput for the DB snapshot. + StorageThroughput *int32 + + // Specifies the storage type associated with DB snapshot. + StorageType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The ARN from the key store with which to associate the instance for TDE + // encryption. + TdeCredentialArn *string + + // The time zone of the DB snapshot. In most cases, the Timezone element is empty. + // Timezone content appears only for snapshots taken from Microsoft SQL Server DB + // instances that were created with a time zone specified. + Timezone *string + + // Provides the VPC ID associated with the DB snapshot. + VpcId *string + + noSmithyDocumentSerde +} + +// Contains the name and values of a manual DB snapshot attribute +// +// Manual DB snapshot attributes are used to authorize other Amazon Web Services +// accounts to restore a manual DB snapshot. For more information, see the +// ModifyDBSnapshotAttribute API. +type DBSnapshotAttribute struct { + + // The name of the manual DB snapshot attribute. + // + // The attribute named restore refers to the list of Amazon Web Services accounts + // that have permission to copy or restore the manual DB cluster snapshot. For more + // information, see the ModifyDBSnapshotAttribute API action. + AttributeName *string + + // The value or values for the manual DB snapshot attribute. + // + // If the AttributeName field is set to restore , then this element returns a list + // of IDs of the Amazon Web Services accounts that are authorized to copy or + // restore the manual DB snapshot. If a value of all is in the list, then the + // manual DB snapshot is public and available for any Amazon Web Services account + // to copy or restore. + AttributeValues []string + + noSmithyDocumentSerde +} + +// Contains the results of a successful call to the DescribeDBSnapshotAttributes +// API action. +// +// Manual DB snapshot attributes are used to authorize other Amazon Web Services +// accounts to copy or restore a manual DB snapshot. For more information, see the +// ModifyDBSnapshotAttribute API action. +type DBSnapshotAttributesResult struct { + + // The list of attributes and values for the manual DB snapshot. + DBSnapshotAttributes []DBSnapshotAttribute + + // The identifier of the manual DB snapshot that the attributes apply to. + DBSnapshotIdentifier *string + + noSmithyDocumentSerde +} + +// Contains the details of a tenant database in a snapshot of a DB instance. +type DBSnapshotTenantDatabase struct { + + // The name of the character set of a tenant database. + CharacterSetName *string + + // The ID for the DB instance that contains the tenant databases. + DBInstanceIdentifier *string + + // The identifier for the snapshot of the DB instance. + DBSnapshotIdentifier *string + + // The Amazon Resource Name (ARN) for the snapshot tenant database. + DBSnapshotTenantDatabaseARN *string + + // The resource identifier of the source CDB instance. This identifier can't be + // changed and is unique to an Amazon Web Services Region. + DbiResourceId *string + + // The name of the database engine. + EngineName *string + + // The master username of the tenant database. + MasterUsername *string + + // The NCHAR character set name of the tenant database. + NcharCharacterSetName *string + + // The type of DB snapshot. + SnapshotType *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The name of the tenant database. + TenantDBName *string + + // The time the DB snapshot was taken, specified in Coordinated Universal Time + // (UTC). If you copy the snapshot, the creation time changes. + TenantDatabaseCreateTime *time.Time + + // The resource ID of the tenant database. + TenantDatabaseResourceId *string + + noSmithyDocumentSerde +} + +// Contains the details of an Amazon RDS DB subnet group. +// +// This data type is used as a response element in the DescribeDBSubnetGroups +// action. +type DBSubnetGroup struct { + + // The Amazon Resource Name (ARN) for the DB subnet group. + DBSubnetGroupArn *string + + // Provides the description of the DB subnet group. + DBSubnetGroupDescription *string + + // The name of the DB subnet group. + DBSubnetGroupName *string + + // Provides the status of the DB subnet group. + SubnetGroupStatus *string + + // Contains a list of Subnet elements. + Subnets []Subnet + + // The network type of the DB subnet group. + // + // Valid values: + // + // - IPV4 + // + // - DUAL + // + // A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 + // protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + SupportedNetworkTypes []string + + // Provides the VpcId of the DB subnet group. + VpcId *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element to DescribeDBLogFiles . +type DescribeDBLogFilesDetails struct { + + // A POSIX timestamp when the last log entry was written. + LastWritten *int64 + + // The name of the log file for the specified DB instance. + LogFileName *string + + // The size, in bytes, of the log file for the specified DB instance. + Size *int64 + + noSmithyDocumentSerde +} + +// A link to documentation that provides additional information for a +// recommendation. +type DocLink struct { + + // The text with the link to documentation for the recommendation. + Text *string + + // The URL for the documentation for the recommendation. + Url *string + + noSmithyDocumentSerde +} + +// An Active Directory Domain membership record associated with the DB instance or +// cluster. +type DomainMembership struct { + + // The ARN for the Secrets Manager secret with the credentials for the user that's + // a member of the domain. + AuthSecretArn *string + + // The IPv4 DNS IP addresses of the primary and secondary Active Directory domain + // controllers. + DnsIps []string + + // The identifier of the Active Directory Domain. + Domain *string + + // The fully qualified domain name (FQDN) of the Active Directory Domain. + FQDN *string + + // The name of the IAM role used when making API calls to the Directory Service. + IAMRoleName *string + + // The Active Directory organizational unit for the DB instance or cluster. + OU *string + + // The status of the Active Directory Domain membership for the DB instance or + // cluster. Values include joined , pending-join , failed , and so on. + Status *string + + noSmithyDocumentSerde +} + +// A range of double values. +type DoubleRange struct { + + // The minimum value in the range. + From *float64 + + // The maximum value in the range. + To *float64 + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the following actions: +// +// - AuthorizeDBSecurityGroupIngress +// +// - DescribeDBSecurityGroups +// +// - RevokeDBSecurityGroupIngress +type EC2SecurityGroup struct { + + // Specifies the id of the EC2 security group. + EC2SecurityGroupId *string + + // Specifies the name of the EC2 security group. + EC2SecurityGroupName *string + + // Specifies the Amazon Web Services ID of the owner of the EC2 security group + // specified in the EC2SecurityGroupName field. + EC2SecurityGroupOwnerId *string + + // Provides the status of the EC2 security group. Status can be "authorizing", + // "authorized", "revoking", and "revoked". + Status *string + + noSmithyDocumentSerde +} + +// This data type represents the information you need to connect to an Amazon RDS +// DB instance. This data type is used as a response element in the following +// actions: +// +// - CreateDBInstance +// +// - DescribeDBInstances +// +// - DeleteDBInstance +// +// For the data structure that represents Amazon Aurora DB cluster endpoints, see +// DBClusterEndpoint . +type Endpoint struct { + + // Specifies the DNS address of the DB instance. + Address *string + + // Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. + HostedZoneId *string + + // Specifies the port that the database engine is listening on. + Port *int32 + + noSmithyDocumentSerde +} + +// Contains the result of a successful invocation of the +// DescribeEngineDefaultParameters action. +type EngineDefaults struct { + + // Specifies the name of the DB parameter group family that the engine default + // parameters apply to. + DBParameterGroupFamily *string + + // An optional pagination token provided by a previous EngineDefaults request. If + // this parameter is specified, the response includes only records beyond the + // marker, up to the value specified by MaxRecords . + Marker *string + + // Contains a list of engine default parameters. + Parameters []Parameter + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the [DescribeEvents] action. +// +// [DescribeEvents]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeEvents.html +type Event struct { + + // Specifies the date and time of the event. + Date *time.Time + + // Specifies the category for the event. + EventCategories []string + + // Provides the text of this event. + Message *string + + // The Amazon Resource Name (ARN) for the event. + SourceArn *string + + // Provides the identifier for the source of the event. + SourceIdentifier *string + + // Specifies the source type for this event. + SourceType SourceType + + noSmithyDocumentSerde +} + +// Contains the results of a successful invocation of the [DescribeEventCategories] operation. +// +// [DescribeEventCategories]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeEventCategories.html +type EventCategoriesMap struct { + + // The event categories for the specified source type + EventCategories []string + + // The source type that the returned categories belong to + SourceType *string + + noSmithyDocumentSerde +} + +// Contains the results of a successful invocation of the +// DescribeEventSubscriptions action. +type EventSubscription struct { + + // The RDS event notification subscription Id. + CustSubscriptionId *string + + // The Amazon Web Services customer account associated with the RDS event + // notification subscription. + CustomerAwsId *string + + // Specifies whether the subscription is enabled. True indicates the subscription + // is enabled. + Enabled *bool + + // A list of event categories for the RDS event notification subscription. + EventCategoriesList []string + + // The Amazon Resource Name (ARN) for the event subscription. + EventSubscriptionArn *string + + // The topic ARN of the RDS event notification subscription. + SnsTopicArn *string + + // A list of source IDs for the RDS event notification subscription. + SourceIdsList []string + + // The source type for the RDS event notification subscription. + SourceType *string + + // The status of the RDS event notification subscription. + // + // Constraints: + // + // Can be one of the following: creating | modifying | deleting | active | + // no-permission | topic-not-exist + // + // The status "no-permission" indicates that RDS no longer has permission to post + // to the SNS topic. The status "topic-not-exist" indicates that the topic was + // deleted after the subscription was created. + Status *string + + // The time the RDS event notification subscription was created. + SubscriptionCreationTime *string + + noSmithyDocumentSerde +} + +// Contains the details of a snapshot or cluster export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks +// operation. +type ExportTask struct { + + // The data exported from the snapshot or cluster. + // + // Valid Values: + // + // - database - Export all the data from a specified database. + // + // - database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. + // + // - database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + // + // - database.schema.table table-name - Export a table of the database schema. + // This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. + ExportOnly []string + + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. + ExportTaskIdentifier *string + + // The reason the export failed, if it failed. + FailureCause *string + + // The name of the IAM role that is used to write to Amazon S3 when exporting a + // snapshot or cluster. + IamRoleArn *string + + // The key identifier of the Amazon Web Services KMS key that is used to encrypt + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. + KmsKeyId *string + + // The progress of the snapshot or cluster export task as a percentage. + PercentProgress *int32 + + // The Amazon S3 bucket where the snapshot or cluster is exported to. + S3Bucket *string + + // The Amazon S3 bucket prefix that is the file name and path of the exported data. + S3Prefix *string + + // The time when the snapshot was created. + SnapshotTime *time.Time + + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. + SourceArn *string + + // The type of source for the export. + SourceType ExportSourceType + + // The progress status of the export task. The status can be one of the following: + // + // - CANCELED + // + // - CANCELING + // + // - COMPLETE + // + // - FAILED + // + // - IN_PROGRESS + // + // - STARTING + Status *string + + // The time when the snapshot or cluster export task ended. + TaskEndTime *time.Time + + // The time when the snapshot or cluster export task started. + TaskStartTime *time.Time + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int32 + + // A warning about the snapshot or cluster export task. + WarningMessage *string + + noSmithyDocumentSerde +} + +// Contains the state of scheduled or in-process operations on a global cluster +// (Aurora global database). This data type is empty unless a switchover or +// failover operation is scheduled or is in progress on the Aurora global database. +type FailoverState struct { + + // The Amazon Resource Name (ARN) of the Aurora DB cluster that is currently being + // demoted, and which is associated with this state. + FromDbClusterArn *string + + // Indicates whether the operation is a global switchover or a global failover. If + // data loss is allowed, then the operation is a global failover. Otherwise, it's a + // switchover. + IsDataLossAllowed *bool + + // The current status of the global cluster. Possible values are as follows: + // + // - pending – The service received a request to switch over or fail over the + // global cluster. The global cluster's primary DB cluster and the specified + // secondary DB cluster are being verified before the operation starts. + // + // - failing-over – Aurora is promoting the chosen secondary Aurora DB cluster + // to become the new primary DB cluster to fail over the global cluster. + // + // - cancelling – The request to switch over or fail over the global cluster was + // cancelled and the primary Aurora DB cluster and the selected secondary Aurora DB + // cluster are returning to their previous states. + // + // - switching-over – This status covers the range of Aurora internal operations + // that take place during the switchover process, such as demoting the primary + // Aurora DB cluster, promoting the secondary Aurora DB cluster, and synchronizing + // replicas. + Status FailoverStatus + + // The Amazon Resource Name (ARN) of the Aurora DB cluster that is currently being + // promoted, and which is associated with this state. + ToDbClusterArn *string + + noSmithyDocumentSerde +} + +// A filter name and value pair that is used to return a more specific list of +// results from a describe operation. Filters can be used to match a set of +// resources by specific criteria, such as IDs. The filters supported by a describe +// operation are documented with the describe operation. +// +// Currently, wildcards are not supported in filters. +// +// The following actions can be filtered: +// +// - DescribeDBClusterBacktracks +// +// - DescribeDBClusterEndpoints +// +// - DescribeDBClusters +// +// - DescribeDBInstances +// +// - DescribeDBRecommendations +// +// - DescribeDBShardGroups +// +// - DescribePendingMaintenanceActions +type Filter struct { + + // The name of the filter. Filter names are case-sensitive. + // + // This member is required. + Name *string + + // One or more filter values. Filter values are case-sensitive. + // + // This member is required. + Values []string + + noSmithyDocumentSerde +} + +// A data type representing an Aurora global database. +type GlobalCluster struct { + + // The default database name within the new global database cluster. + DatabaseName *string + + // The deletion protection setting for the new global database cluster. + DeletionProtection *bool + + // The writer endpoint for the new global database cluster. This endpoint always + // points to the writer DB instance in the current primary cluster. + Endpoint *string + + // The Aurora database engine used by the global database cluster. + Engine *string + + // The life cycle type for the global cluster. + // + // For more information, see CreateGlobalCluster. + EngineLifecycleSupport *string + + // Indicates the database engine version. + EngineVersion *string + + // A data object containing all properties for the current state of an in-process + // or pending switchover or failover process for this global cluster (Aurora global + // database). This object is empty unless the SwitchoverGlobalCluster or + // FailoverGlobalCluster operation was called on this global cluster. + FailoverState *FailoverState + + // The Amazon Resource Name (ARN) for the global database cluster. + GlobalClusterArn *string + + // Contains a user-supplied global database cluster identifier. This identifier is + // the unique key that identifies a global database cluster. + GlobalClusterIdentifier *string + + // The list of primary and secondary clusters within the global database cluster. + GlobalClusterMembers []GlobalClusterMember + + // The Amazon Web Services Region-unique, immutable identifier for the global + // database cluster. This identifier is found in Amazon Web Services CloudTrail log + // entries whenever the Amazon Web Services KMS key for the DB cluster is accessed. + GlobalClusterResourceId *string + + // Specifies the current state of this global database cluster. + Status *string + + // The storage encryption setting for the global database cluster. + StorageEncrypted *bool + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + noSmithyDocumentSerde +} + +// A data structure with information about any primary and secondary clusters +// associated with a global cluster (Aurora global database). +type GlobalClusterMember struct { + + // The Amazon Resource Name (ARN) for each Aurora DB cluster in the global cluster. + DBClusterArn *string + + // The status of write forwarding for a secondary cluster in the global cluster. + GlobalWriteForwardingStatus WriteForwardingStatus + + // Indicates whether the Aurora DB cluster is the primary cluster (that is, has + // read-write capability) for the global cluster with which it is associated. + IsWriter *bool + + // The Amazon Resource Name (ARN) for each read-only secondary cluster associated + // with the global cluster. + Readers []string + + // The status of synchronization of each Aurora DB cluster in the global cluster. + SynchronizationStatus GlobalClusterMemberSynchronizationStatus + + noSmithyDocumentSerde +} + +// A zero-ETL integration with Amazon Redshift. +type Integration struct { + + // The encryption context for the integration. For more information, see [Encryption context] in the + // Amazon Web Services Key Management Service Developer Guide. + // + // [Encryption context]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context + AdditionalEncryptionContext map[string]string + + // The time when the integration was created, in Universal Coordinated Time (UTC). + CreateTime *time.Time + + // Data filters for the integration. These filters determine which tables from the + // source database are sent to the target Amazon Redshift data warehouse. + DataFilter *string + + // A description of the integration. + Description *string + + // Any errors associated with the integration. + Errors []IntegrationError + + // The ARN of the integration. + IntegrationArn *string + + // The name of the integration. + IntegrationName *string + + // The Amazon Web Services Key Management System (Amazon Web Services KMS) key + // identifier for the key used to to encrypt the integration. + KMSKeyId *string + + // The Amazon Resource Name (ARN) of the database used as the source for + // replication. + SourceArn *string + + // The current status of the integration. + Status IntegrationStatus + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + Tags []Tag + + // The ARN of the Redshift data warehouse used as the target for replication. + TargetArn *string + + noSmithyDocumentSerde +} + +// An error associated with a zero-ETL integration with Amazon Redshift. +type IntegrationError struct { + + // The error code associated with the integration. + // + // This member is required. + ErrorCode *string + + // A message explaining the error. + ErrorMessage *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the DescribeDBSecurityGroups +// action. +type IPRange struct { + + // The IP range. + CIDRIP *string + + // The status of the IP range. Status can be "authorizing", "authorized", + // "revoking", and "revoked". + Status *string + + noSmithyDocumentSerde +} + +// The details of an issue with your DB instances, DB clusters, and DB parameter +// groups. +type IssueDetails struct { + + // A detailed description of the issue when the recommendation category is + // performance . + PerformanceIssueDetails *PerformanceIssueDetails + + noSmithyDocumentSerde +} + +// Contains details for Aurora Limitless Database. +type LimitlessDatabase struct { + + // The minimum required capacity for Aurora Limitless Database in Aurora capacity + // units (ACUs). + MinRequiredACU *float64 + + // The status of Aurora Limitless Database. + Status LimitlessDatabaseStatus + + noSmithyDocumentSerde +} + +// Contains the secret managed by RDS in Amazon Web Services Secrets Manager for +// the master user password. +// +// For more information, see [Password management with Amazon Web Services Secrets Manager] in the Amazon RDS User Guide and [Password management with Amazon Web Services Secrets Manager] in the Amazon +// Aurora User Guide. +// +// [Password management with Amazon Web Services Secrets Manager]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-secrets-manager.html +type MasterUserSecret struct { + + // The Amazon Web Services KMS key identifier that is used to encrypt the secret. + KmsKeyId *string + + // The Amazon Resource Name (ARN) of the secret. + SecretArn *string + + // The status of the secret. + // + // The possible status values include the following: + // + // - creating - The secret is being created. + // + // - active - The secret is available for normal use and rotation. + // + // - rotating - The secret is being rotated. + // + // - impaired - The secret can be used to access database credentials, but it + // can't be rotated. A secret might have this status if, for example, permissions + // are changed so that RDS can no longer access either the secret or the KMS key + // for the secret. + // + // When a secret has this status, you can correct the condition that caused the + // status. Alternatively, modify the DB instance to turn off automatic management + // of database credentials, and then modify the DB instance again to turn on + // automatic management of database credentials. + SecretStatus *string + + noSmithyDocumentSerde +} + +// The representation of a metric. +type Metric struct { + + // The query to retrieve metric data points. + MetricQuery *MetricQuery + + // The name of a metric. + Name *string + + // A list of metric references (thresholds). + References []MetricReference + + // The details of different statistics for a metric. The description might contain + // markdown. + StatisticsDetails *string + + noSmithyDocumentSerde +} + +// The query to retrieve metric data points. +type MetricQuery struct { + + // The Performance Insights query that you can use to retrieve Performance + // Insights metric data points. + PerformanceInsightsMetricQuery *PerformanceInsightsMetricQuery + + noSmithyDocumentSerde +} + +// The reference (threshold) for a metric. +type MetricReference struct { + + // The name of the metric reference. + Name *string + + // The details of a performance issue. + ReferenceDetails *ReferenceDetails + + noSmithyDocumentSerde +} + +// The minimum DB engine version required for each corresponding allowed value for +// an option setting. +type MinimumEngineVersionPerAllowedValue struct { + + // The allowed value for an option setting. + AllowedValue *string + + // The minimum DB engine version required for the allowed value. + MinimumEngineVersion *string + + noSmithyDocumentSerde +} + +// The details of an option. +type Option struct { + + // If the option requires access to a port, then this DB security group allows + // access to the port. + DBSecurityGroupMemberships []DBSecurityGroupMembership + + // The description of the option. + OptionDescription *string + + // The name of the option. + OptionName *string + + // The option settings for this option. + OptionSettings []OptionSetting + + // The version of the option. + OptionVersion *string + + // Indicates whether this option is permanent. + Permanent *bool + + // Indicates whether this option is persistent. + Persistent *bool + + // If required, the port configured for this option to use. + Port *int32 + + // If the option requires access to a port, then this VPC security group allows + // access to the port. + VpcSecurityGroupMemberships []VpcSecurityGroupMembership + + noSmithyDocumentSerde +} + +// A list of all available options for an option group. +type OptionConfiguration struct { + + // The configuration of options to include in a group. + // + // This member is required. + OptionName *string + + // A list of DB security groups used for this option. + DBSecurityGroupMemberships []string + + // The option settings to include in an option group. + OptionSettings []OptionSetting + + // The version for the option. + OptionVersion *string + + // The optional port for the option. + Port *int32 + + // A list of VPC security group names used for this option. + VpcSecurityGroupMemberships []string + + noSmithyDocumentSerde +} + +type OptionGroup struct { + + // Indicates whether this option group can be applied to both VPC and non-VPC + // instances. The value true indicates the option group can be applied to both VPC + // and non-VPC instances. + AllowsVpcAndNonVpcInstanceMemberships *bool + + // Indicates when the option group was copied. + CopyTimestamp *time.Time + + // Indicates the name of the engine that this option group can be applied to. + EngineName *string + + // Indicates the major engine version associated with this option group. + MajorEngineVersion *string + + // Specifies the Amazon Resource Name (ARN) for the option group. + OptionGroupArn *string + + // Provides a description of the option group. + OptionGroupDescription *string + + // Specifies the name of the option group. + OptionGroupName *string + + // Indicates what options are available in the option group. + Options []Option + + // Specifies the Amazon Web Services account ID for the option group from which + // this option group is copied. + SourceAccountId *string + + // Specifies the name of the option group from which this option group is copied. + SourceOptionGroup *string + + // If AllowsVpcAndNonVpcInstanceMemberships is false , this field is blank. If + // AllowsVpcAndNonVpcInstanceMemberships is true and this field is blank, then + // this option group can be applied to both VPC and non-VPC instances. If this + // field contains a value, then this option group can only be applied to instances + // that are in the VPC indicated by this field. + VpcId *string + + noSmithyDocumentSerde +} + +// Provides information on the option groups the DB instance is a member of. +type OptionGroupMembership struct { + + // The name of the option group that the instance belongs to. + OptionGroupName *string + + // The status of the DB instance's option group membership. Valid values are: + // in-sync , pending-apply , pending-removal , pending-maintenance-apply , + // pending-maintenance-removal , applying , removing , and failed . + Status *string + + noSmithyDocumentSerde +} + +// Available option. +type OptionGroupOption struct { + + // Indicates whether the option can be copied across Amazon Web Services accounts. + CopyableCrossAccount *bool + + // If the option requires a port, specifies the default port for the option. + DefaultPort *int32 + + // The description of the option. + Description *string + + // The name of the engine that this option can be applied to. + EngineName *string + + // Indicates the major engine version that the option is available for. + MajorEngineVersion *string + + // The minimum required engine version for the option to be applied. + MinimumRequiredMinorEngineVersion *string + + // The name of the option. + Name *string + + // The option settings that are available (and the default value) for each option + // in an option group. + OptionGroupOptionSettings []OptionGroupOptionSetting + + // The versions that are available for the option. + OptionGroupOptionVersions []OptionVersion + + // The options that conflict with this option. + OptionsConflictsWith []string + + // The options that are prerequisites for this option. + OptionsDependedOn []string + + // Permanent options can never be removed from an option group. An option group + // containing a permanent option can't be removed from a DB instance. + Permanent *bool + + // Persistent options can't be removed from an option group while DB instances are + // associated with the option group. If you disassociate all DB instances from the + // option group, your can remove the persistent option from the option group. + Persistent *bool + + // Indicates whether the option requires a port. + PortRequired *bool + + // If true, you must enable the Auto Minor Version Upgrade setting for your DB + // instance before you can use this option. You can enable Auto Minor Version + // Upgrade when you first create your DB instance, or by modifying your DB instance + // later. + RequiresAutoMinorEngineVersionUpgrade *bool + + // If true, you can change the option to an earlier version of the option. This + // only applies to options that have different versions available. + SupportsOptionVersionDowngrade *bool + + // If true, you can only use this option with a DB instance that is in a VPC. + VpcOnly *bool + + noSmithyDocumentSerde +} + +// Option group option settings are used to display settings available for each +// option with their default values and other information. These values are used +// with the DescribeOptionGroupOptions action. +type OptionGroupOptionSetting struct { + + // Indicates the acceptable values for the option group option. + AllowedValues *string + + // The DB engine specific parameter type for the option group option. + ApplyType *string + + // The default value for the option group option. + DefaultValue *string + + // Indicates whether this option group option can be changed from the default + // value. + IsModifiable *bool + + // Indicates whether a value must be specified for this option setting of the + // option group option. + IsRequired *bool + + // The minimum DB engine version required for the corresponding allowed value for + // this option setting. + MinimumEngineVersionPerAllowedValue []MinimumEngineVersionPerAllowedValue + + // The description of the option group option. + SettingDescription *string + + // The name of the option group option. + SettingName *string + + noSmithyDocumentSerde +} + +// Option settings are the actual settings being applied or configured for that +// option. It is used when you modify an option group or describe option groups. +// For example, the NATIVE_NETWORK_ENCRYPTION option has a setting called +// SQLNET.ENCRYPTION_SERVER that can have several different values. +type OptionSetting struct { + + // The allowed values of the option setting. + AllowedValues *string + + // The DB engine specific parameter type. + ApplyType *string + + // The data type of the option setting. + DataType *string + + // The default value of the option setting. + DefaultValue *string + + // The description of the option setting. + Description *string + + // Indicates whether the option setting is part of a collection. + IsCollection *bool + + // Indicates whether the option setting can be modified from the default. + IsModifiable *bool + + // The name of the option that has settings that you can set. + Name *string + + // The current value of the option setting. + Value *string + + noSmithyDocumentSerde +} + +// The version for an option. Option group option versions are returned by the +// DescribeOptionGroupOptions action. +type OptionVersion struct { + + // Indicates whether the version is the default version of the option. + IsDefault *bool + + // The version of the option. + Version *string + + noSmithyDocumentSerde +} + +// Contains a list of available options for a DB instance. +// +// This data type is used as a response element in the +// DescribeOrderableDBInstanceOptions action. +type OrderableDBInstanceOption struct { + + // The Availability Zone group for a DB instance. + AvailabilityZoneGroup *string + + // A list of Availability Zones for a DB instance. + AvailabilityZones []AvailabilityZone + + // A list of the available processor features for the DB instance class of a DB + // instance. + AvailableProcessorFeatures []AvailableProcessorFeature + + // The DB instance class for a DB instance. + DBInstanceClass *string + + // The engine type of a DB instance. + Engine *string + + // The engine version of a DB instance. + EngineVersion *string + + // The license model for a DB instance. + LicenseModel *string + + // Maximum total provisioned IOPS for a DB instance. + MaxIopsPerDbInstance *int32 + + // Maximum provisioned IOPS per GiB for a DB instance. + MaxIopsPerGib *float64 + + // Maximum storage size for a DB instance. + MaxStorageSize *int32 + + // Maximum storage throughput for a DB instance. + MaxStorageThroughputPerDbInstance *int32 + + // Maximum storage throughput to provisioned IOPS ratio for a DB instance. + MaxStorageThroughputPerIops *float64 + + // Minimum total provisioned IOPS for a DB instance. + MinIopsPerDbInstance *int32 + + // Minimum provisioned IOPS per GiB for a DB instance. + MinIopsPerGib *float64 + + // Minimum storage size for a DB instance. + MinStorageSize *int32 + + // Minimum storage throughput for a DB instance. + MinStorageThroughputPerDbInstance *int32 + + // Minimum storage throughput to provisioned IOPS ratio for a DB instance. + MinStorageThroughputPerIops *float64 + + // Indicates whether a DB instance is Multi-AZ capable. + MultiAZCapable *bool + + // Indicates whether a DB instance supports RDS on Outposts. + // + // For more information about RDS on Outposts, see [Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // [Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + OutpostCapable *bool + + // Indicates whether a DB instance can have a read replica. + ReadReplicaCapable *bool + + // The storage type for a DB instance. + StorageType *string + + // The list of supported modes for Database Activity Streams. Aurora PostgreSQL + // returns the value [sync, async] . Aurora MySQL and RDS for Oracle return [async] + // only. If Database Activity Streams isn't supported, the return value is an empty + // list. + SupportedActivityStreamModes []string + + // A list of the supported DB engine modes. + SupportedEngineModes []string + + // The network types supported by the DB instance ( IPV4 or DUAL ). + // + // A DB instance can support only the IPv4 protocol or the IPv4 and the IPv6 + // protocols ( DUAL ). + // + // For more information, see [Working with a DB instance in a VPC] in the Amazon RDS User Guide. + // + // [Working with a DB instance in a VPC]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html + SupportedNetworkTypes []string + + // Indicates whether DB instances can be configured as a Multi-AZ DB cluster. + // + // For more information on Multi-AZ DB clusters, see [Multi-AZ deployments with two readable standby DB instances] in the Amazon RDS User + // Guide. + // + // [Multi-AZ deployments with two readable standby DB instances]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html + SupportsClusters *bool + + // Indicates whether a DB instance supports using a dedicated log volume (DLV). + SupportsDedicatedLogVolume *bool + + // Indicates whether a DB instance supports Enhanced Monitoring at intervals from + // 1 to 60 seconds. + SupportsEnhancedMonitoring *bool + + // Indicates whether you can use Aurora global databases with a specific + // combination of other DB engine attributes. + SupportsGlobalDatabases *bool + + // Indicates whether a DB instance supports IAM database authentication. + SupportsIAMDatabaseAuthentication *bool + + // Indicates whether a DB instance supports provisioned IOPS. + SupportsIops *bool + + // Indicates whether a DB instance supports Kerberos Authentication. + SupportsKerberosAuthentication *bool + + // Indicates whether a DB instance supports Performance Insights. + SupportsPerformanceInsights *bool + + // Indicates whether Amazon RDS can automatically scale storage for DB instances + // that use the specified DB instance class. + SupportsStorageAutoscaling *bool + + // Indicates whether a DB instance supports encrypted storage. + SupportsStorageEncryption *bool + + // Indicates whether a DB instance supports storage throughput. + SupportsStorageThroughput *bool + + // Indicates whether a DB instance is in a VPC. + Vpc *bool + + noSmithyDocumentSerde +} + +// A data type that represents an Outpost. +// +// For more information about RDS on Outposts, see [Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. +// +// [Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html +type Outpost struct { + + // The Amazon Resource Name (ARN) of the Outpost. + Arn *string + + noSmithyDocumentSerde +} + +// This data type is used as a request parameter in the ModifyDBParameterGroup and +// ResetDBParameterGroup actions. +// +// This data type is used as a response element in the +// DescribeEngineDefaultParameters and DescribeDBParameters actions. +type Parameter struct { + + // Specifies the valid range of values for the parameter. + AllowedValues *string + + // Indicates when to apply parameter updates. + ApplyMethod ApplyMethod + + // Specifies the engine specific parameters type. + ApplyType *string + + // Specifies the valid data type for the parameter. + DataType *string + + // Provides a description of the parameter. + Description *string + + // Indicates whether ( true ) or not ( false ) the parameter can be modified. Some + // parameters have security or operational implications that prevent them from + // being changed. + IsModifiable *bool + + // The earliest engine version to which the parameter can apply. + MinimumEngineVersion *string + + // The name of the parameter. + ParameterName *string + + // The value of the parameter. + ParameterValue *string + + // The source of the parameter value. + Source *string + + // The valid DB engine modes. + SupportedEngineModes []string + + noSmithyDocumentSerde +} + +// A list of the log types whose configuration is still pending. In other words, +// these log types are in the process of being activated or deactivated. +type PendingCloudwatchLogsExports struct { + + // Log types that are in the process of being enabled. After they are enabled, + // these log types are exported to CloudWatch Logs. + LogTypesToDisable []string + + // Log types that are in the process of being deactivated. After they are + // deactivated, these log types aren't exported to CloudWatch Logs. + LogTypesToEnable []string + + noSmithyDocumentSerde +} + +// Provides information about a pending maintenance action for a resource. +type PendingMaintenanceAction struct { + + // The type of pending maintenance action that is available for the resource. + // + // For more information about maintenance actions, see [Maintaining a DB instance]. + // + // Valid Values: + // + // - ca-certificate-rotation + // + // - db-upgrade + // + // - hardware-maintenance + // + // - os-upgrade + // + // - system-update + // + // For more information about these actions, see [Maintenance actions for Amazon Aurora] or [Maintenance actions for Amazon RDS]. + // + // [Maintenance actions for Amazon RDS]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-rds + // [Maintaining a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html + // [Maintenance actions for Amazon Aurora]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#maintenance-actions-aurora + Action *string + + // The date of the maintenance window when the action is applied. The maintenance + // action is applied to the resource during its first maintenance window after this + // date. + AutoAppliedAfterDate *time.Time + + // The effective date when the pending maintenance action is applied to the + // resource. This date takes into account opt-in requests received from the + // ApplyPendingMaintenanceAction API, the AutoAppliedAfterDate , and the + // ForcedApplyDate . This value is blank if an opt-in request has not been received + // and nothing has been specified as AutoAppliedAfterDate or ForcedApplyDate . + CurrentApplyDate *time.Time + + // A description providing more detail about the maintenance action. + Description *string + + // The date when the maintenance action is automatically applied. + // + // On this date, the maintenance action is applied to the resource as soon as + // possible, regardless of the maintenance window for the resource. There might be + // a delay of one or more days from this date before the maintenance action is + // applied. + ForcedApplyDate *time.Time + + // Indicates the type of opt-in request that has been received for the resource. + OptInStatus *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the ModifyDBInstance operation +// and contains changes that will be applied during the next maintenance window. +type PendingModifiedValues struct { + + // The allocated storage size for the DB instance specified in gibibytes (GiB). + AllocatedStorage *int32 + + // The automation mode of the RDS Custom DB instance: full or all-paused . If full + // , the DB instance automates monitoring and instance recovery. If all-paused , + // the instance pauses automation for the duration set by + // --resume-full-automation-mode-minutes . + AutomationMode AutomationMode + + // The number of days for which automated backups are retained. + BackupRetentionPeriod *int32 + + // The identifier of the CA certificate for the DB instance. + // + // For more information, see [Using SSL/TLS to encrypt a connection to a DB instance] in the Amazon RDS User Guide and [Using SSL/TLS to encrypt a connection to a DB cluster] in the Amazon + // Aurora User Guide. + // + // [Using SSL/TLS to encrypt a connection to a DB cluster]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + // [Using SSL/TLS to encrypt a connection to a DB instance]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + CACertificateIdentifier *string + + // The name of the compute and memory capacity class for the DB instance. + DBInstanceClass *string + + // The database identifier for the DB instance. + DBInstanceIdentifier *string + + // The DB subnet group for the DB instance. + DBSubnetGroupName *string + + // Indicates whether the DB instance has a dedicated log volume (DLV) enabled.> + DedicatedLogVolume *bool + + // The database engine of the DB instance. + Engine *string + + // The database engine version. + EngineVersion *string + + // Indicates whether mapping of Amazon Web Services Identity and Access Management + // (IAM) accounts to database accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The Provisioned IOPS value for the DB instance. + Iops *int32 + + // The license model for the DB instance. + // + // Valid values: license-included | bring-your-own-license | general-public-license + LicenseModel *string + + // The master credentials for the DB instance. + MasterUserPassword *string + + // Indicates whether the Single-AZ DB instance will change to a Multi-AZ + // deployment. + MultiAZ *bool + + // Indicates whether the DB instance will change to the multi-tenant configuration + // (TRUE) or the single-tenant configuration (FALSE). + MultiTenant *bool + + // A list of the log types whose configuration is still pending. In other words, + // these log types are in the process of being activated or deactivated. + PendingCloudwatchLogsExports *PendingCloudwatchLogsExports + + // The port for the DB instance. + Port *int32 + + // The number of CPU cores and the number of threads per core for the DB instance + // class of the DB instance. + ProcessorFeatures []ProcessorFeature + + // The number of minutes to pause the automation. When the time period ends, RDS + // Custom resumes full automation. The minimum value is 60 (default). The maximum + // value is 1,440. + ResumeFullAutomationModeTime *time.Time + + // The storage throughput of the DB instance. + StorageThroughput *int32 + + // The storage type of the DB instance. + StorageType *string + + noSmithyDocumentSerde +} + +// A logical grouping of Performance Insights metrics for a related subject area. +// For example, the db.sql dimension group consists of the following dimensions: +// +// - db.sql.id - The hash of a running SQL statement, generated by Performance +// Insights. +// +// - db.sql.db_id - Either the SQL ID generated by the database engine, or a +// value generated by Performance Insights that begins with pi- . +// +// - db.sql.statement - The full text of the SQL statement that is running, for +// example, SELECT * FROM employees . +// +// - db.sql_tokenized.id - The hash of the SQL digest generated by Performance +// Insights. +// +// Each response element returns a maximum of 500 bytes. For larger elements, such +// as SQL statements, only the first 500 bytes are returned. +type PerformanceInsightsMetricDimensionGroup struct { + + // A list of specific dimensions from a dimension group. If this list isn't + // included, then all of the dimensions in the group were requested, or are present + // in the response. + Dimensions []string + + // The available dimension groups for Performance Insights metric type. + Group *string + + // The maximum number of items to fetch for this dimension group. + Limit *int32 + + noSmithyDocumentSerde +} + +// A single Performance Insights metric query to process. You must provide the +// metric to the query. If other parameters aren't specified, Performance Insights +// returns all data points for the specified metric. Optionally, you can request +// the data points to be aggregated by dimension group ( GroupBy ) and return only +// those data points that match your criteria ( Filter ). +// +// Constraints: +// +// - Must be a valid Performance Insights query. +type PerformanceInsightsMetricQuery struct { + + // A specification for how to aggregate the data points from a query result. You + // must specify a valid dimension group. Performance Insights will return all of + // the dimensions within that group, unless you provide the names of specific + // dimensions within that group. You can also request that Performance Insights + // return a limited number of values for a dimension. + GroupBy *PerformanceInsightsMetricDimensionGroup + + // The name of a Performance Insights metric to be measured. + // + // Valid Values: + // + // - db.load.avg - A scaled representation of the number of active sessions for + // the database engine. + // + // - db.sampledload.avg - The raw number of active sessions for the database + // engine. + // + // - The counter metrics listed in [Performance Insights operating system counters]in the Amazon Aurora User Guide. + // + // If the number of active sessions is less than an internal Performance Insights + // threshold, db.load.avg and db.sampledload.avg are the same value. If the number + // of active sessions is greater than the internal threshold, Performance Insights + // samples the active sessions, with db.load.avg showing the scaled values, + // db.sampledload.avg showing the raw values, and db.sampledload.avg less than + // db.load.avg . For most use cases, you can query db.load.avg only. + // + // [Performance Insights operating system counters]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS + Metric *string + + noSmithyDocumentSerde +} + +// Details of the performance issue. +type PerformanceIssueDetails struct { + + // The analysis of the performance issue. The information might contain markdown. + Analysis *string + + // The time when the performance issue stopped. + EndTime *time.Time + + // The metrics that are relevant to the performance issue. + Metrics []Metric + + // The time when the performance issue started. + StartTime *time.Time + + noSmithyDocumentSerde +} + +// Contains the processor features of a DB instance class. +// +// To specify the number of CPU cores, use the coreCount feature name for the Name +// parameter. To specify the number of threads per core, use the threadsPerCore +// feature name for the Name parameter. +// +// You can set the processor features of the DB instance class for a DB instance +// when you call one of the following actions: +// +// - CreateDBInstance +// +// - ModifyDBInstance +// +// - RestoreDBInstanceFromDBSnapshot +// +// - RestoreDBInstanceFromS3 +// +// - RestoreDBInstanceToPointInTime +// +// You can view the valid processor values for a particular instance class by +// calling the DescribeOrderableDBInstanceOptions action and specifying the +// instance class for the DBInstanceClass parameter. +// +// In addition, you can use the following actions for DB instance class processor +// information: +// +// - DescribeDBInstances +// +// - DescribeDBSnapshots +// +// - DescribeValidDBInstanceModifications +// +// If you call DescribeDBInstances , ProcessorFeature returns non-null values only +// if the following conditions are met: +// +// - You are accessing an Oracle DB instance. +// +// - Your Oracle DB instance class supports configuring the number of CPU cores +// and threads per core. +// +// - The current number CPU cores and threads is set to a non-default value. +// +// For more information, see [Configuring the processor for a DB instance class in RDS for Oracle] in the Amazon RDS User Guide. +// +// [Configuring the processor for a DB instance class in RDS for Oracle]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor +type ProcessorFeature struct { + + // The name of the processor feature. Valid names are coreCount and threadsPerCore . + Name *string + + // The value of a processor feature. + Value *string + + noSmithyDocumentSerde +} + +// A range of integer values. +type Range struct { + + // The minimum value in the range. + From *int32 + + // The step value for the range. For example, if you have a range of 5,000 to + // 10,000, with a step value of 1,000, the valid values start at 5,000 and step up + // by 1,000. Even though 7,500 is within the range, it isn't a valid value for the + // range. The valid values are 5,000, 6,000, 7,000, 8,000... + Step *int32 + + // The maximum value in the range. + To *int32 + + noSmithyDocumentSerde +} + +// Reserved for future use. +type RdsCustomClusterConfiguration struct { + + // Reserved for future use. + InterconnectSubnetId *string + + // Reserved for future use. + ReplicaMode ReplicaMode + + // Reserved for future use. + TransitGatewayMulticastDomainId *string + + noSmithyDocumentSerde +} + +// The recommended actions to apply to resolve the issues associated with your DB +// instances, DB clusters, and DB parameter groups. +type RecommendedAction struct { + + // The unique identifier of the recommended action. + ActionId *string + + // The methods to apply the recommended action. + // + // Valid values: + // + // - manual - The action requires you to resolve the recommendation manually. + // + // - immediately - The action is applied immediately. + // + // - next-maintainance-window - The action is applied during the next scheduled + // maintainance. + ApplyModes []string + + // The supporting attributes to explain the recommended action. + ContextAttributes []ContextAttribute + + // A detailed description of the action. The description might contain markdown. + Description *string + + // The details of the issue. + IssueDetails *IssueDetails + + // An API operation for the action. + Operation *string + + // The parameters for the API operation. + Parameters []RecommendedActionParameter + + // The status of the action. + // + // - ready + // + // - applied + // + // - scheduled + // + // - resolved + Status *string + + // A short description to summarize the action. The description might contain + // markdown. + Title *string + + noSmithyDocumentSerde +} + +// A single parameter to use with the RecommendedAction API operation to apply the +// action. +type RecommendedActionParameter struct { + + // The key of the parameter to use with the RecommendedAction API operation. + Key *string + + // The value of the parameter to use with the RecommendedAction API operation. + Value *string + + noSmithyDocumentSerde +} + +// The recommended status to update for the specified recommendation action ID. +type RecommendedActionUpdate struct { + + // A unique identifier of the updated recommendation action. + // + // This member is required. + ActionId *string + + // The status of the updated recommendation action. + // + // - applied + // + // - scheduled + // + // This member is required. + Status *string + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the DescribeReservedDBInstances +// and DescribeReservedDBInstancesOfferings actions. +type RecurringCharge struct { + + // The amount of the recurring charge. + RecurringChargeAmount *float64 + + // The frequency of the recurring charge. + RecurringChargeFrequency *string + + noSmithyDocumentSerde +} + +// The reference details of a metric. +type ReferenceDetails struct { + + // The metric reference details when the reference is a scalar. + ScalarReferenceDetails *ScalarReferenceDetails + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the DescribeReservedDBInstances +// and PurchaseReservedDBInstancesOffering actions. +type ReservedDBInstance struct { + + // The currency code for the reserved DB instance. + CurrencyCode *string + + // The DB instance class for the reserved DB instance. + DBInstanceClass *string + + // The number of reserved DB instances. + DBInstanceCount *int32 + + // The duration of the reservation in seconds. + Duration *int32 + + // The fixed price charged for this reserved DB instance. + FixedPrice *float64 + + // The unique identifier for the lease associated with the reserved DB instance. + // + // Amazon Web Services Support might request the lease ID for an issue related to + // a reserved DB instance. + LeaseId *string + + // Indicates whether the reservation applies to Multi-AZ deployments. + MultiAZ *bool + + // The offering type of this reserved DB instance. + OfferingType *string + + // The description of the reserved DB instance. + ProductDescription *string + + // The recurring price charged to run this reserved DB instance. + RecurringCharges []RecurringCharge + + // The Amazon Resource Name (ARN) for the reserved DB instance. + ReservedDBInstanceArn *string + + // The unique identifier for the reservation. + ReservedDBInstanceId *string + + // The offering identifier. + ReservedDBInstancesOfferingId *string + + // The time the reservation started. + StartTime *time.Time + + // The state of the reserved DB instance. + State *string + + // The hourly price charged for this reserved DB instance. + UsagePrice *float64 + + noSmithyDocumentSerde +} + +// This data type is used as a response element in the +// DescribeReservedDBInstancesOfferings action. +type ReservedDBInstancesOffering struct { + + // The currency code for the reserved DB instance offering. + CurrencyCode *string + + // The DB instance class for the reserved DB instance. + DBInstanceClass *string + + // The duration of the offering in seconds. + Duration *int32 + + // The fixed price charged for this offering. + FixedPrice *float64 + + // Indicates whether the offering applies to Multi-AZ deployments. + MultiAZ *bool + + // The offering type. + OfferingType *string + + // The database engine used by the offering. + ProductDescription *string + + // The recurring price charged to run this reserved DB instance. + RecurringCharges []RecurringCharge + + // The offering identifier. + ReservedDBInstancesOfferingId *string + + // The hourly price charged for this offering. + UsagePrice *float64 + + noSmithyDocumentSerde +} + +// Describes the pending maintenance actions for a resource. +type ResourcePendingMaintenanceActions struct { + + // A list that provides details about the pending maintenance actions for the + // resource. + PendingMaintenanceActionDetails []PendingMaintenanceAction + + // The ARN of the resource that has pending maintenance actions. + ResourceIdentifier *string + + noSmithyDocumentSerde +} + +// Earliest and latest time an instance can be restored to: +type RestoreWindow struct { + + // The earliest time you can restore an instance to. + EarliestTime *time.Time + + // The latest time you can restore an instance to. + LatestTime *time.Time + + noSmithyDocumentSerde +} + +// The metric reference details when the reference is a scalar. +type ScalarReferenceDetails struct { + + // The value of a scalar reference. + Value *float64 + + noSmithyDocumentSerde +} + +// Contains the scaling configuration of an Aurora Serverless v1 DB cluster. +// +// For more information, see [Using Amazon Aurora Serverless v1] in the Amazon Aurora User Guide. +// +// [Using Amazon Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html +type ScalingConfiguration struct { + + // Indicates whether to allow or disallow automatic pause for an Aurora DB cluster + // in serverless DB engine mode. A DB cluster can be paused only when it's idle + // (it has no connections). + // + // If a DB cluster is paused for more than seven days, the DB cluster might be + // backed up with a snapshot. In this case, the DB cluster is restored when there + // is a request to connect to it. + AutoPause *bool + + // The maximum capacity for an Aurora DB cluster in serverless DB engine mode. + // + // For Aurora MySQL, valid capacity values are 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , + // and 256 . + // + // For Aurora PostgreSQL, valid capacity values are 2 , 4 , 8 , 16 , 32 , 64 , 192 + // , and 384 . + // + // The maximum capacity must be greater than or equal to the minimum capacity. + MaxCapacity *int32 + + // The minimum capacity for an Aurora DB cluster in serverless DB engine mode. + // + // For Aurora MySQL, valid capacity values are 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , + // and 256 . + // + // For Aurora PostgreSQL, valid capacity values are 2 , 4 , 8 , 16 , 32 , 64 , 192 + // , and 384 . + // + // The minimum capacity must be less than or equal to the maximum capacity. + MinCapacity *int32 + + // The amount of time, in seconds, that Aurora Serverless v1 tries to find a + // scaling point to perform seamless scaling before enforcing the timeout action. + // The default is 300. + // + // Specify a value between 60 and 600 seconds. + SecondsBeforeTimeout *int32 + + // The time, in seconds, before an Aurora DB cluster in serverless mode is paused. + // + // Specify a value between 300 and 86,400 seconds. + SecondsUntilAutoPause *int32 + + // The action to take when the timeout is reached, either ForceApplyCapacityChange + // or RollbackCapacityChange . + // + // ForceApplyCapacityChange sets the capacity to the specified value as soon as + // possible. + // + // RollbackCapacityChange , the default, ignores the capacity change if a scaling + // point isn't found in the timeout period. + // + // If you specify ForceApplyCapacityChange , connections that prevent Aurora + // Serverless v1 from finding a scaling point might be dropped. + // + // For more information, see [Autoscaling for Aurora Serverless v1] in the Amazon Aurora User Guide. + // + // [Autoscaling for Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.auto-scaling + TimeoutAction *string + + noSmithyDocumentSerde +} + +// The scaling configuration for an Aurora DB cluster in serverless DB engine mode. +// +// For more information, see [Using Amazon Aurora Serverless v1] in the Amazon Aurora User Guide. +// +// [Using Amazon Aurora Serverless v1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html +type ScalingConfigurationInfo struct { + + // Indicates whether automatic pause is allowed for the Aurora DB cluster in + // serverless DB engine mode. + // + // When the value is set to false for an Aurora Serverless v1 DB cluster, the DB + // cluster automatically resumes. + AutoPause *bool + + // The maximum capacity for an Aurora DB cluster in serverless DB engine mode. + MaxCapacity *int32 + + // The minimum capacity for an Aurora DB cluster in serverless DB engine mode. + MinCapacity *int32 + + // The number of seconds before scaling times out. What happens when an attempted + // scaling action times out is determined by the TimeoutAction setting. + SecondsBeforeTimeout *int32 + + // The remaining amount of time, in seconds, before the Aurora DB cluster in + // serverless mode is paused. A DB cluster can be paused only when it's idle (it + // has no connections). + SecondsUntilAutoPause *int32 + + // The action that occurs when Aurora times out while attempting to change the + // capacity of an Aurora Serverless v1 cluster. The value is either + // ForceApplyCapacityChange or RollbackCapacityChange . + // + // ForceApplyCapacityChange , the default, sets the capacity to the specified value + // as soon as possible. + // + // RollbackCapacityChange ignores the capacity change if a scaling point isn't + // found in the timeout period. + TimeoutAction *string + + noSmithyDocumentSerde +} + +// Specifies any Aurora Serverless v2 properties or limits that differ between +// Aurora engine versions. You can test the values of this attribute when deciding +// which Aurora version to use in a new or upgraded DB cluster. You can also +// retrieve the version of an existing DB cluster and check whether that version +// supports certain Aurora Serverless v2 features before you attempt to use those +// features. +type ServerlessV2FeaturesSupport struct { + + // Specifies the upper Aurora Serverless v2 capacity limit for a particular + // engine version. Depending on the engine version, the maximum capacity for an + // Aurora Serverless v2 cluster might be 256 or 128 . + MaxCapacity *float64 + + // If the minimum capacity is 0 ACUs, the engine version supports the automatic + // pause/resume feature of Aurora Serverless v2. + MinCapacity *float64 + + noSmithyDocumentSerde +} + +// Contains the scaling configuration of an Aurora Serverless v2 DB cluster. +// +// For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. +// +// [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html +type ServerlessV2ScalingConfiguration struct { + + // The maximum number of Aurora capacity units (ACUs) for a DB instance in an + // Aurora Serverless v2 cluster. You can specify ACU values in half-step + // increments, such as 32, 32.5, 33, and so on. The largest value that you can use + // is 256 for recent Aurora versions, or 128 for older versions. + MaxCapacity *float64 + + // The minimum number of Aurora capacity units (ACUs) for a DB instance in an + // Aurora Serverless v2 cluster. You can specify ACU values in half-step + // increments, such as 8, 8.5, 9, and so on. For Aurora versions that support the + // Aurora Serverless v2 auto-pause feature, the smallest value that you can use is + // 0. For versions that don't support Aurora Serverless v2 auto-pause, the smallest + // value that you can use is 0.5. + MinCapacity *float64 + + // Specifies the number of seconds an Aurora Serverless v2 DB instance must be + // idle before Aurora attempts to automatically pause it. + // + // Specify a value between 300 seconds (five minutes) and 86,400 seconds (one + // day). The default is 300 seconds. + SecondsUntilAutoPause *int32 + + noSmithyDocumentSerde +} + +// The scaling configuration for an Aurora Serverless v2 DB cluster. +// +// For more information, see [Using Amazon Aurora Serverless v2] in the Amazon Aurora User Guide. +// +// [Using Amazon Aurora Serverless v2]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html +type ServerlessV2ScalingConfigurationInfo struct { + + // The maximum number of Aurora capacity units (ACUs) for a DB instance in an + // Aurora Serverless v2 cluster. You can specify ACU values in half-step + // increments, such as 32, 32.5, 33, and so on. The largest value that you can use + // is 256 for recent Aurora versions, or 128 for older versions. + MaxCapacity *float64 + + // The minimum number of Aurora capacity units (ACUs) for a DB instance in an + // Aurora Serverless v2 cluster. You can specify ACU values in half-step + // increments, such as 8, 8.5, 9, and so on. For Aurora versions that support the + // Aurora Serverless v2 auto-pause feature, the smallest value that you can use is + // 0. For versions that don't support Aurora Serverless v2 auto-pause, the smallest + // value that you can use is 0.5. + MinCapacity *float64 + + // The number of seconds an Aurora Serverless v2 DB instance must be idle before + // Aurora attempts to automatically pause it. This property is only shown when the + // minimum capacity for the cluster is set to 0 ACUs. Changing the minimum capacity + // to a nonzero value removes this property. If you later change the minimum + // capacity back to 0 ACUs, this property is reset to its default value unless you + // specify it again. + // + // This value ranges between 300 seconds (five minutes) and 86,400 seconds (one + // day). The default is 300 seconds. + SecondsUntilAutoPause *int32 + + noSmithyDocumentSerde +} + +// Contains an Amazon Web Services Region name as the result of a successful call +// to the DescribeSourceRegions action. +type SourceRegion struct { + + // The endpoint for the source Amazon Web Services Region endpoint. + Endpoint *string + + // The name of the source Amazon Web Services Region. + RegionName *string + + // The status of the source Amazon Web Services Region. + Status *string + + // Indicates whether the source Amazon Web Services Region supports replicating + // automated backups to the current Amazon Web Services Region. + SupportsDBInstanceAutomatedBackupsReplication *bool + + noSmithyDocumentSerde +} + +// This data type is used as a response element for the DescribeDBSubnetGroups +// operation. +type Subnet struct { + + // Contains Availability Zone information. + // + // This data type is used as an element in the OrderableDBInstanceOption data type. + SubnetAvailabilityZone *AvailabilityZone + + // The identifier of the subnet. + SubnetIdentifier *string + + // If the subnet is associated with an Outpost, this value specifies the Outpost. + // + // For more information about RDS on Outposts, see [Amazon RDS on Amazon Web Services Outposts] in the Amazon RDS User Guide. + // + // [Amazon RDS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html + SubnetOutpost *Outpost + + // The status of the subnet. + SubnetStatus *string + + noSmithyDocumentSerde +} + +// Contains the details about a blue/green deployment. +// +// For more information, see [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon RDS User Guide and [Using Amazon RDS Blue/Green Deployments for database updates] in the Amazon +// Aurora User Guide. +// +// [Using Amazon RDS Blue/Green Deployments for database updates]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html +type SwitchoverDetail struct { + + // The Amazon Resource Name (ARN) of a resource in the blue environment. + SourceMember *string + + // The switchover status of a resource in a blue/green deployment. + // + // Values: + // + // - PROVISIONING - The resource is being prepared to switch over. + // + // - AVAILABLE - The resource is ready to switch over. + // + // - SWITCHOVER_IN_PROGRESS - The resource is being switched over. + // + // - SWITCHOVER_COMPLETED - The resource has been switched over. + // + // - SWITCHOVER_FAILED - The resource attempted to switch over but failed. + // + // - MISSING_SOURCE - The source resource has been deleted. + // + // - MISSING_TARGET - The target resource has been deleted. + Status *string + + // The Amazon Resource Name (ARN) of a resource in the green environment. + TargetMember *string + + noSmithyDocumentSerde +} + +// Metadata assigned to an Amazon RDS resource consisting of a key-value pair. +// +// For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon +// Aurora User Guide. +// +// [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html +// [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html +type Tag struct { + + // A key is the required name of the tag. The string value can be from 1 to 128 + // Unicode characters in length and can't be prefixed with aws: or rds: . The + // string can only contain only the set of Unicode letters, digits, white-space, + // '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + // "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"). + Key *string + + // A value is the optional value of the tag. The string value can be from 1 to 256 + // Unicode characters in length and can't be prefixed with aws: or rds: . The + // string can only contain only the set of Unicode letters, digits, white-space, + // '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: + // "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"). + Value *string + + noSmithyDocumentSerde +} + +// Information about the connection health of an RDS Proxy target. +type TargetHealth struct { + + // A description of the health of the RDS Proxy target. If the State is AVAILABLE , + // a description is not included. + Description *string + + // The reason for the current health State of the RDS Proxy target. + Reason TargetHealthReason + + // The current state of the connection health lifecycle for the RDS Proxy target. + // The following is a typical lifecycle example for the states of an RDS Proxy + // target: + // + // registering > unavailable > available > unavailable > available + State TargetState + + noSmithyDocumentSerde +} + +// A tenant database in the DB instance. This data type is an element in the +// response to the DescribeTenantDatabases action. +type TenantDatabase struct { + + // The character set of the tenant database. + CharacterSetName *string + + // The ID of the DB instance that contains the tenant database. + DBInstanceIdentifier *string + + // The Amazon Web Services Region-unique, immutable identifier for the DB instance. + DbiResourceId *string + + // Specifies whether deletion protection is enabled for the DB instance. + DeletionProtection *bool + + // The master username of the tenant database. + MasterUsername *string + + // The NCHAR character set name of the tenant database. + NcharCharacterSetName *string + + // Information about pending changes for a tenant database. + PendingModifiedValues *TenantDatabasePendingModifiedValues + + // The status of the tenant database. + Status *string + + // A list of tags. + // + // For more information, see [Tagging Amazon RDS resources] in the Amazon RDS User Guide or [Tagging Amazon Aurora and Amazon RDS resources] in the Amazon + // Aurora User Guide. + // + // [Tagging Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html + // [Tagging Amazon Aurora and Amazon RDS resources]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html + TagList []Tag + + // The database name of the tenant database. + TenantDBName *string + + // The Amazon Resource Name (ARN) for the tenant database. + TenantDatabaseARN *string + + // The creation time of the tenant database. + TenantDatabaseCreateTime *time.Time + + // The Amazon Web Services Region-unique, immutable identifier for the tenant + // database. + TenantDatabaseResourceId *string + + noSmithyDocumentSerde +} + +// A response element in the ModifyTenantDatabase operation that describes changes +// that will be applied. Specific changes are identified by subelements. +type TenantDatabasePendingModifiedValues struct { + + // The master password for the tenant database. + MasterUserPassword *string + + // The name of the tenant database. + TenantDBName *string + + noSmithyDocumentSerde +} + +// A time zone associated with a DBInstance or a DBSnapshot . This data type is an +// element in the response to the DescribeDBInstances , the DescribeDBSnapshots , +// and the DescribeDBEngineVersions actions. +type Timezone struct { + + // The name of the time zone. + TimezoneName *string + + noSmithyDocumentSerde +} + +// The version of the database engine that a DB instance can be upgraded to. +type UpgradeTarget struct { + + // Indicates whether the target version is applied to any source DB instances that + // have AutoMinorVersionUpgrade set to true. + // + // This parameter is dynamic, and is set by RDS. + AutoUpgrade *bool + + // The version of the database engine that a DB instance can be upgraded to. + Description *string + + // The name of the upgrade target database engine. + Engine *string + + // The version number of the upgrade target database engine. + EngineVersion *string + + // Indicates whether upgrading to the target version requires upgrading the major + // version of the database engine. + IsMajorVersionUpgrade *bool + + // A list of the supported DB engine modes for the target engine version. + SupportedEngineModes []string + + // Indicates whether you can use Babelfish for Aurora PostgreSQL with the target + // engine version. + SupportsBabelfish *bool + + // Indicates whether you can use Aurora global databases with the target engine + // version. + SupportsGlobalDatabases *bool + + // Indicates whether the DB engine version supports zero-ETL integrations with + // Amazon Redshift. + SupportsIntegrations *bool + + // Indicates whether the DB engine version supports Aurora Limitless Database. + SupportsLimitlessDatabase *bool + + // Indicates whether the target engine version supports forwarding write + // operations from reader DB instances to the writer DB instance in the DB cluster. + // By default, write operations aren't allowed on reader DB instances. + // + // Valid for: Aurora DB clusters only + SupportsLocalWriteForwarding *bool + + // Indicates whether you can use Aurora parallel query with the target engine + // version. + SupportsParallelQuery *bool + + noSmithyDocumentSerde +} + +// Specifies the details of authentication used by a proxy to log in as a specific +// database user. +type UserAuthConfig struct { + + // The type of authentication that the proxy uses for connections from the proxy + // to the underlying database. + AuthScheme AuthScheme + + // The type of authentication the proxy uses for connections from clients. + ClientPasswordAuthType ClientPasswordAuthType + + // A user-specified description about the authentication used by a proxy to log in + // as a specific database user. + Description *string + + // A value that indicates whether to require or disallow Amazon Web Services + // Identity and Access Management (IAM) authentication for connections to the + // proxy. The ENABLED value is valid only for proxies with RDS for Microsoft SQL + // Server. + IAMAuth IAMAuthMode + + // The Amazon Resource Name (ARN) representing the secret that the proxy uses to + // authenticate to the RDS DB instance or Aurora DB cluster. These secrets are + // stored within Amazon Secrets Manager. + SecretArn *string + + // The name of the database user to which the proxy connects. + UserName *string + + noSmithyDocumentSerde +} + +// Returns the details of authentication used by a proxy to log in as a specific +// database user. +type UserAuthConfigInfo struct { + + // The type of authentication that the proxy uses for connections from the proxy + // to the underlying database. + AuthScheme AuthScheme + + // The type of authentication the proxy uses for connections from clients. + ClientPasswordAuthType ClientPasswordAuthType + + // A user-specified description about the authentication used by a proxy to log in + // as a specific database user. + Description *string + + // Whether to require or disallow Amazon Web Services Identity and Access + // Management (IAM) authentication for connections to the proxy. The ENABLED value + // is valid only for proxies with RDS for Microsoft SQL Server. + IAMAuth IAMAuthMode + + // The Amazon Resource Name (ARN) representing the secret that the proxy uses to + // authenticate to the RDS DB instance or Aurora DB cluster. These secrets are + // stored within Amazon Secrets Manager. + SecretArn *string + + // The name of the database user to which the proxy connects. + UserName *string + + noSmithyDocumentSerde +} + +// Information about valid modifications that you can make to your DB instance. +// Contains the result of a successful call to the +// DescribeValidDBInstanceModifications action. You can use this information when +// you call ModifyDBInstance . +type ValidDBInstanceModificationsMessage struct { + + // Valid storage options for your DB instance. + Storage []ValidStorageOptions + + // Indicates whether a DB instance supports using a dedicated log volume (DLV). + SupportsDedicatedLogVolume *bool + + // Valid processor features for your DB instance. + ValidProcessorFeatures []AvailableProcessorFeature + + noSmithyDocumentSerde +} + +// Information about valid modifications that you can make to your DB instance. +// Contains the result of a successful call to the +// DescribeValidDBInstanceModifications action. +type ValidStorageOptions struct { + + // The valid range of Provisioned IOPS to gibibytes of storage multiplier. For + // example, 3-10, which means that provisioned IOPS can be between 3 and 10 times + // storage. + IopsToStorageRatio []DoubleRange + + // The valid range of provisioned IOPS. For example, 1000-256,000. + ProvisionedIops []Range + + // The valid range of provisioned storage throughput. For example, 500-4,000 + // mebibytes per second (MiBps). + ProvisionedStorageThroughput []Range + + // The valid range of storage in gibibytes (GiB). For example, 100 to 16,384. + StorageSize []Range + + // The valid range of storage throughput to provisioned IOPS ratios. For example, + // 0-0.25. + StorageThroughputToIopsRatio []DoubleRange + + // The valid storage types for your DB instance. For example: gp2, gp3, io1, io2. + StorageType *string + + // Indicates whether or not Amazon RDS can automatically scale storage for DB + // instances that use the new instance class. + SupportsStorageAutoscaling *bool + + noSmithyDocumentSerde +} + +// This data type is used as a response element for queries on VPC security group +// membership. +type VpcSecurityGroupMembership struct { + + // The membership status of the VPC security group. + // + // Currently, the only valid status is active . + Status *string + + // The name of the VPC security group. + VpcSecurityGroupId *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/rds/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/validators.go new file mode 100644 index 00000000..1e6432ec --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/rds/validators.go @@ -0,0 +1,6546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAddRoleToDBCluster struct { +} + +func (*validateOpAddRoleToDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddRoleToDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddRoleToDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddRoleToDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAddRoleToDBInstance struct { +} + +func (*validateOpAddRoleToDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddRoleToDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddRoleToDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddRoleToDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAddSourceIdentifierToSubscription struct { +} + +func (*validateOpAddSourceIdentifierToSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddSourceIdentifierToSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddSourceIdentifierToSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddSourceIdentifierToSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAddTagsToResource struct { +} + +func (*validateOpAddTagsToResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddTagsToResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddTagsToResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddTagsToResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpApplyPendingMaintenanceAction struct { +} + +func (*validateOpApplyPendingMaintenanceAction) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpApplyPendingMaintenanceAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ApplyPendingMaintenanceActionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpApplyPendingMaintenanceActionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAuthorizeDBSecurityGroupIngress struct { +} + +func (*validateOpAuthorizeDBSecurityGroupIngress) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAuthorizeDBSecurityGroupIngress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AuthorizeDBSecurityGroupIngressInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAuthorizeDBSecurityGroupIngressInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBacktrackDBCluster struct { +} + +func (*validateOpBacktrackDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBacktrackDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BacktrackDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBacktrackDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCancelExportTask struct { +} + +func (*validateOpCancelExportTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelExportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelExportTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelExportTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCopyDBClusterParameterGroup struct { +} + +func (*validateOpCopyDBClusterParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyDBClusterParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyDBClusterParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyDBClusterParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCopyDBClusterSnapshot struct { +} + +func (*validateOpCopyDBClusterSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyDBClusterSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyDBClusterSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyDBClusterSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCopyDBParameterGroup struct { +} + +func (*validateOpCopyDBParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyDBParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyDBParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyDBParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCopyDBSnapshot struct { +} + +func (*validateOpCopyDBSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyDBSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyDBSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyDBSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCopyOptionGroup struct { +} + +func (*validateOpCopyOptionGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyOptionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyOptionGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyOptionGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateBlueGreenDeployment struct { +} + +func (*validateOpCreateBlueGreenDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateBlueGreenDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateBlueGreenDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateBlueGreenDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateCustomDBEngineVersion struct { +} + +func (*validateOpCreateCustomDBEngineVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCustomDBEngineVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCustomDBEngineVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCustomDBEngineVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBClusterEndpoint struct { +} + +func (*validateOpCreateDBClusterEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBClusterEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBClusterEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBClusterEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBCluster struct { +} + +func (*validateOpCreateDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBClusterParameterGroup struct { +} + +func (*validateOpCreateDBClusterParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBClusterParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBClusterParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBClusterParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBClusterSnapshot struct { +} + +func (*validateOpCreateDBClusterSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBClusterSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBClusterSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBClusterSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBInstance struct { +} + +func (*validateOpCreateDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBInstanceReadReplica struct { +} + +func (*validateOpCreateDBInstanceReadReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBInstanceReadReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBInstanceReadReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBInstanceReadReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBParameterGroup struct { +} + +func (*validateOpCreateDBParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBProxyEndpoint struct { +} + +func (*validateOpCreateDBProxyEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBProxyEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBProxyEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBProxyEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBProxy struct { +} + +func (*validateOpCreateDBProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBSecurityGroup struct { +} + +func (*validateOpCreateDBSecurityGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBSecurityGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBSecurityGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBSecurityGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBShardGroup struct { +} + +func (*validateOpCreateDBShardGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBShardGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBShardGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBShardGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBSnapshot struct { +} + +func (*validateOpCreateDBSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDBSubnetGroup struct { +} + +func (*validateOpCreateDBSubnetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDBSubnetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDBSubnetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDBSubnetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateEventSubscription struct { +} + +func (*validateOpCreateEventSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEventSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEventSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEventSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateIntegration struct { +} + +func (*validateOpCreateIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateOptionGroup struct { +} + +func (*validateOpCreateOptionGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateOptionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateOptionGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateOptionGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTenantDatabase struct { +} + +func (*validateOpCreateTenantDatabase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTenantDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTenantDatabaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTenantDatabaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteBlueGreenDeployment struct { +} + +func (*validateOpDeleteBlueGreenDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteBlueGreenDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteBlueGreenDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteBlueGreenDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCustomDBEngineVersion struct { +} + +func (*validateOpDeleteCustomDBEngineVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCustomDBEngineVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCustomDBEngineVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCustomDBEngineVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBClusterAutomatedBackup struct { +} + +func (*validateOpDeleteDBClusterAutomatedBackup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBClusterAutomatedBackup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBClusterAutomatedBackupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBClusterAutomatedBackupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBClusterEndpoint struct { +} + +func (*validateOpDeleteDBClusterEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBClusterEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBClusterEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBClusterEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBCluster struct { +} + +func (*validateOpDeleteDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBClusterParameterGroup struct { +} + +func (*validateOpDeleteDBClusterParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBClusterParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBClusterParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBClusterParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBClusterSnapshot struct { +} + +func (*validateOpDeleteDBClusterSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBClusterSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBClusterSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBClusterSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBInstance struct { +} + +func (*validateOpDeleteDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBParameterGroup struct { +} + +func (*validateOpDeleteDBParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBProxyEndpoint struct { +} + +func (*validateOpDeleteDBProxyEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBProxyEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBProxyEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBProxyEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBProxy struct { +} + +func (*validateOpDeleteDBProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBSecurityGroup struct { +} + +func (*validateOpDeleteDBSecurityGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBSecurityGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBSecurityGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBSecurityGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBShardGroup struct { +} + +func (*validateOpDeleteDBShardGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBShardGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBShardGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBShardGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBSnapshot struct { +} + +func (*validateOpDeleteDBSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDBSubnetGroup struct { +} + +func (*validateOpDeleteDBSubnetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDBSubnetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDBSubnetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDBSubnetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteEventSubscription struct { +} + +func (*validateOpDeleteEventSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEventSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEventSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEventSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteGlobalCluster struct { +} + +func (*validateOpDeleteGlobalCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteGlobalCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteGlobalClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteGlobalClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIntegration struct { +} + +func (*validateOpDeleteIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteOptionGroup struct { +} + +func (*validateOpDeleteOptionGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteOptionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteOptionGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteOptionGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteTenantDatabase struct { +} + +func (*validateOpDeleteTenantDatabase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTenantDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTenantDatabaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTenantDatabaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterDBProxyTargets struct { +} + +func (*validateOpDeregisterDBProxyTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterDBProxyTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterDBProxyTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterDBProxyTargetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeBlueGreenDeployments struct { +} + +func (*validateOpDescribeBlueGreenDeployments) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeBlueGreenDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeBlueGreenDeploymentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeBlueGreenDeploymentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeCertificates struct { +} + +func (*validateOpDescribeCertificates) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeCertificates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeCertificatesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeCertificatesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterAutomatedBackups struct { +} + +func (*validateOpDescribeDBClusterAutomatedBackups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterAutomatedBackups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterAutomatedBackupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterAutomatedBackupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterBacktracks struct { +} + +func (*validateOpDescribeDBClusterBacktracks) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterBacktracks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterBacktracksInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterBacktracksInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterEndpoints struct { +} + +func (*validateOpDescribeDBClusterEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterParameterGroups struct { +} + +func (*validateOpDescribeDBClusterParameterGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterParameterGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterParameterGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterParameterGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterParameters struct { +} + +func (*validateOpDescribeDBClusterParameters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterParametersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterParametersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusters struct { +} + +func (*validateOpDescribeDBClusters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClustersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClustersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterSnapshotAttributes struct { +} + +func (*validateOpDescribeDBClusterSnapshotAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterSnapshotAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterSnapshotAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterSnapshotAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBClusterSnapshots struct { +} + +func (*validateOpDescribeDBClusterSnapshots) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBClusterSnapshots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBClusterSnapshotsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBClusterSnapshotsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBEngineVersions struct { +} + +func (*validateOpDescribeDBEngineVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBEngineVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBEngineVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBEngineVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBInstanceAutomatedBackups struct { +} + +func (*validateOpDescribeDBInstanceAutomatedBackups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBInstanceAutomatedBackups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBInstanceAutomatedBackupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBInstanceAutomatedBackupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBInstances struct { +} + +func (*validateOpDescribeDBInstances) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBInstancesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBInstancesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBLogFiles struct { +} + +func (*validateOpDescribeDBLogFiles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBLogFiles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBLogFilesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBLogFilesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBParameterGroups struct { +} + +func (*validateOpDescribeDBParameterGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBParameterGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBParameterGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBParameterGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBParameters struct { +} + +func (*validateOpDescribeDBParameters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBParametersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBParametersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBProxies struct { +} + +func (*validateOpDescribeDBProxies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBProxies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBProxiesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBProxiesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBProxyEndpoints struct { +} + +func (*validateOpDescribeDBProxyEndpoints) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBProxyEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBProxyEndpointsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBProxyEndpointsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBProxyTargetGroups struct { +} + +func (*validateOpDescribeDBProxyTargetGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBProxyTargetGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBProxyTargetGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBProxyTargetGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBProxyTargets struct { +} + +func (*validateOpDescribeDBProxyTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBProxyTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBProxyTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBProxyTargetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBRecommendations struct { +} + +func (*validateOpDescribeDBRecommendations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBRecommendationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBRecommendationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBSecurityGroups struct { +} + +func (*validateOpDescribeDBSecurityGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBSecurityGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBSecurityGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBSecurityGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBShardGroups struct { +} + +func (*validateOpDescribeDBShardGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBShardGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBShardGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBShardGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBSnapshotAttributes struct { +} + +func (*validateOpDescribeDBSnapshotAttributes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBSnapshotAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBSnapshotAttributesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBSnapshotAttributesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBSnapshots struct { +} + +func (*validateOpDescribeDBSnapshots) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBSnapshots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBSnapshotsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBSnapshotsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBSnapshotTenantDatabases struct { +} + +func (*validateOpDescribeDBSnapshotTenantDatabases) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBSnapshotTenantDatabases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBSnapshotTenantDatabasesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBSnapshotTenantDatabasesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeDBSubnetGroups struct { +} + +func (*validateOpDescribeDBSubnetGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDBSubnetGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDBSubnetGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDBSubnetGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeEngineDefaultClusterParameters struct { +} + +func (*validateOpDescribeEngineDefaultClusterParameters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEngineDefaultClusterParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEngineDefaultClusterParametersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEngineDefaultClusterParametersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeEngineDefaultParameters struct { +} + +func (*validateOpDescribeEngineDefaultParameters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEngineDefaultParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEngineDefaultParametersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEngineDefaultParametersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeEventCategories struct { +} + +func (*validateOpDescribeEventCategories) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEventCategories) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEventCategoriesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEventCategoriesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeEvents struct { +} + +func (*validateOpDescribeEvents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEventsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEventsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeEventSubscriptions struct { +} + +func (*validateOpDescribeEventSubscriptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEventSubscriptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEventSubscriptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEventSubscriptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeExportTasks struct { +} + +func (*validateOpDescribeExportTasks) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeExportTasks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeExportTasksInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeExportTasksInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeGlobalClusters struct { +} + +func (*validateOpDescribeGlobalClusters) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeGlobalClusters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeGlobalClustersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeGlobalClustersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeIntegrations struct { +} + +func (*validateOpDescribeIntegrations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeIntegrations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeIntegrationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeIntegrationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeOptionGroupOptions struct { +} + +func (*validateOpDescribeOptionGroupOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeOptionGroupOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeOptionGroupOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeOptionGroupOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeOptionGroups struct { +} + +func (*validateOpDescribeOptionGroups) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeOptionGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeOptionGroupsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeOptionGroupsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeOrderableDBInstanceOptions struct { +} + +func (*validateOpDescribeOrderableDBInstanceOptions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeOrderableDBInstanceOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeOrderableDBInstanceOptionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeOrderableDBInstanceOptionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribePendingMaintenanceActions struct { +} + +func (*validateOpDescribePendingMaintenanceActions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribePendingMaintenanceActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribePendingMaintenanceActionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribePendingMaintenanceActionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeReservedDBInstances struct { +} + +func (*validateOpDescribeReservedDBInstances) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeReservedDBInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeReservedDBInstancesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeReservedDBInstancesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeReservedDBInstancesOfferings struct { +} + +func (*validateOpDescribeReservedDBInstancesOfferings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeReservedDBInstancesOfferings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeReservedDBInstancesOfferingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeReservedDBInstancesOfferingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeSourceRegions struct { +} + +func (*validateOpDescribeSourceRegions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeSourceRegions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeSourceRegionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeSourceRegionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeTenantDatabases struct { +} + +func (*validateOpDescribeTenantDatabases) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeTenantDatabases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeTenantDatabasesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeTenantDatabasesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeValidDBInstanceModifications struct { +} + +func (*validateOpDescribeValidDBInstanceModifications) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeValidDBInstanceModifications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeValidDBInstanceModificationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeValidDBInstanceModificationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisableHttpEndpoint struct { +} + +func (*validateOpDisableHttpEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableHttpEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableHttpEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableHttpEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDownloadDBLogFilePortion struct { +} + +func (*validateOpDownloadDBLogFilePortion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDownloadDBLogFilePortion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DownloadDBLogFilePortionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDownloadDBLogFilePortionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpEnableHttpEndpoint struct { +} + +func (*validateOpEnableHttpEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableHttpEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableHttpEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableHttpEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpFailoverDBCluster struct { +} + +func (*validateOpFailoverDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpFailoverDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*FailoverDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpFailoverDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpFailoverGlobalCluster struct { +} + +func (*validateOpFailoverGlobalCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpFailoverGlobalCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*FailoverGlobalClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpFailoverGlobalClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyCurrentDBClusterCapacity struct { +} + +func (*validateOpModifyCurrentDBClusterCapacity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyCurrentDBClusterCapacity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyCurrentDBClusterCapacityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyCurrentDBClusterCapacityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyCustomDBEngineVersion struct { +} + +func (*validateOpModifyCustomDBEngineVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyCustomDBEngineVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyCustomDBEngineVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyCustomDBEngineVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBClusterEndpoint struct { +} + +func (*validateOpModifyDBClusterEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBClusterEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBClusterEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBClusterEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBCluster struct { +} + +func (*validateOpModifyDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBClusterParameterGroup struct { +} + +func (*validateOpModifyDBClusterParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBClusterParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBClusterParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBClusterParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBClusterSnapshotAttribute struct { +} + +func (*validateOpModifyDBClusterSnapshotAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBClusterSnapshotAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBClusterSnapshotAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBClusterSnapshotAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBInstance struct { +} + +func (*validateOpModifyDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBParameterGroup struct { +} + +func (*validateOpModifyDBParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBProxyEndpoint struct { +} + +func (*validateOpModifyDBProxyEndpoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBProxyEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBProxyEndpointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBProxyEndpointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBProxy struct { +} + +func (*validateOpModifyDBProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBProxyTargetGroup struct { +} + +func (*validateOpModifyDBProxyTargetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBProxyTargetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBProxyTargetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBProxyTargetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBRecommendation struct { +} + +func (*validateOpModifyDBRecommendation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBRecommendationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBRecommendationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBShardGroup struct { +} + +func (*validateOpModifyDBShardGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBShardGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBShardGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBShardGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBSnapshotAttribute struct { +} + +func (*validateOpModifyDBSnapshotAttribute) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBSnapshotAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBSnapshotAttributeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBSnapshotAttributeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBSnapshot struct { +} + +func (*validateOpModifyDBSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyDBSubnetGroup struct { +} + +func (*validateOpModifyDBSubnetGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyDBSubnetGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyDBSubnetGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyDBSubnetGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyEventSubscription struct { +} + +func (*validateOpModifyEventSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyEventSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyEventSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyEventSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyIntegration struct { +} + +func (*validateOpModifyIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyOptionGroup struct { +} + +func (*validateOpModifyOptionGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyOptionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyOptionGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyOptionGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyTenantDatabase struct { +} + +func (*validateOpModifyTenantDatabase) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyTenantDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyTenantDatabaseInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyTenantDatabaseInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPromoteReadReplicaDBCluster struct { +} + +func (*validateOpPromoteReadReplicaDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPromoteReadReplicaDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PromoteReadReplicaDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPromoteReadReplicaDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPromoteReadReplica struct { +} + +func (*validateOpPromoteReadReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPromoteReadReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PromoteReadReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPromoteReadReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPurchaseReservedDBInstancesOffering struct { +} + +func (*validateOpPurchaseReservedDBInstancesOffering) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPurchaseReservedDBInstancesOffering) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PurchaseReservedDBInstancesOfferingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPurchaseReservedDBInstancesOfferingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRebootDBCluster struct { +} + +func (*validateOpRebootDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRebootDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RebootDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRebootDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRebootDBInstance struct { +} + +func (*validateOpRebootDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRebootDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RebootDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRebootDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRebootDBShardGroup struct { +} + +func (*validateOpRebootDBShardGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRebootDBShardGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RebootDBShardGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRebootDBShardGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterDBProxyTargets struct { +} + +func (*validateOpRegisterDBProxyTargets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterDBProxyTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterDBProxyTargetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterDBProxyTargetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveRoleFromDBCluster struct { +} + +func (*validateOpRemoveRoleFromDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveRoleFromDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveRoleFromDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveRoleFromDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveRoleFromDBInstance struct { +} + +func (*validateOpRemoveRoleFromDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveRoleFromDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveRoleFromDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveRoleFromDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveSourceIdentifierFromSubscription struct { +} + +func (*validateOpRemoveSourceIdentifierFromSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveSourceIdentifierFromSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveSourceIdentifierFromSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveSourceIdentifierFromSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRemoveTagsFromResource struct { +} + +func (*validateOpRemoveTagsFromResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRemoveTagsFromResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RemoveTagsFromResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRemoveTagsFromResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpResetDBClusterParameterGroup struct { +} + +func (*validateOpResetDBClusterParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResetDBClusterParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResetDBClusterParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResetDBClusterParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpResetDBParameterGroup struct { +} + +func (*validateOpResetDBParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResetDBParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResetDBParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResetDBParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBClusterFromS3 struct { +} + +func (*validateOpRestoreDBClusterFromS3) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBClusterFromS3) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBClusterFromS3Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBClusterFromS3Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBClusterFromSnapshot struct { +} + +func (*validateOpRestoreDBClusterFromSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBClusterFromSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBClusterFromSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBClusterFromSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBClusterToPointInTime struct { +} + +func (*validateOpRestoreDBClusterToPointInTime) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBClusterToPointInTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBClusterToPointInTimeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBClusterToPointInTimeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBInstanceFromDBSnapshot struct { +} + +func (*validateOpRestoreDBInstanceFromDBSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBInstanceFromDBSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBInstanceFromDBSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBInstanceFromDBSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBInstanceFromS3 struct { +} + +func (*validateOpRestoreDBInstanceFromS3) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBInstanceFromS3) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBInstanceFromS3Input) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBInstanceFromS3Input(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreDBInstanceToPointInTime struct { +} + +func (*validateOpRestoreDBInstanceToPointInTime) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreDBInstanceToPointInTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreDBInstanceToPointInTimeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreDBInstanceToPointInTimeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRevokeDBSecurityGroupIngress struct { +} + +func (*validateOpRevokeDBSecurityGroupIngress) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRevokeDBSecurityGroupIngress) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RevokeDBSecurityGroupIngressInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRevokeDBSecurityGroupIngressInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartActivityStream struct { +} + +func (*validateOpStartActivityStream) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartActivityStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartActivityStreamInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartActivityStreamInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDBCluster struct { +} + +func (*validateOpStartDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDBInstanceAutomatedBackupsReplication struct { +} + +func (*validateOpStartDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDBInstanceAutomatedBackupsReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDBInstanceAutomatedBackupsReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDBInstanceAutomatedBackupsReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDBInstance struct { +} + +func (*validateOpStartDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartExportTask struct { +} + +func (*validateOpStartExportTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartExportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartExportTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartExportTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopActivityStream struct { +} + +func (*validateOpStopActivityStream) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopActivityStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopActivityStreamInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopActivityStreamInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopDBCluster struct { +} + +func (*validateOpStopDBCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopDBCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopDBClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopDBClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopDBInstanceAutomatedBackupsReplication struct { +} + +func (*validateOpStopDBInstanceAutomatedBackupsReplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopDBInstanceAutomatedBackupsReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopDBInstanceAutomatedBackupsReplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopDBInstanceAutomatedBackupsReplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStopDBInstance struct { +} + +func (*validateOpStopDBInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopDBInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopDBInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopDBInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSwitchoverBlueGreenDeployment struct { +} + +func (*validateOpSwitchoverBlueGreenDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSwitchoverBlueGreenDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SwitchoverBlueGreenDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSwitchoverBlueGreenDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSwitchoverGlobalCluster struct { +} + +func (*validateOpSwitchoverGlobalCluster) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSwitchoverGlobalCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SwitchoverGlobalClusterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSwitchoverGlobalClusterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSwitchoverReadReplica struct { +} + +func (*validateOpSwitchoverReadReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSwitchoverReadReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SwitchoverReadReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSwitchoverReadReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAddRoleToDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddRoleToDBCluster{}, middleware.After) +} + +func addOpAddRoleToDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddRoleToDBInstance{}, middleware.After) +} + +func addOpAddSourceIdentifierToSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddSourceIdentifierToSubscription{}, middleware.After) +} + +func addOpAddTagsToResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddTagsToResource{}, middleware.After) +} + +func addOpApplyPendingMaintenanceActionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpApplyPendingMaintenanceAction{}, middleware.After) +} + +func addOpAuthorizeDBSecurityGroupIngressValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAuthorizeDBSecurityGroupIngress{}, middleware.After) +} + +func addOpBacktrackDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBacktrackDBCluster{}, middleware.After) +} + +func addOpCancelExportTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelExportTask{}, middleware.After) +} + +func addOpCopyDBClusterParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyDBClusterParameterGroup{}, middleware.After) +} + +func addOpCopyDBClusterSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyDBClusterSnapshot{}, middleware.After) +} + +func addOpCopyDBParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyDBParameterGroup{}, middleware.After) +} + +func addOpCopyDBSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyDBSnapshot{}, middleware.After) +} + +func addOpCopyOptionGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyOptionGroup{}, middleware.After) +} + +func addOpCreateBlueGreenDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateBlueGreenDeployment{}, middleware.After) +} + +func addOpCreateCustomDBEngineVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCustomDBEngineVersion{}, middleware.After) +} + +func addOpCreateDBClusterEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBClusterEndpoint{}, middleware.After) +} + +func addOpCreateDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBCluster{}, middleware.After) +} + +func addOpCreateDBClusterParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBClusterParameterGroup{}, middleware.After) +} + +func addOpCreateDBClusterSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBClusterSnapshot{}, middleware.After) +} + +func addOpCreateDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBInstance{}, middleware.After) +} + +func addOpCreateDBInstanceReadReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBInstanceReadReplica{}, middleware.After) +} + +func addOpCreateDBParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBParameterGroup{}, middleware.After) +} + +func addOpCreateDBProxyEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBProxyEndpoint{}, middleware.After) +} + +func addOpCreateDBProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBProxy{}, middleware.After) +} + +func addOpCreateDBSecurityGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBSecurityGroup{}, middleware.After) +} + +func addOpCreateDBShardGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBShardGroup{}, middleware.After) +} + +func addOpCreateDBSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBSnapshot{}, middleware.After) +} + +func addOpCreateDBSubnetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDBSubnetGroup{}, middleware.After) +} + +func addOpCreateEventSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEventSubscription{}, middleware.After) +} + +func addOpCreateIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateIntegration{}, middleware.After) +} + +func addOpCreateOptionGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateOptionGroup{}, middleware.After) +} + +func addOpCreateTenantDatabaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTenantDatabase{}, middleware.After) +} + +func addOpDeleteBlueGreenDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteBlueGreenDeployment{}, middleware.After) +} + +func addOpDeleteCustomDBEngineVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCustomDBEngineVersion{}, middleware.After) +} + +func addOpDeleteDBClusterAutomatedBackupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBClusterAutomatedBackup{}, middleware.After) +} + +func addOpDeleteDBClusterEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBClusterEndpoint{}, middleware.After) +} + +func addOpDeleteDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBCluster{}, middleware.After) +} + +func addOpDeleteDBClusterParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBClusterParameterGroup{}, middleware.After) +} + +func addOpDeleteDBClusterSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBClusterSnapshot{}, middleware.After) +} + +func addOpDeleteDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBInstance{}, middleware.After) +} + +func addOpDeleteDBParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBParameterGroup{}, middleware.After) +} + +func addOpDeleteDBProxyEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBProxyEndpoint{}, middleware.After) +} + +func addOpDeleteDBProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBProxy{}, middleware.After) +} + +func addOpDeleteDBSecurityGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBSecurityGroup{}, middleware.After) +} + +func addOpDeleteDBShardGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBShardGroup{}, middleware.After) +} + +func addOpDeleteDBSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBSnapshot{}, middleware.After) +} + +func addOpDeleteDBSubnetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDBSubnetGroup{}, middleware.After) +} + +func addOpDeleteEventSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEventSubscription{}, middleware.After) +} + +func addOpDeleteGlobalClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteGlobalCluster{}, middleware.After) +} + +func addOpDeleteIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIntegration{}, middleware.After) +} + +func addOpDeleteOptionGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteOptionGroup{}, middleware.After) +} + +func addOpDeleteTenantDatabaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTenantDatabase{}, middleware.After) +} + +func addOpDeregisterDBProxyTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterDBProxyTargets{}, middleware.After) +} + +func addOpDescribeBlueGreenDeploymentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeBlueGreenDeployments{}, middleware.After) +} + +func addOpDescribeCertificatesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeCertificates{}, middleware.After) +} + +func addOpDescribeDBClusterAutomatedBackupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterAutomatedBackups{}, middleware.After) +} + +func addOpDescribeDBClusterBacktracksValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterBacktracks{}, middleware.After) +} + +func addOpDescribeDBClusterEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterEndpoints{}, middleware.After) +} + +func addOpDescribeDBClusterParameterGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterParameterGroups{}, middleware.After) +} + +func addOpDescribeDBClusterParametersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterParameters{}, middleware.After) +} + +func addOpDescribeDBClustersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusters{}, middleware.After) +} + +func addOpDescribeDBClusterSnapshotAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterSnapshotAttributes{}, middleware.After) +} + +func addOpDescribeDBClusterSnapshotsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBClusterSnapshots{}, middleware.After) +} + +func addOpDescribeDBEngineVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBEngineVersions{}, middleware.After) +} + +func addOpDescribeDBInstanceAutomatedBackupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBInstanceAutomatedBackups{}, middleware.After) +} + +func addOpDescribeDBInstancesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBInstances{}, middleware.After) +} + +func addOpDescribeDBLogFilesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBLogFiles{}, middleware.After) +} + +func addOpDescribeDBParameterGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBParameterGroups{}, middleware.After) +} + +func addOpDescribeDBParametersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBParameters{}, middleware.After) +} + +func addOpDescribeDBProxiesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBProxies{}, middleware.After) +} + +func addOpDescribeDBProxyEndpointsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBProxyEndpoints{}, middleware.After) +} + +func addOpDescribeDBProxyTargetGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBProxyTargetGroups{}, middleware.After) +} + +func addOpDescribeDBProxyTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBProxyTargets{}, middleware.After) +} + +func addOpDescribeDBRecommendationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBRecommendations{}, middleware.After) +} + +func addOpDescribeDBSecurityGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBSecurityGroups{}, middleware.After) +} + +func addOpDescribeDBShardGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBShardGroups{}, middleware.After) +} + +func addOpDescribeDBSnapshotAttributesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBSnapshotAttributes{}, middleware.After) +} + +func addOpDescribeDBSnapshotsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBSnapshots{}, middleware.After) +} + +func addOpDescribeDBSnapshotTenantDatabasesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBSnapshotTenantDatabases{}, middleware.After) +} + +func addOpDescribeDBSubnetGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDBSubnetGroups{}, middleware.After) +} + +func addOpDescribeEngineDefaultClusterParametersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEngineDefaultClusterParameters{}, middleware.After) +} + +func addOpDescribeEngineDefaultParametersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEngineDefaultParameters{}, middleware.After) +} + +func addOpDescribeEventCategoriesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEventCategories{}, middleware.After) +} + +func addOpDescribeEventsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEvents{}, middleware.After) +} + +func addOpDescribeEventSubscriptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEventSubscriptions{}, middleware.After) +} + +func addOpDescribeExportTasksValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeExportTasks{}, middleware.After) +} + +func addOpDescribeGlobalClustersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeGlobalClusters{}, middleware.After) +} + +func addOpDescribeIntegrationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeIntegrations{}, middleware.After) +} + +func addOpDescribeOptionGroupOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeOptionGroupOptions{}, middleware.After) +} + +func addOpDescribeOptionGroupsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeOptionGroups{}, middleware.After) +} + +func addOpDescribeOrderableDBInstanceOptionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeOrderableDBInstanceOptions{}, middleware.After) +} + +func addOpDescribePendingMaintenanceActionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribePendingMaintenanceActions{}, middleware.After) +} + +func addOpDescribeReservedDBInstancesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeReservedDBInstances{}, middleware.After) +} + +func addOpDescribeReservedDBInstancesOfferingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeReservedDBInstancesOfferings{}, middleware.After) +} + +func addOpDescribeSourceRegionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeSourceRegions{}, middleware.After) +} + +func addOpDescribeTenantDatabasesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeTenantDatabases{}, middleware.After) +} + +func addOpDescribeValidDBInstanceModificationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeValidDBInstanceModifications{}, middleware.After) +} + +func addOpDisableHttpEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableHttpEndpoint{}, middleware.After) +} + +func addOpDownloadDBLogFilePortionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDownloadDBLogFilePortion{}, middleware.After) +} + +func addOpEnableHttpEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableHttpEndpoint{}, middleware.After) +} + +func addOpFailoverDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpFailoverDBCluster{}, middleware.After) +} + +func addOpFailoverGlobalClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpFailoverGlobalCluster{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpModifyCurrentDBClusterCapacityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyCurrentDBClusterCapacity{}, middleware.After) +} + +func addOpModifyCustomDBEngineVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyCustomDBEngineVersion{}, middleware.After) +} + +func addOpModifyDBClusterEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBClusterEndpoint{}, middleware.After) +} + +func addOpModifyDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBCluster{}, middleware.After) +} + +func addOpModifyDBClusterParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBClusterParameterGroup{}, middleware.After) +} + +func addOpModifyDBClusterSnapshotAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBClusterSnapshotAttribute{}, middleware.After) +} + +func addOpModifyDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBInstance{}, middleware.After) +} + +func addOpModifyDBParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBParameterGroup{}, middleware.After) +} + +func addOpModifyDBProxyEndpointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBProxyEndpoint{}, middleware.After) +} + +func addOpModifyDBProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBProxy{}, middleware.After) +} + +func addOpModifyDBProxyTargetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBProxyTargetGroup{}, middleware.After) +} + +func addOpModifyDBRecommendationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBRecommendation{}, middleware.After) +} + +func addOpModifyDBShardGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBShardGroup{}, middleware.After) +} + +func addOpModifyDBSnapshotAttributeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBSnapshotAttribute{}, middleware.After) +} + +func addOpModifyDBSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBSnapshot{}, middleware.After) +} + +func addOpModifyDBSubnetGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyDBSubnetGroup{}, middleware.After) +} + +func addOpModifyEventSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyEventSubscription{}, middleware.After) +} + +func addOpModifyIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyIntegration{}, middleware.After) +} + +func addOpModifyOptionGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyOptionGroup{}, middleware.After) +} + +func addOpModifyTenantDatabaseValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyTenantDatabase{}, middleware.After) +} + +func addOpPromoteReadReplicaDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPromoteReadReplicaDBCluster{}, middleware.After) +} + +func addOpPromoteReadReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPromoteReadReplica{}, middleware.After) +} + +func addOpPurchaseReservedDBInstancesOfferingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPurchaseReservedDBInstancesOffering{}, middleware.After) +} + +func addOpRebootDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRebootDBCluster{}, middleware.After) +} + +func addOpRebootDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRebootDBInstance{}, middleware.After) +} + +func addOpRebootDBShardGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRebootDBShardGroup{}, middleware.After) +} + +func addOpRegisterDBProxyTargetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterDBProxyTargets{}, middleware.After) +} + +func addOpRemoveRoleFromDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveRoleFromDBCluster{}, middleware.After) +} + +func addOpRemoveRoleFromDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveRoleFromDBInstance{}, middleware.After) +} + +func addOpRemoveSourceIdentifierFromSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveSourceIdentifierFromSubscription{}, middleware.After) +} + +func addOpRemoveTagsFromResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRemoveTagsFromResource{}, middleware.After) +} + +func addOpResetDBClusterParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResetDBClusterParameterGroup{}, middleware.After) +} + +func addOpResetDBParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResetDBParameterGroup{}, middleware.After) +} + +func addOpRestoreDBClusterFromS3ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBClusterFromS3{}, middleware.After) +} + +func addOpRestoreDBClusterFromSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBClusterFromSnapshot{}, middleware.After) +} + +func addOpRestoreDBClusterToPointInTimeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBClusterToPointInTime{}, middleware.After) +} + +func addOpRestoreDBInstanceFromDBSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBInstanceFromDBSnapshot{}, middleware.After) +} + +func addOpRestoreDBInstanceFromS3ValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBInstanceFromS3{}, middleware.After) +} + +func addOpRestoreDBInstanceToPointInTimeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreDBInstanceToPointInTime{}, middleware.After) +} + +func addOpRevokeDBSecurityGroupIngressValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRevokeDBSecurityGroupIngress{}, middleware.After) +} + +func addOpStartActivityStreamValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartActivityStream{}, middleware.After) +} + +func addOpStartDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDBCluster{}, middleware.After) +} + +func addOpStartDBInstanceAutomatedBackupsReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDBInstanceAutomatedBackupsReplication{}, middleware.After) +} + +func addOpStartDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDBInstance{}, middleware.After) +} + +func addOpStartExportTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartExportTask{}, middleware.After) +} + +func addOpStopActivityStreamValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopActivityStream{}, middleware.After) +} + +func addOpStopDBClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopDBCluster{}, middleware.After) +} + +func addOpStopDBInstanceAutomatedBackupsReplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopDBInstanceAutomatedBackupsReplication{}, middleware.After) +} + +func addOpStopDBInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopDBInstance{}, middleware.After) +} + +func addOpSwitchoverBlueGreenDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSwitchoverBlueGreenDeployment{}, middleware.After) +} + +func addOpSwitchoverGlobalClusterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSwitchoverGlobalCluster{}, middleware.After) +} + +func addOpSwitchoverReadReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSwitchoverReadReplica{}, middleware.After) +} + +func validateFilter(v *types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Filter"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFilterList(v []types.Filter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FilterList"} + for i := range v { + if err := validateFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOptionConfiguration(v *types.OptionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OptionConfiguration"} + if v.OptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptionName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOptionConfigurationList(v []types.OptionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OptionConfigurationList"} + for i := range v { + if err := validateOptionConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecommendedActionUpdate(v *types.RecommendedActionUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecommendedActionUpdate"} + if v.ActionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ActionId")) + } + if v.Status == nil { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRecommendedActionUpdateList(v []types.RecommendedActionUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RecommendedActionUpdateList"} + for i := range v { + if err := validateRecommendedActionUpdate(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAddRoleToDBClusterInput(v *AddRoleToDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddRoleToDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAddRoleToDBInstanceInput(v *AddRoleToDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddRoleToDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.FeatureName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeatureName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAddSourceIdentifierToSubscriptionInput(v *AddSourceIdentifierToSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddSourceIdentifierToSubscriptionInput"} + if v.SubscriptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) + } + if v.SourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAddTagsToResourceInput(v *AddTagsToResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddTagsToResourceInput"} + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpApplyPendingMaintenanceActionInput(v *ApplyPendingMaintenanceActionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ApplyPendingMaintenanceActionInput"} + if v.ResourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceIdentifier")) + } + if v.ApplyAction == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplyAction")) + } + if v.OptInType == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptInType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAuthorizeDBSecurityGroupIngressInput(v *AuthorizeDBSecurityGroupIngressInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthorizeDBSecurityGroupIngressInput"} + if v.DBSecurityGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSecurityGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBacktrackDBClusterInput(v *BacktrackDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BacktrackDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.BacktrackTo == nil { + invalidParams.Add(smithy.NewErrParamRequired("BacktrackTo")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelExportTaskInput"} + if v.ExportTaskIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportTaskIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCopyDBClusterParameterGroupInput(v *CopyDBClusterParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyDBClusterParameterGroupInput"} + if v.SourceDBClusterParameterGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBClusterParameterGroupIdentifier")) + } + if v.TargetDBClusterParameterGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBClusterParameterGroupIdentifier")) + } + if v.TargetDBClusterParameterGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBClusterParameterGroupDescription")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCopyDBClusterSnapshotInput(v *CopyDBClusterSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyDBClusterSnapshotInput"} + if v.SourceDBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBClusterSnapshotIdentifier")) + } + if v.TargetDBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBClusterSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCopyDBParameterGroupInput(v *CopyDBParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyDBParameterGroupInput"} + if v.SourceDBParameterGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBParameterGroupIdentifier")) + } + if v.TargetDBParameterGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBParameterGroupIdentifier")) + } + if v.TargetDBParameterGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBParameterGroupDescription")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCopyDBSnapshotInput(v *CopyDBSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyDBSnapshotInput"} + if v.SourceDBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBSnapshotIdentifier")) + } + if v.TargetDBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCopyOptionGroupInput(v *CopyOptionGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyOptionGroupInput"} + if v.SourceOptionGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceOptionGroupIdentifier")) + } + if v.TargetOptionGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetOptionGroupIdentifier")) + } + if v.TargetOptionGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetOptionGroupDescription")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateBlueGreenDeploymentInput(v *CreateBlueGreenDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateBlueGreenDeploymentInput"} + if v.BlueGreenDeploymentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BlueGreenDeploymentName")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateCustomDBEngineVersionInput(v *CreateCustomDBEngineVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCustomDBEngineVersionInput"} + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.EngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBClusterEndpointInput(v *CreateDBClusterEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBClusterEndpointInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.DBClusterEndpointIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterEndpointIdentifier")) + } + if v.EndpointType == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBClusterInput(v *CreateDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBClusterParameterGroupInput(v *CreateDBClusterParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBClusterParameterGroupInput"} + if v.DBClusterParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterParameterGroupName")) + } + if v.DBParameterGroupFamily == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupFamily")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBClusterSnapshotInput(v *CreateDBClusterSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBClusterSnapshotInput"} + if v.DBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterSnapshotIdentifier")) + } + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBInstanceInput(v *CreateDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.DBInstanceClass == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceClass")) + } + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBInstanceReadReplicaInput(v *CreateDBInstanceReadReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBInstanceReadReplicaInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBParameterGroupInput(v *CreateDBParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBParameterGroupInput"} + if v.DBParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupName")) + } + if v.DBParameterGroupFamily == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupFamily")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBProxyEndpointInput(v *CreateDBProxyEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBProxyEndpointInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if v.DBProxyEndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyEndpointName")) + } + if v.VpcSubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcSubnetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBProxyInput(v *CreateDBProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBProxyInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if len(v.EngineFamily) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("EngineFamily")) + } + if v.Auth == nil { + invalidParams.Add(smithy.NewErrParamRequired("Auth")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.VpcSubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("VpcSubnetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBSecurityGroupInput(v *CreateDBSecurityGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBSecurityGroupInput"} + if v.DBSecurityGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSecurityGroupName")) + } + if v.DBSecurityGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSecurityGroupDescription")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBShardGroupInput(v *CreateDBShardGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBShardGroupInput"} + if v.DBShardGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBShardGroupIdentifier")) + } + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.MaxACU == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaxACU")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBSnapshotInput(v *CreateDBSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBSnapshotInput"} + if v.DBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSnapshotIdentifier")) + } + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDBSubnetGroupInput(v *CreateDBSubnetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDBSubnetGroupInput"} + if v.DBSubnetGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSubnetGroupName")) + } + if v.DBSubnetGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSubnetGroupDescription")) + } + if v.SubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateEventSubscriptionInput(v *CreateEventSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEventSubscriptionInput"} + if v.SubscriptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) + } + if v.SnsTopicArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnsTopicArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateIntegrationInput(v *CreateIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateIntegrationInput"} + if v.SourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceArn")) + } + if v.TargetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetArn")) + } + if v.IntegrationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntegrationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateOptionGroupInput(v *CreateOptionGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateOptionGroupInput"} + if v.OptionGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptionGroupName")) + } + if v.EngineName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EngineName")) + } + if v.MajorEngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("MajorEngineVersion")) + } + if v.OptionGroupDescription == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptionGroupDescription")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTenantDatabaseInput(v *CreateTenantDatabaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTenantDatabaseInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.TenantDBName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TenantDBName")) + } + if v.MasterUsername == nil { + invalidParams.Add(smithy.NewErrParamRequired("MasterUsername")) + } + if v.MasterUserPassword == nil { + invalidParams.Add(smithy.NewErrParamRequired("MasterUserPassword")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteBlueGreenDeploymentInput(v *DeleteBlueGreenDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteBlueGreenDeploymentInput"} + if v.BlueGreenDeploymentIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("BlueGreenDeploymentIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCustomDBEngineVersionInput(v *DeleteCustomDBEngineVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomDBEngineVersionInput"} + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.EngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBClusterAutomatedBackupInput(v *DeleteDBClusterAutomatedBackupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBClusterAutomatedBackupInput"} + if v.DbClusterResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DbClusterResourceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBClusterEndpointInput(v *DeleteDBClusterEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBClusterEndpointInput"} + if v.DBClusterEndpointIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterEndpointIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBClusterInput(v *DeleteDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBClusterParameterGroupInput(v *DeleteDBClusterParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBClusterParameterGroupInput"} + if v.DBClusterParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBClusterSnapshotInput(v *DeleteDBClusterSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBClusterSnapshotInput"} + if v.DBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBInstanceInput(v *DeleteDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBParameterGroupInput(v *DeleteDBParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBParameterGroupInput"} + if v.DBParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBProxyEndpointInput(v *DeleteDBProxyEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBProxyEndpointInput"} + if v.DBProxyEndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyEndpointName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBProxyInput(v *DeleteDBProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBProxyInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBSecurityGroupInput(v *DeleteDBSecurityGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBSecurityGroupInput"} + if v.DBSecurityGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSecurityGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBShardGroupInput(v *DeleteDBShardGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBShardGroupInput"} + if v.DBShardGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBShardGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBSnapshotInput(v *DeleteDBSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBSnapshotInput"} + if v.DBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDBSubnetGroupInput(v *DeleteDBSubnetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDBSubnetGroupInput"} + if v.DBSubnetGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSubnetGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteEventSubscriptionInput(v *DeleteEventSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEventSubscriptionInput"} + if v.SubscriptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteGlobalClusterInput(v *DeleteGlobalClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteGlobalClusterInput"} + if v.GlobalClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("GlobalClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIntegrationInput(v *DeleteIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIntegrationInput"} + if v.IntegrationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntegrationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteOptionGroupInput(v *DeleteOptionGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteOptionGroupInput"} + if v.OptionGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptionGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteTenantDatabaseInput(v *DeleteTenantDatabaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTenantDatabaseInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.TenantDBName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TenantDBName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterDBProxyTargetsInput(v *DeregisterDBProxyTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterDBProxyTargetsInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeBlueGreenDeploymentsInput(v *DescribeBlueGreenDeploymentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeBlueGreenDeploymentsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeCertificatesInput(v *DescribeCertificatesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeCertificatesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterAutomatedBackupsInput(v *DescribeDBClusterAutomatedBackupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterAutomatedBackupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterBacktracksInput(v *DescribeDBClusterBacktracksInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterBacktracksInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterEndpointsInput(v *DescribeDBClusterEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterEndpointsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterParameterGroupsInput(v *DescribeDBClusterParameterGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterParameterGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterParametersInput(v *DescribeDBClusterParametersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterParametersInput"} + if v.DBClusterParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterParameterGroupName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClustersInput(v *DescribeDBClustersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClustersInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterSnapshotAttributesInput(v *DescribeDBClusterSnapshotAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterSnapshotAttributesInput"} + if v.DBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBClusterSnapshotsInput(v *DescribeDBClusterSnapshotsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBClusterSnapshotsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBEngineVersionsInput(v *DescribeDBEngineVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBEngineVersionsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBInstanceAutomatedBackupsInput(v *DescribeDBInstanceAutomatedBackupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBInstanceAutomatedBackupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBInstancesInput(v *DescribeDBInstancesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBInstancesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBLogFilesInput(v *DescribeDBLogFilesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBLogFilesInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBParameterGroupsInput(v *DescribeDBParameterGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBParameterGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBParametersInput(v *DescribeDBParametersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBParametersInput"} + if v.DBParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBProxiesInput(v *DescribeDBProxiesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBProxiesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBProxyEndpointsInput(v *DescribeDBProxyEndpointsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBProxyEndpointsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBProxyTargetGroupsInput(v *DescribeDBProxyTargetGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBProxyTargetGroupsInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBProxyTargetsInput(v *DescribeDBProxyTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBProxyTargetsInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBRecommendationsInput(v *DescribeDBRecommendationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBRecommendationsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBSecurityGroupsInput(v *DescribeDBSecurityGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBSecurityGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBShardGroupsInput(v *DescribeDBShardGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBShardGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBSnapshotAttributesInput(v *DescribeDBSnapshotAttributesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBSnapshotAttributesInput"} + if v.DBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBSnapshotsInput(v *DescribeDBSnapshotsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBSnapshotsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBSnapshotTenantDatabasesInput(v *DescribeDBSnapshotTenantDatabasesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBSnapshotTenantDatabasesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeDBSubnetGroupsInput(v *DescribeDBSubnetGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDBSubnetGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeEngineDefaultClusterParametersInput(v *DescribeEngineDefaultClusterParametersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEngineDefaultClusterParametersInput"} + if v.DBParameterGroupFamily == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupFamily")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeEngineDefaultParametersInput(v *DescribeEngineDefaultParametersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEngineDefaultParametersInput"} + if v.DBParameterGroupFamily == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupFamily")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeEventCategoriesInput(v *DescribeEventCategoriesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEventCategoriesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeEventsInput(v *DescribeEventsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEventsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeEventSubscriptionsInput(v *DescribeEventSubscriptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEventSubscriptionsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeExportTasksInput(v *DescribeExportTasksInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeExportTasksInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeGlobalClustersInput(v *DescribeGlobalClustersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeGlobalClustersInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeIntegrationsInput(v *DescribeIntegrationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeIntegrationsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeOptionGroupOptionsInput(v *DescribeOptionGroupOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeOptionGroupOptionsInput"} + if v.EngineName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EngineName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeOptionGroupsInput(v *DescribeOptionGroupsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeOptionGroupsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeOrderableDBInstanceOptionsInput(v *DescribeOrderableDBInstanceOptionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeOrderableDBInstanceOptionsInput"} + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribePendingMaintenanceActionsInput(v *DescribePendingMaintenanceActionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribePendingMaintenanceActionsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeReservedDBInstancesInput(v *DescribeReservedDBInstancesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeReservedDBInstancesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeReservedDBInstancesOfferingsInput(v *DescribeReservedDBInstancesOfferingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeReservedDBInstancesOfferingsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeSourceRegionsInput(v *DescribeSourceRegionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeSourceRegionsInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeTenantDatabasesInput(v *DescribeTenantDatabasesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeTenantDatabasesInput"} + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeValidDBInstanceModificationsInput(v *DescribeValidDBInstanceModificationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeValidDBInstanceModificationsInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisableHttpEndpointInput(v *DisableHttpEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableHttpEndpointInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDownloadDBLogFilePortionInput(v *DownloadDBLogFilePortionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DownloadDBLogFilePortionInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.LogFileName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogFileName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpEnableHttpEndpointInput(v *EnableHttpEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableHttpEndpointInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpFailoverDBClusterInput(v *FailoverDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FailoverDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpFailoverGlobalClusterInput(v *FailoverGlobalClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FailoverGlobalClusterInput"} + if v.GlobalClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("GlobalClusterIdentifier")) + } + if v.TargetDbClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDbClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.Filters != nil { + if err := validateFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyCurrentDBClusterCapacityInput(v *ModifyCurrentDBClusterCapacityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyCurrentDBClusterCapacityInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyCustomDBEngineVersionInput(v *ModifyCustomDBEngineVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyCustomDBEngineVersionInput"} + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.EngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("EngineVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBClusterEndpointInput(v *ModifyDBClusterEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBClusterEndpointInput"} + if v.DBClusterEndpointIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterEndpointIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBClusterInput(v *ModifyDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBClusterParameterGroupInput(v *ModifyDBClusterParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBClusterParameterGroupInput"} + if v.DBClusterParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterParameterGroupName")) + } + if v.Parameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Parameters")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBClusterSnapshotAttributeInput(v *ModifyDBClusterSnapshotAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBClusterSnapshotAttributeInput"} + if v.DBClusterSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterSnapshotIdentifier")) + } + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBInstanceInput(v *ModifyDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBParameterGroupInput(v *ModifyDBParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBParameterGroupInput"} + if v.DBParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupName")) + } + if v.Parameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Parameters")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBProxyEndpointInput(v *ModifyDBProxyEndpointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBProxyEndpointInput"} + if v.DBProxyEndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyEndpointName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBProxyInput(v *ModifyDBProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBProxyInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBProxyTargetGroupInput(v *ModifyDBProxyTargetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBProxyTargetGroupInput"} + if v.TargetGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetGroupName")) + } + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBRecommendationInput(v *ModifyDBRecommendationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBRecommendationInput"} + if v.RecommendationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecommendationId")) + } + if v.RecommendedActionUpdates != nil { + if err := validateRecommendedActionUpdateList(v.RecommendedActionUpdates); err != nil { + invalidParams.AddNested("RecommendedActionUpdates", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBShardGroupInput(v *ModifyDBShardGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBShardGroupInput"} + if v.DBShardGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBShardGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBSnapshotAttributeInput(v *ModifyDBSnapshotAttributeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBSnapshotAttributeInput"} + if v.DBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSnapshotIdentifier")) + } + if v.AttributeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBSnapshotInput(v *ModifyDBSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBSnapshotInput"} + if v.DBSnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSnapshotIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyDBSubnetGroupInput(v *ModifyDBSubnetGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyDBSubnetGroupInput"} + if v.DBSubnetGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSubnetGroupName")) + } + if v.SubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyEventSubscriptionInput(v *ModifyEventSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyEventSubscriptionInput"} + if v.SubscriptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyIntegrationInput(v *ModifyIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyIntegrationInput"} + if v.IntegrationIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("IntegrationIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyOptionGroupInput(v *ModifyOptionGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyOptionGroupInput"} + if v.OptionGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("OptionGroupName")) + } + if v.OptionsToInclude != nil { + if err := validateOptionConfigurationList(v.OptionsToInclude); err != nil { + invalidParams.AddNested("OptionsToInclude", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyTenantDatabaseInput(v *ModifyTenantDatabaseInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyTenantDatabaseInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.TenantDBName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TenantDBName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPromoteReadReplicaDBClusterInput(v *PromoteReadReplicaDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromoteReadReplicaDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPromoteReadReplicaInput(v *PromoteReadReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PromoteReadReplicaInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPurchaseReservedDBInstancesOfferingInput(v *PurchaseReservedDBInstancesOfferingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PurchaseReservedDBInstancesOfferingInput"} + if v.ReservedDBInstancesOfferingId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReservedDBInstancesOfferingId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRebootDBClusterInput(v *RebootDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RebootDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRebootDBInstanceInput(v *RebootDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RebootDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRebootDBShardGroupInput(v *RebootDBShardGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RebootDBShardGroupInput"} + if v.DBShardGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBShardGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterDBProxyTargetsInput(v *RegisterDBProxyTargetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterDBProxyTargetsInput"} + if v.DBProxyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBProxyName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveRoleFromDBClusterInput(v *RemoveRoleFromDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveRoleFromDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveRoleFromDBInstanceInput(v *RemoveRoleFromDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveRoleFromDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.FeatureName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FeatureName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveSourceIdentifierFromSubscriptionInput(v *RemoveSourceIdentifierFromSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveSourceIdentifierFromSubscriptionInput"} + if v.SubscriptionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) + } + if v.SourceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsFromResourceInput"} + if v.ResourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceName")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpResetDBClusterParameterGroupInput(v *ResetDBClusterParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResetDBClusterParameterGroupInput"} + if v.DBClusterParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpResetDBParameterGroupInput(v *ResetDBParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResetDBParameterGroupInput"} + if v.DBParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBClusterFromS3Input(v *RestoreDBClusterFromS3Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBClusterFromS3Input"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.MasterUsername == nil { + invalidParams.Add(smithy.NewErrParamRequired("MasterUsername")) + } + if v.SourceEngine == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceEngine")) + } + if v.SourceEngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceEngineVersion")) + } + if v.S3BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketName")) + } + if v.S3IngestionRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3IngestionRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBClusterFromSnapshotInput(v *RestoreDBClusterFromSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBClusterFromSnapshotInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if v.SnapshotIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotIdentifier")) + } + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBClusterToPointInTimeInput(v *RestoreDBClusterToPointInTimeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBClusterToPointInTimeInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBInstanceFromDBSnapshotInput(v *RestoreDBInstanceFromDBSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBInstanceFromDBSnapshotInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBInstanceFromS3Input(v *RestoreDBInstanceFromS3Input) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBInstanceFromS3Input"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if v.DBInstanceClass == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceClass")) + } + if v.Engine == nil { + invalidParams.Add(smithy.NewErrParamRequired("Engine")) + } + if v.SourceEngine == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceEngine")) + } + if v.SourceEngineVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceEngineVersion")) + } + if v.S3BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketName")) + } + if v.S3IngestionRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3IngestionRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreDBInstanceToPointInTimeInput(v *RestoreDBInstanceToPointInTimeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreDBInstanceToPointInTimeInput"} + if v.TargetDBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRevokeDBSecurityGroupIngressInput(v *RevokeDBSecurityGroupIngressInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RevokeDBSecurityGroupIngressInput"} + if v.DBSecurityGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBSecurityGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartActivityStreamInput(v *StartActivityStreamInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartActivityStreamInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if len(v.Mode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Mode")) + } + if v.KmsKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDBClusterInput(v *StartDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDBInstanceAutomatedBackupsReplicationInput(v *StartDBInstanceAutomatedBackupsReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDBInstanceAutomatedBackupsReplicationInput"} + if v.SourceDBInstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBInstanceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDBInstanceInput(v *StartDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartExportTaskInput(v *StartExportTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartExportTaskInput"} + if v.ExportTaskIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExportTaskIdentifier")) + } + if v.SourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceArn")) + } + if v.S3BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketName")) + } + if v.IamRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("IamRoleArn")) + } + if v.KmsKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopActivityStreamInput(v *StopActivityStreamInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopActivityStreamInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopDBClusterInput(v *StopDBClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopDBClusterInput"} + if v.DBClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopDBInstanceAutomatedBackupsReplicationInput(v *StopDBInstanceAutomatedBackupsReplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopDBInstanceAutomatedBackupsReplicationInput"} + if v.SourceDBInstanceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourceDBInstanceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStopDBInstanceInput(v *StopDBInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopDBInstanceInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSwitchoverBlueGreenDeploymentInput(v *SwitchoverBlueGreenDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SwitchoverBlueGreenDeploymentInput"} + if v.BlueGreenDeploymentIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("BlueGreenDeploymentIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSwitchoverGlobalClusterInput(v *SwitchoverGlobalClusterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SwitchoverGlobalClusterInput"} + if v.GlobalClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("GlobalClusterIdentifier")) + } + if v.TargetDbClusterIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetDbClusterIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSwitchoverReadReplicaInput(v *SwitchoverReadReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SwitchoverReadReplicaInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md index 576ddff7..928e943b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md @@ -1,3 +1,339 @@ +# v1.71.1 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.71.0 (2024-12-03.2) + +* **Feature**: Amazon S3 Metadata stores object metadata in read-only, fully managed Apache Iceberg metadata tables that you can query. You can create metadata table configurations for S3 general purpose buckets. + +# v1.70.0 (2024-12-02) + +* **Feature**: Amazon S3 introduces support for AWS Dedicated Local Zones +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.69.0 (2024-11-25) + +* **Feature**: Amazon Simple Storage Service / Features: Add support for ETag based conditional writes in PutObject and CompleteMultiPartUpload APIs to prevent unintended object modifications. + +# v1.68.0 (2024-11-21) + +* **Feature**: Add support for conditional deletes for the S3 DeleteObject and DeleteObjects APIs. Add support for write offset bytes option used to append to objects with the S3 PutObject API. + +# v1.67.1 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.67.0 (2024-11-14) + +* **Feature**: This release updates the ListBuckets API Reference documentation in support of the new 10,000 general purpose bucket default quota on all AWS accounts. To increase your bucket quota from 10,000 to up to 1 million buckets, simply request a quota increase via Service Quotas. + +# v1.66.3 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.66.2 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.66.1 (2024-10-25) + +* **Bug Fix**: Update presign post URL resolution to use the exact result from EndpointResolverV2 + +# v1.66.0 (2024-10-16) + +* **Feature**: Add support for the new optional bucket-region and prefix query parameters in the ListBuckets API. For ListBuckets requests that express pagination, Amazon S3 will now return both the bucket names and associated AWS regions in the response. + +# v1.65.3 (2024-10-11) + +* **Bug Fix**: **BREAKING CHANGE**: S3 ReplicationRuleFilter and LifecycleRuleFilter shapes are being changed from union to structure types + +# v1.65.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.65.1 (2024-10-07) + +* **Bug Fix**: **CHANGE IN BEHAVIOR**: Allow serialization of headers with empty string for prefix headers. We are deploying this fix because the behavior is actively preventing users from transmitting keys with empty values to the service. If you were setting metadata keys with empty values before this change, they will now actually be sent to the service. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.65.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.64.1 (2024-10-03) + +* No change notes available for this release. + +# v1.64.0 (2024-10-02) + +* **Feature**: This release introduces a header representing the minimum object size limit for Lifecycle transitions. + +# v1.63.3 (2024-09-27) + +* No change notes available for this release. + +# v1.63.2 (2024-09-25) + +* No change notes available for this release. + +# v1.63.1 (2024-09-23) + +* No change notes available for this release. + +# v1.63.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.62.0 (2024-09-18) + +* **Feature**: Added SSE-KMS support for directory buckets. + +# v1.61.3 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + +# v1.61.2 (2024-09-04) + +* No change notes available for this release. + +# v1.61.1 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.61.0 (2024-08-28) + +* **Feature**: Add presignPost for s3 PutObject + +# v1.60.1 (2024-08-22) + +* No change notes available for this release. + +# v1.60.0 (2024-08-20) + +* **Feature**: Amazon Simple Storage Service / Features : Add support for conditional writes for PutObject and CompleteMultipartUpload APIs. + +# v1.59.0 (2024-08-15) + +* **Feature**: Amazon Simple Storage Service / Features : Adds support for pagination in the S3 ListBuckets API. +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.58.3 (2024-08-02) + +* **Bug Fix**: Add assurance tests for auth scheme selection logic. + +# v1.58.2 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.58.1 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.58.0 (2024-07-02) + +* **Feature**: Added response overrides to Head Object requests. + +# v1.57.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.57.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.56.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.56.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.55.2 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.55.1 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.55.0 (2024-06-05) + +* **Feature**: Added new params copySource and key to copyObject API for supporting S3 Access Grants plugin. These changes will not change any of the existing S3 API functionality. +* **Bug Fix**: Add S3-specific smithy protocol tests. + +# v1.54.4 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.54.3 (2024-05-23) + +* **Bug Fix**: Prevent parsing failures for nonstandard `Expires` values in responses. If the SDK cannot parse the value set in the response header for this field it will now be returned as `nil`. A new field, `ExpiresString`, has been added that will retain the unparsed value from the response (regardless of whether it came back in a format recognized by the SDK). + +# v1.54.2 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.54.1 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.54.0 (2024-05-14) + +* **Feature**: Updated a few x-id in the http uri traits + +# v1.53.2 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.53.1 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.53.0 (2024-03-18) + +* **Feature**: Fix two issues with response root node names. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.52.1 (2024-03-15) + +* **Documentation**: Documentation updates for Amazon S3. + +# v1.52.0 (2024-03-13) + +* **Feature**: This release makes the default option for S3 on Outposts request signing to use the SigV4A algorithm when using AWS Common Runtime (CRT). + +# v1.51.4 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.3 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.2 (2024-03-04) + +* **Bug Fix**: Update internal/presigned-url dependency for corrected API name. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.50.3 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.2 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.50.1 (2024-02-19) + +* **Bug Fix**: Prevent potential panic caused by invalid comparison of credentials. + +# v1.50.0 (2024-02-16) + +* **Feature**: Add new ClientOptions field to waiter config which allows you to extend the config for operation calls made by waiters. + +# v1.49.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.48.1 (2024-01-24) + +* No change notes available for this release. + +# v1.48.0 (2024-01-05) + +* **Feature**: Support smithy sigv4a trait for codegen. + +# v1.47.8 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.47.7 (2023-12-20) + +* No change notes available for this release. + +# v1.47.6 (2023-12-18) + +* No change notes available for this release. + +# v1.47.5 (2023-12-08) + +* **Bug Fix**: Add non-vhostable buckets to request path when using legacy V1 endpoint resolver. +* **Bug Fix**: Improve uniqueness of default S3Express sesssion credentials cache keying to prevent collision in multi-credential scenarios. +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.47.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.47.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.47.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.47.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.47.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.46.0 (2023-11-28.2) + +* **Feature**: Add S3Express support. +* **Feature**: Adds support for S3 Express One Zone. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.45.1 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.45.0 (2023-11-27) + +* **Feature**: Adding new params - Key and Prefix, to S3 API operations for supporting S3 Access Grants. Note - These updates will not change any of the existing S3 API functionality. + +# v1.44.0 (2023-11-21) + +* **Feature**: Add support for automatic date based partitioning in S3 Server Access Logs. +* **Bug Fix**: Don't send MaxKeys/MaxUploads=0 when unspecified in ListObjectVersions and ListMultipartUploads paginators. + +# v1.43.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.43.0 (2023-11-17) + +* **Feature**: **BREAKING CHANGE** Correct nullability of a large number of S3 structure fields. See https://github.com/aws/aws-sdk-go-v2/issues/2162. +* **Feature**: Removes all default 0 values for numbers and false values for booleans + +# v1.42.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.42.1 (2023-11-09) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go index e921189a..08e43279 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" @@ -11,7 +12,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" "github.com/aws/aws-sdk-go-v2/internal/v4a" acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" @@ -20,22 +24,156 @@ import ( s3sharedconfig "github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" + "sync/atomic" "time" ) const ServiceID = "S3" const ServiceAPIVersion = "2006-03-01" +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/s3") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/s3") +} + // Client provides the API client to make operations call for Amazon Simple // Storage Service. type Client struct { options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 } // New returns an initialized Client based on the functional options. Provide @@ -54,189 +192,61 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) + resolveEndpointResolverV2(&options) + resolveHTTPSignerV4a(&options) + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + for _, fn := range optFns { fn(&options) } - client := &Client{ - options: options, - } - - resolveCredentialProvider(&options) - - return client -} + finalizeRetryMaxAttempts(&options) -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The threshold ContentLength in bytes for HTTP PUT request to receive {Expect: - // 100-continue} header. Setting to -1 will disable adding the Expect header to - // requests; setting to 0 will set the threshold to default 2MB - ContinueHeaderThresholdBytes int64 - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // Allows you to disable S3 Multi-Region access points feature. - DisableMultiRegionAccessPoints bool - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom - // endpoint, set the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service. This should be used over - // the deprecated EndpointResolver - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string + ignoreAnonymousAuth(&options) - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific - // RetryMaxAttempts value. - RetryMaxAttempts int + resolveExpressCredentials(&options) - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. Currently does not support per operation call - // overrides, may in the future. - RetryMode aws.RetryMode + finalizeServiceEndpointAuthResolver(&options) - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer + resolveAuthSchemes(&options) - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment + client := &Client{ + options: options, + } - // Allows you to enable arn region support for the service. - UseARNRegion bool + finalizeExpressCredentials(&options, client) - // Allows you to enable S3 Accelerate feature. All operations compatible with S3 - // Accelerate will use the accelerate endpoint for requests. Requests not - // compatible will fall back to normal S3 requests. The bucket must be enabled for - // accelerate to be used with S3 client with accelerate enabled. If the bucket is - // not enabled for accelerate an error will be returned. The bucket name must be - // DNS compatible to work with accelerate. - UseAccelerate bool + initializeTimeOffsetResolver(client) - // Allows you to enable dual-stack endpoint support for the service. - // - // Deprecated: Set dual-stack by setting UseDualStackEndpoint on - // EndpointResolverOptions. When EndpointResolverOptions' UseDualStackEndpoint - // field is set it overrides this field value. - UseDualstack bool - - // Allows you to enable the client to use path-style addressing, i.e., - // https://s3.amazonaws.com/BUCKET/KEY . By default, the S3 client will use virtual - // hosted bucket addressing when possible( https://BUCKET.s3.amazonaws.com/KEY ). - UsePathStyle bool - - // Signature Version 4a (SigV4a) Signer - httpSignerV4a httpSignerV4a - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. Currently does not support per operation call - // overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } + return client } -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() } -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} -func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() - resolveEndpointResolverV2(&options) for _, fn := range optFns { fn(&options) @@ -244,11 +254,13 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf setSafeEventStreamClientLogMode(&options, opID) - finalizeRetryMaxAttemptOptions(&options, *c) + finalizeOperationRetryMaxAttempts(&options, *c) finalizeClientEndpointResolverOptions(&options) - resolveCredentialProvider(&options) + finalizeOperationExpressCredentials(&options, *c) + + finalizeOperationEndpointAuthResolver(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { @@ -262,18 +274,126 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf } } - handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) - result, metadata, err = handler.Handle(ctx, params) + ctx, err = withOperationMetrics(ctx, options.MeterProvider) if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/s3") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + return result, metadata, err } +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + internalauth.NewHTTPAuthScheme("com.amazonaws.s3#sigv4express", &s3cust.ExpressSigner{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + internalauth.NewHTTPAuthScheme("aws.auth#sigv4a", &v4a.SignerAdapter{ + Signer: options.httpSignerV4a, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + type noSmithyDocumentSerde = smithydocument.NoSerde type legacyEndpointContextSetter struct { @@ -345,6 +465,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseARNRegion(cfg, &opts) resolveDisableMultiRegionAccessPoints(cfg, &opts) + resolveDisableExpressAuth(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) resolveBaseEndpoint(cfg, &opts) @@ -439,7 +560,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { o.RetryMaxAttempts = cfg.RetryMaxAttempts } -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } @@ -455,24 +584,35 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { } func addClientUserAgent(stack *middleware.Stack, options Options) error { - if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "s3", goModuleVersion)(stack); err != nil { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { return err } + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "s3", goModuleVersion) if len(options.AppID) > 0 { - return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) } return nil } -func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - Signer: o.HTTPSignerV4, - LogSigning: o.ClientLogMode.IsSigning(), - }) - return stack.Finalize.Add(mw, middleware.After) +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil } type HTTPSignerV4 interface { @@ -494,12 +634,97 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } -func addRetryMiddlewares(stack *middleware.Stack, o Options) error { - mo := retry.AddRetryMiddlewaresOptions{ - Retryer: o.Retryer, - LogRetryAttempts: o.ClientLogMode.IsRetries(), +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/s3") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err } - return retry.AddRetryMiddlewares(stack, mo) + return nil } // resolves UseARNRegion S3 configuration @@ -562,31 +787,16 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { return nil } -func resolveCredentialProvider(o *Options) { - if o.Credentials == nil { - return - } - - if _, ok := o.Credentials.(v4a.CredentialsProvider); ok { - return +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil } - if aws.IsCredentialsProvider(o.Credentials, (*aws.AnonymousCredentials)(nil)) { - return + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) } - o.Credentials = &v4a.SymmetricCredentialAdaptor{SymmetricProvider: o.Credentials} -} - -func swapWithCustomHTTPSignerMiddleware(stack *middleware.Stack, o Options) error { - mw := s3cust.NewSignHTTPRequestMiddleware(s3cust.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: o.Credentials, - V4Signer: o.HTTPSignerV4, - V4aSigner: o.httpSignerV4a, - LogSigning: o.ClientLogMode.IsSigning(), - }) - - return s3cust.RegisterSigningMiddleware(stack, mw) + return nil } type httpSignerV4a interface { @@ -606,10 +816,47 @@ func newDefaultV4aSigner(o Options) *v4a.Signer { return v4a.NewSigner(func(so *v4a.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() - so.DisableURIPathEscaping = true }) } +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + func addMetadataRetrieverMiddleware(stack *middleware.Stack) error { return s3shared.AddMetadataRetrieverMiddleware(stack) } @@ -618,6 +865,10 @@ func add100Continue(stack *middleware.Stack, options Options) error { return s3shared.Add100Continue(stack, options.ContinueHeaderThresholdBytes) } +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + // ComputedInputChecksumsMetadata provides information about the algorithms used // to compute the checksum(s) of the input payload. type ComputedInputChecksumsMetadata struct { @@ -801,29 +1052,77 @@ func withNopHTTPClientAPIOption(o *Options) { o.HTTPClient = smithyhttp.NopClient{} } +type presignContextPolyfillMiddleware struct { +} + +func (*presignContextPolyfillMiddleware) ID() string { + return "presignContextPolyfill" +} + +func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + schemeID := rscheme.Scheme.SchemeID() + ctx = s3cust.SetSignerVersion(ctx, schemeID) + if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { + if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr) + } + } else if schemeID == "aws.auth#sigv4a" { + if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) + } + } + + return next.HandleFinalize(ctx, in) +} + type presignConverter PresignOptions func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { - stack.Finalize.Clear() + if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { + stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") + if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { + return err + } + pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ CredentialsProvider: options.Credentials, Presigner: c.Presigner, LogSigning: options.ClientLogMode.IsSigning(), }) - err = stack.Finalize.Add(pmw, middleware.After) - if err != nil { + if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { return err } if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { return err } - // add multi-region access point presigner + // extended s3 presigning signermv := s3cust.NewPresignHTTPRequestMiddleware(s3cust.PresignHTTPRequestMiddlewareOptions{ CredentialsProvider: options.Credentials, + ExpressCredentials: options.ExpressCredentials, V4Presigner: c.Presigner, V4aPresigner: c.presignerV4a, LogSigning: options.ClientLogMode.IsSigning(), @@ -842,7 +1141,7 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op if err != nil { return err } - err = presignedurlcust.AddAsIsPresigingMiddleware(stack) + err = presignedurlcust.AddAsIsPresigningMiddleware(stack) if err != nil { return err } @@ -858,31 +1157,117 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error { }, middleware.After) } -type endpointDisableHTTPSMiddleware struct { - EndpointDisableHTTPS bool +type disableHTTPSMiddleware struct { + DisableHTTPS bool } -func (*endpointDisableHTTPSMiddleware) ID() string { - return "endpointDisableHTTPSMiddleware" +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" } -func (m *endpointDisableHTTPSMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - if m.EndpointDisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { req.URL.Scheme = "http" } + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) } -func addendpointDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&endpointDisableHTTPSMiddleware{ - EndpointDisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "OperationSerializer", middleware.Before) + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_AbortMultipartUpload.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_AbortMultipartUpload.go index 5932f1f2..467a4647 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_AbortMultipartUpload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_AbortMultipartUpload.go @@ -4,37 +4,83 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) -// This action aborts a multipart upload. After a multipart upload is aborted, no -// additional parts can be uploaded using that upload ID. The storage consumed by -// any previously uploaded parts will be freed. However, if any part uploads are +// This operation aborts a multipart upload. After a multipart upload is aborted, +// no additional parts can be uploaded using that upload ID. The storage consumed +// by any previously uploaded parts will be freed. However, if any part uploads are // currently in progress, those part uploads might or might not succeed. As a // result, it might be necessary to abort a given multipart upload multiple times -// in order to completely free all storage consumed by all parts. To verify that -// all parts have been removed, so you don't get charged for the part storage, you -// should call the ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// action and ensure that the parts list is empty. For information about -// permissions required to use the multipart upload, see Multipart Upload and -// Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// . The following operations are related to AbortMultipartUpload : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// in order to completely free all storage consumed by all parts. +// +// To verify that all parts have been removed and prevent getting charged for the +// part storage, you should call the [ListParts]API operation and ensure that the parts list +// is empty. +// +// - Directory buckets - If multipart uploads in a directory bucket are in +// progress, you can't delete the bucket until all the in-progress multipart +// uploads are aborted or completed. To delete these in-progress multipart uploads, +// use the ListMultipartUploads operation to list the in-progress multipart +// uploads in the bucket and use the AbortMultipartUpload operation to abort all +// the in-progress multipart uploads. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - For information about permissions +// required to use the multipart upload, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to AbortMultipartUpload : +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [ListParts] +// +// [ListMultipartUploads] +// +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html func (c *Client) AbortMultipartUpload(ctx context.Context, params *AbortMultipartUploadInput, optFns ...func(*Options)) (*AbortMultipartUploadOutput, error) { if params == nil { params = &AbortMultipartUploadInput{} @@ -52,21 +98,40 @@ func (c *Client) AbortMultipartUpload(ctx context.Context, params *AbortMultipar type AbortMultipartUploadInput struct { - // The bucket name to which the upload was taking place. When using this action - // with an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The bucket name to which the upload was taking place. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -81,27 +146,49 @@ type AbortMultipartUploadInput struct { // This member is required. UploadId *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // If present, this header aborts an in progress multipart upload only if it was + // initiated on the provided timestamp. If the initiated timestamp of the multipart + // upload does not match the provided value, the operation returns a 412 + // Precondition Failed error. If the initiated timestamp matches or if the + // multipart upload doesn’t exist, the operation returns a 204 Success (No Content) + // response. + // + // This functionality is only supported for directory buckets. + IfMatchInitiatedTime *time.Time + // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer noSmithyDocumentSerde } +func (in *AbortMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type AbortMultipartUploadOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -111,6 +198,9 @@ type AbortMultipartUploadOutput struct { } func (c *Client) addOperationAbortMultipartUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpAbortMultipartUpload{}, middleware.After) if err != nil { return err @@ -119,34 +209,38 @@ func (c *Client) addOperationAbortMultipartUploadMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "AbortMultipartUpload"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -158,10 +252,19 @@ func (c *Client) addOperationAbortMultipartUploadMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addAbortMultipartUploadResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpAbortMultipartUploadValidationMiddleware(stack); err != nil { @@ -173,7 +276,7 @@ func (c *Client) addOperationAbortMultipartUploadMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addAbortMultipartUploadUpdateEndpoint(stack, options); err != nil { @@ -191,12 +294,24 @@ func (c *Client) addOperationAbortMultipartUploadMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -211,7 +326,6 @@ func newServiceMetadataMiddleware_opAbortMultipartUpload(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "AbortMultipartUpload", } } @@ -241,139 +355,3 @@ func addAbortMultipartUploadUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opAbortMultipartUploadResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opAbortMultipartUploadResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opAbortMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*AbortMultipartUploadInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addAbortMultipartUploadResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opAbortMultipartUploadResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CompleteMultipartUpload.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CompleteMultipartUpload.go index babfebcc..8c6eaebe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CompleteMultipartUpload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CompleteMultipartUpload.go @@ -4,75 +4,147 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Completes a multipart upload by assembling previously uploaded parts. You first -// initiate the multipart upload and then upload all parts using the UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// operation. After successfully uploading all relevant parts of an upload, you -// call this action to complete the upload. Upon receiving this request, Amazon S3 -// concatenates all the parts in ascending order by part number to create a new -// object. In the Complete Multipart Upload request, you must provide the parts -// list. You must ensure that the parts list is complete. This action concatenates -// the parts that you provide in the list. For each part in the list, you must -// provide the part number and the ETag value, returned after that part was -// uploaded. Processing of a Complete Multipart Upload request could take several -// minutes to complete. After Amazon S3 begins processing the request, it sends an -// HTTP response header that specifies a 200 OK response. While processing is in +// Completes a multipart upload by assembling previously uploaded parts. +// +// You first initiate the multipart upload and then upload all parts using the [UploadPart] +// operation or the [UploadPartCopy]operation. After successfully uploading all relevant parts of +// an upload, you call this CompleteMultipartUpload operation to complete the +// upload. Upon receiving this request, Amazon S3 concatenates all the parts in +// ascending order by part number to create a new object. In the +// CompleteMultipartUpload request, you must provide the parts list and ensure that +// the parts list is complete. The CompleteMultipartUpload API operation +// concatenates the parts that you provide in the list. For each part in the list, +// you must provide the PartNumber value and the ETag value that are returned +// after that part was uploaded. +// +// The processing of a CompleteMultipartUpload request could take several minutes +// to finalize. After Amazon S3 begins processing the request, it sends an HTTP +// response header that specifies a 200 OK response. While processing is in // progress, Amazon S3 periodically sends white space characters to keep the // connection from timing out. A request could fail after the initial 200 OK // response has been sent. This means that a 200 OK response can contain either a -// success or an error. If you call the S3 API directly, make sure to design your +// success or an error. The error response might be embedded in the 200 OK +// response. If you call this API operation directly, make sure to design your // application to parse the contents of the response and handle it appropriately. // If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect // the embedded error and apply error handling per your configuration settings // (including automatically retrying the request as appropriate). If the condition -// persists, the SDKs throws an exception (or, for the SDKs that don't use -// exceptions, they return the error). Note that if CompleteMultipartUpload fails, -// applications should be prepared to retry the failed requests. For more -// information, see Amazon S3 Error Best Practices (https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html) -// . You cannot use Content-Type: application/x-www-form-urlencoded with Complete -// Multipart Upload requests. Also, if you do not provide a Content-Type header, -// CompleteMultipartUpload returns a 200 OK response. For more information about -// multipart uploads, see Uploading Objects Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// . For information about permissions required to use the multipart upload API, -// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// . CompleteMultipartUpload has the following special errors: -// - Error code: EntityTooSmall +// persists, the SDKs throw an exception (or, for the SDKs that don't use +// exceptions, they return an error). +// +// Note that if CompleteMultipartUpload fails, applications should be prepared to +// retry any failed requests (including 500 error responses). For more information, +// see [Amazon S3 Error Best Practices]. +// +// You can't use Content-Type: application/x-www-form-urlencoded for the +// CompleteMultipartUpload requests. Also, if you don't provide a Content-Type +// header, CompleteMultipartUpload can still return a 200 OK response. +// +// For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// - General purpose bucket permissions - For information about permissions +// required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. +// +// If you provide an [additional checksum value]in your MultipartUpload requests and the object is encrypted +// +// with Key Management Service, you must have permission to use the kms:Decrypt +// action for the CompleteMultipartUpload request to succeed. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// Special errors +// +// - Error Code: EntityTooSmall +// // - Description: Your proposed upload is smaller than the minimum allowed // object size. Each part must be at least 5 MB in size, except the last part. -// - 400 Bad Request -// - Error code: InvalidPart +// +// - HTTP Status Code: 400 Bad Request +// +// - Error Code: InvalidPart +// // - Description: One or more of the specified parts could not be found. The -// part might not have been uploaded, or the specified entity tag might not have -// matched the part's entity tag. -// - 400 Bad Request -// - Error code: InvalidPartOrder +// part might not have been uploaded, or the specified ETag might not have matched +// the uploaded part's ETag. +// +// - HTTP Status Code: 400 Bad Request +// +// - Error Code: InvalidPartOrder +// // - Description: The list of parts was not in ascending order. The parts list // must be specified in order by part number. -// - 400 Bad Request -// - Error code: NoSuchUpload +// +// - HTTP Status Code: 400 Bad Request +// +// - Error Code: NoSuchUpload +// // - Description: The specified multipart upload does not exist. The upload ID // might be invalid, or the multipart upload might have been aborted or completed. -// - 404 Not Found +// +// - HTTP Status Code: 404 Not Found +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . // // The following operations are related to CompleteMultipartUpload : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [AbortMultipartUpload] +// +// [ListParts] +// +// [ListMultipartUploads] +// +// [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html +// [Amazon S3 Error Best Practices]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [additional checksum value]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html func (c *Client) CompleteMultipartUpload(ctx context.Context, params *CompleteMultipartUploadInput, optFns ...func(*Options)) (*CompleteMultipartUploadOutput, error) { if params == nil { params = &CompleteMultipartUploadInput{} @@ -90,21 +162,40 @@ func (c *Client) CompleteMultipartUpload(ctx context.Context, params *CompleteMu type CompleteMultipartUploadInput struct { - // Name of the bucket to which the multipart upload was initiated. When using this - // action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form + // Name of the bucket to which the multipart upload was initiated. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -121,120 +212,182 @@ type CompleteMultipartUploadInput struct { // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32 checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32C checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + // [Checking object integrity]in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // Uploads the object only if the ETag (entity tag) value provided during the + // WRITE operation matches the ETag of the object in S3. If the ETag values do not + // match, the operation returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should fetch the + // object's ETag, re-initiate the multipart upload with CreateMultipartUpload , and + // re-upload each part. + // + // Expects the ETag value as a string. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfMatch *string + + // Uploads the object only if the object key name does not already exist in the + // bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should re-initiate the + // multipart upload with CreateMultipartUpload and re-upload each part. + // + // Expects the '*' (asterisk) character. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfNoneMatch *string + // The container for the multipart upload request information. MultipartUpload *types.CompletedMultipartUpload // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The server-side encryption (SSE) algorithm used to encrypt the object. This - // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // parameter is required only when the object was created using a checksum + // algorithm or if your bucket policy requires the use of SSE-C. For more + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key SSECustomerAlgorithm *string // The server-side encryption (SSE) customer managed key. This parameter is needed // only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKey *string // The MD5 server-side encryption (SSE) customer managed key. This parameter is // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKeyMD5 *string noSmithyDocumentSerde } +func (in *CompleteMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type CompleteMultipartUploadOutput struct { // The name of the bucket that contains the newly created object. Does not return - // the access point ARN or access point alias if used. When using this action with - // an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form - // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - // action with an access point through the Amazon Web Services SDKs, you provide - // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - // use this action with S3 on Outposts through the Amazon Web Services SDKs, you - // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // the access point ARN or access point alias if used. + // + // Access points are not supported by directory buckets. Bucket *string // Indicates whether the multipart upload uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + BucketKeyEnabled *bool + + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Entity tag that identifies the newly created object's data. Objects with @@ -243,12 +396,15 @@ type CompleteMultipartUploadOutput struct { // data. If the entity tag is not an MD5 digest of the object data, it will contain // one or more nonhexadecimal characters and/or will consist of less than 32 or // more than 32 hexadecimal digits. For more information about how the entity tag - // is calculated, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // is calculated, see [Checking object integrity]in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ETag *string // If the object expiration is configured, this will contain the expiration date ( // expiry-date ) and rule ID ( rule-id ). The value of rule-id is URL-encoded. + // + // This functionality is not supported for directory buckets. Expiration *string // The object key of the newly created object. @@ -259,10 +415,11 @@ type CompleteMultipartUploadOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string // The server-side encryption algorithm used when storing this object in Amazon S3 @@ -271,6 +428,8 @@ type CompleteMultipartUploadOutput struct { // Version ID of the newly created object, in case the bucket has versioning // turned on. + // + // This functionality is not supported for directory buckets. VersionId *string // Metadata pertaining to the operation's result. @@ -280,6 +439,9 @@ type CompleteMultipartUploadOutput struct { } func (c *Client) addOperationCompleteMultipartUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpCompleteMultipartUpload{}, middleware.After) if err != nil { return err @@ -288,34 +450,38 @@ func (c *Client) addOperationCompleteMultipartUploadMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CompleteMultipartUpload"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -327,10 +493,19 @@ func (c *Client) addOperationCompleteMultipartUploadMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addCompleteMultipartUploadResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpCompleteMultipartUploadValidationMiddleware(stack); err != nil { @@ -342,7 +517,7 @@ func (c *Client) addOperationCompleteMultipartUploadMiddlewares(stack *middlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addCompleteMultipartUploadUpdateEndpoint(stack, options); err != nil { @@ -363,12 +538,24 @@ func (c *Client) addOperationCompleteMultipartUploadMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -383,7 +570,6 @@ func newServiceMetadataMiddleware_opCompleteMultipartUpload(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "CompleteMultipartUpload", } } @@ -413,139 +599,3 @@ func addCompleteMultipartUploadUpdateEndpoint(stack *middleware.Stack, options O DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opCompleteMultipartUploadResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opCompleteMultipartUploadResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opCompleteMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*CompleteMultipartUploadInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addCompleteMultipartUploadResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opCompleteMultipartUploadResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go index 97516a25..49518203 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go @@ -4,158 +4,158 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) -// Creates a copy of an object that is already stored in Amazon S3. You can store -// individual objects of up to 5 TB in Amazon S3. You create a copy of your object -// up to 5 GB in size in a single atomic action using this API. However, to copy an -// object greater than 5 GB, you must use the multipart upload Upload Part - Copy -// (UploadPartCopy) API. For more information, see Copy Object Using the REST -// Multipart Upload API (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html) -// . All copy requests must be authenticated. Additionally, you must have read -// access to the source object and write access to the destination bucket. For more -// information, see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) -// . Both the Region that you want to copy the object from and the Region that you -// want to copy the object to must be enabled for your account. A copy request -// might return an error when Amazon S3 receives the copy request or while Amazon -// S3 is copying the files. If the error occurs before the copy action starts, you -// receive a standard Amazon S3 error. If the error occurs during the copy -// operation, the error response is embedded in the 200 OK response. This means -// that a 200 OK response can contain either a success or an error. If you call -// the S3 API directly, make sure to design your application to parse the contents -// of the response and handle it appropriately. If you use Amazon Web Services -// SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply -// error handling per your configuration settings (including automatically retrying -// the request as appropriate). If the condition persists, the SDKs throws an -// exception (or, for the SDKs that don't use exceptions, they return the error). -// If the copy is successful, you receive a response with information about the -// copied object. If the request is an HTTP 1.1 request, the response is chunk -// encoded. If it were not, it would not contain the content-length, and you would -// need to read the entire body. The copy request charge is based on the storage -// class and Region that you specify for the destination object. The request can -// also result in a data retrieval charge for the source if the source storage -// class bills for data retrieval. For pricing information, see Amazon S3 pricing (http://aws.amazon.com/s3/pricing/) -// . Amazon S3 transfer acceleration does not support cross-Region copies. If you +// Creates a copy of an object that is already stored in Amazon S3. +// +// You can store individual objects of up to 5 TB in Amazon S3. You create a copy +// of your object up to 5 GB in size in a single atomic action using this API. +// However, to copy an object greater than 5 GB, you must use the multipart upload +// Upload Part - Copy (UploadPartCopy) API. For more information, see [Copy Object Using the REST Multipart Upload API]. +// +// You can copy individual objects between general purpose buckets, between +// directory buckets, and between general purpose buckets and directory buckets. +// +// - Amazon S3 supports copy operations using Multi-Region Access Points only as +// a destination when using the Multi-Region Access Point ARN. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// - VPC endpoints don't support cross-Region requests (including copies). If +// you're using VPC endpoints, your source and destination buckets should be in the +// same Amazon Web Services Region as your VPC endpoint. +// +// Both the Region that you want to copy the object from and the Region that you +// want to copy the object to must be enabled for your account. For more +// information about how to enable a Region for your account, see [Enable or disable a Region for standalone accounts]in the Amazon +// Web Services Account Management Guide. +// +// Amazon S3 transfer acceleration does not support cross-Region copies. If you // request a cross-Region copy using a transfer acceleration endpoint, you get a -// 400 Bad Request error. For more information, see Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// . Metadata When copying an object, you can preserve all metadata (the default) -// or specify new metadata. However, the access control list (ACL) is not preserved -// and is set to private for the user making the request. To override the default -// ACL setting, specify a new ACL when generating a copy request. For more -// information, see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) -// . To specify whether you want the object metadata copied from the source object -// or replaced with metadata provided in the request, you can optionally add the -// x-amz-metadata-directive header. When you grant permissions, you can use the -// s3:x-amz-metadata-directive condition key to enforce certain metadata behavior -// when objects are uploaded. For more information, see Specifying Conditions in a -// Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html) -// in the Amazon S3 User Guide. For a complete list of Amazon S3-specific condition -// keys, see Actions, Resources, and Condition Keys for Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html) -// . x-amz-website-redirect-location is unique to each object and must be -// specified in the request headers to copy the value. x-amz-copy-source-if Headers -// To only copy an object under certain conditions, such as whether the Etag -// matches or whether the object was modified before or after a specified date, use -// the following request parameters: -// - x-amz-copy-source-if-match -// - x-amz-copy-source-if-none-match -// - x-amz-copy-source-if-unmodified-since -// - x-amz-copy-source-if-modified-since -// -// If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since -// headers are present in the request and evaluate as follows, Amazon S3 returns -// 200 OK and copies the data: -// - x-amz-copy-source-if-match condition evaluates to true -// - x-amz-copy-source-if-unmodified-since condition evaluates to false -// -// If both the x-amz-copy-source-if-none-match and -// x-amz-copy-source-if-modified-since headers are present in the request and -// evaluate as follows, Amazon S3 returns the 412 Precondition Failed response -// code: -// - x-amz-copy-source-if-none-match condition evaluates to false -// - x-amz-copy-source-if-modified-since condition evaluates to true -// -// All headers with the x-amz- prefix, including x-amz-copy-source , must be -// signed. Server-side encryption Amazon S3 automatically encrypts all new objects -// that are copied to an S3 bucket. When copying an object, if you don't specify -// encryption information in your copy request, the encryption setting of the -// target object is set to the default encryption configuration of the destination -// bucket. By default, all buckets have a base level of encryption configuration -// that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the -// destination bucket has a default encryption configuration that uses server-side -// encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer -// server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or -// server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 -// uses the corresponding KMS key, or a customer-provided key to encrypt the target -// object copy. When you perform a CopyObject operation, if you want to use a -// different type of encryption setting for the target object, you can use other -// appropriate encryption-related headers to encrypt the target object with a KMS -// key, an Amazon S3 managed key, or a customer-provided key. With server-side -// encryption, Amazon S3 encrypts your data as it writes your data to disks in its -// data centers and decrypts the data when you access it. If the encryption setting -// in your request is different from the default encryption configuration of the -// destination bucket, the encryption setting in your request takes precedence. If -// the source object for the copy is stored in Amazon S3 using SSE-C, you must -// provide the necessary encryption information in your request so that Amazon S3 -// can decrypt the object for copying. For more information about server-side -// encryption, see Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// . If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the -// object. For more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon S3 User Guide. Access Control List (ACL)-Specific Request Headers -// When copying an object, you can optionally use headers to grant ACL-based -// permissions. By default, all objects are private. Only the owner has full access -// control. When adding a new object, you can grant permissions to individual -// Amazon Web Services accounts or to predefined groups that are defined by Amazon -// S3. These permissions are then added to the ACL on the object. For more -// information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// and Managing ACLs Using the REST API (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html) -// . If the bucket that you're copying objects to uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect -// permissions. Buckets that use this setting only accept PUT requests that don't -// specify an ACL or PUT requests that specify bucket owner full control ACLs, -// such as the bucket-owner-full-control canned ACL or an equivalent form of this -// ACL expressed in the XML format. For more information, see Controlling -// ownership of objects and disabling ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. If your bucket uses the bucket owner enforced -// setting for Object Ownership, all objects written to the bucket by any account -// will be owned by the bucket owner. Checksums When copying an object, if it has a -// checksum, that checksum will be copied to the new object by default. When you -// copy the object over, you can optionally specify a different checksum algorithm -// to use with the x-amz-checksum-algorithm header. Storage Class Options You can -// use the CopyObject action to change the storage class of an object that is -// already stored in Amazon S3 by using the StorageClass parameter. For more -// information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -// in the Amazon S3 User Guide. If the source object's storage class is GLACIER or -// DEEP_ARCHIVE, or the object's storage class is INTELLIGENT_TIERING and it's S3 -// Intelligent-Tiering access tier (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html#intel-tiering-tier-definition) -// is Archive Access or Deep Archive Access, you must restore a copy of this object -// before you can use it as a source object for the copy operation. For more -// information, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) -// . For more information, see Copying Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html) -// . Versioning By default, x-amz-copy-source header identifies the current -// version of an object to copy. If the current version is a delete marker, Amazon -// S3 behaves as if the object was deleted. To copy a different version, use the -// versionId subresource. If you enable versioning on the target bucket, Amazon S3 -// generates a unique version ID for the object being copied. This version ID is -// different from the version ID of the source object. Amazon S3 returns the -// version ID of the copied object in the x-amz-version-id response header in the -// response. If you do not enable versioning or suspend it on the target bucket, -// the version ID that Amazon S3 generates is always null. The following operations -// are related to CopyObject : -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) +// 400 Bad Request error. For more information, see [Transfer Acceleration]. +// +// Authentication and authorization All CopyObject requests must be authenticated +// and signed by using IAM credentials (access key ID and secret access key for the +// IAM identities). All headers with the x-amz- prefix, including x-amz-copy-source +// , must be signed. For more information, see [REST Authentication]. +// +// Directory buckets - You must use the IAM credentials to authenticate and +// authorize your access to the CopyObject API operation, instead of using the +// temporary security credentials through the CreateSession API operation. +// +// Amazon Web Services CLI or SDKs handles authentication and authorization on +// your behalf. +// +// Permissions You must have read access to the source object and write access to +// the destination bucket. +// +// - General purpose bucket permissions - You must have permissions in an IAM +// policy based on the source and destination bucket types in a CopyObject +// operation. +// +// - If the source object is in a general purpose bucket, you must have +// s3:GetObject permission to read the source object that is being copied. +// +// - If the destination bucket is a general purpose bucket, you must have +// s3:PutObject permission to write the object copy to the destination bucket. +// +// - Directory bucket permissions - You must have permissions in a bucket policy +// or an IAM identity-based policy based on the source and destination bucket types +// in a CopyObject operation. +// +// - If the source object that you want to copy is in a directory bucket, you +// must have the s3express:CreateSession permission in the Action element of a +// policy to read the object. By default, the session is in the ReadWrite mode. +// If you want to restrict the access, you can explicitly set the +// s3express:SessionMode condition key to ReadOnly on the copy source bucket. +// +// - If the copy destination is a directory bucket, you must have the +// s3express:CreateSession permission in the Action element of a policy to write +// the object to the destination. The s3express:SessionMode condition key can't +// be set to ReadOnly on the copy destination bucket. +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. +// +// Response and special errors When the request is an HTTP 1.1 request, the +// response is chunk encoded. When the request is not an HTTP 1.1 request, the +// response would not contain the Content-Length . You always need to read the +// entire response body to check if the copy succeeds. +// +// - If the copy is successful, you receive a response with information about +// the copied object. +// +// - A copy request might return an error when Amazon S3 receives the copy +// request or while Amazon S3 is copying the files. A 200 OK response can contain +// either a success or an error. +// +// - If the error occurs before the copy action starts, you receive a standard +// Amazon S3 error. +// +// - If the error occurs during the copy operation, the error response is +// embedded in the 200 OK response. For example, in a cross-region copy, you may +// encounter throttling and receive a 200 OK response. For more information, see [Resolve the Error 200 response when copying objects to Amazon S3] +// . The 200 OK status code means the copy was accepted, but it doesn't mean the +// copy is complete. Another example is when you disconnect from Amazon S3 before +// the copy is complete, Amazon S3 might cancel the copy and you may receive a +// 200 OK response. You must stay connected to Amazon S3 until the entire +// response is successfully received and processed. +// +// If you call this API operation directly, make sure to design your application +// +// to parse the content of the response and handle it appropriately. If you use +// Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the +// embedded error and apply error handling per your configuration settings +// (including automatically retrying the request as appropriate). If the condition +// persists, the SDKs throw an exception (or, for the SDKs that don't use +// exceptions, they return an error). +// +// Charge The copy request charge is based on the storage class and Region that +// you specify for the destination object. The request can also result in a data +// retrieval charge for the source if the source storage class bills for data +// retrieval. If the copy source is in a different region, the data transfer is +// billed to the copy source account. For pricing information, see [Amazon S3 pricing]. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to CopyObject : +// +// [PutObject] +// +// [GetObject] +// +// [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html +// [Resolve the Error 200 response when copying objects to Amazon S3]: https://repost.aws/knowledge-center/s3-resolve-200-internalerror +// [Copy Object Using the REST Multipart Upload API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html +// [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [Enable or disable a Region for standalone accounts]: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html#manage-acct-regions-enable-standalone +// [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon S3 pricing]: http://aws.amazon.com/s3/pricing/ func (c *Client) CopyObject(ctx context.Context, params *CopyObjectInput, optFns ...func(*Options)) (*CopyObjectOutput, error) { if params == nil { params = &CopyObjectInput{} @@ -173,55 +173,111 @@ func (c *Client) CopyObject(ctx context.Context, params *CopyObjectInput, optFns type CopyObjectInput struct { - // The name of the destination bucket. When using this action with an access - // point, you must direct requests to the access point hostname. The access point - // hostname takes the form + // The name of the destination bucket. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Copying objects across different Amazon Web Services Regions isn't supported + // when the source or destination bucket is in Amazon Web Services Local Zones. The + // source and destination buckets must have the same parent Amazon Web Services + // Region. Otherwise, you get an HTTP 400 Bad Request error with the error code + // InvalidRequest . + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string - // Specifies the source object for the copy operation. You specify the value in - // one of two formats, depending on whether you want to access the source object - // through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html) - // : + // Specifies the source object for the copy operation. The source object can be up + // to 5 GB. If the source object is an object that was uploaded by using a + // multipart upload, the object copy will be a single part object after the source + // object is copied to the destination bucket. + // + // You specify the value of the copy source in one of two formats, depending on + // whether you want to access the source object through an [access point]: + // // - For objects not accessed through an access point, specify the name of the // source bucket and the key of the source object, separated by a slash (/). For - // example, to copy the object reports/january.pdf from the bucket - // awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value must - // be URL-encoded. + // example, to copy the object reports/january.pdf from the general purpose + // bucket awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value + // must be URL-encoded. To copy the object reports/january.pdf from the directory + // bucket awsexamplebucket--use1-az5--x-s3 , use + // awsexamplebucket--use1-az5--x-s3/reports/january.pdf . The value must be + // URL-encoded. + // // - For objects accessed through access points, specify the Amazon Resource // Name (ARN) of the object as accessed through the access point, in the format // arn:aws:s3:::accesspoint//object/ . For example, to copy the object // reports/january.pdf through access point my-access-point owned by account // 123456789012 in Region us-west-2 , use the URL encoding of // arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf - // . The value must be URL encoded. Amazon S3 supports copy operations using access - // points only when the source and destination buckets are in the same Amazon Web - // Services Region. Alternatively, for objects accessed through Amazon S3 on - // Outposts, specify the ARN of the object as accessed in the format + // . The value must be URL encoded. + // + // - Amazon S3 supports copy operations using Access points only when the source + // and destination buckets are in the same Amazon Web Services Region. + // + // - Access points are not supported by directory buckets. + // + // Alternatively, for objects accessed through Amazon S3 on Outposts, specify the + // ARN of the object as accessed in the format // arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object // reports/january.pdf through outpost my-outpost owned by account 123456789012 // in Region us-west-2 , use the URL encoding of // arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf // . The value must be URL-encoded. - // To copy a specific version of an object, append ?versionId= to the value (for - // example, + // + // If your source bucket versioning is enabled, the x-amz-copy-source header by + // default identifies the current version of an object to copy. If the current + // version is a delete marker, Amazon S3 behaves as if the object was deleted. To + // copy a different version, use the versionId query parameter. Specifically, + // append ?versionId= to the value (for example, // awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 // ). If you don't specify a version ID, Amazon S3 copies the latest version of the // source object. // + // If you enable versioning on the destination bucket, Amazon S3 generates a + // unique version ID for the copied object. This version ID is different from the + // version ID of the source object. Amazon S3 returns the version ID of the copied + // object in the x-amz-version-id response header in the response. + // + // If you do not enable versioning or suspend it on the destination bucket, the + // version ID that Amazon S3 generates in the x-amz-version-id response header is + // always null. + // + // Directory buckets - S3 Versioning isn't enabled and supported for directory + // buckets. + // + // [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html + // // This member is required. CopySource *string @@ -230,222 +286,593 @@ type CopyObjectInput struct { // This member is required. Key *string - // The canned ACL to apply to the object. This action is not supported by Amazon - // S3 on Outposts. + // The canned access control list (ACL) to apply to the object. + // + // When you copy an object, the ACL metadata is not preserved and is set to private + // by default. Only the owner has full access control. To override the default ACL + // setting, specify a new ACL when you generate a copy request. For more + // information, see [Using ACLs]. + // + // If the destination bucket that you're copying objects to uses the bucket owner + // enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect + // permissions. Buckets that use this setting only accept PUT requests that don't + // specify an ACL or PUT requests that specify bucket owner full control ACLs, + // such as the bucket-owner-full-control canned ACL or an equivalent form of this + // ACL expressed in the XML format. For more information, see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 + // User Guide. + // + // - If your destination bucket uses the bucket owner enforced setting for + // Object Ownership, all objects written to the bucket by any account will be owned + // by the bucket owner. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html + // [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html ACL types.ObjectCannedACL // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption // with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). + // If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. + // // Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object // encryption with SSE-KMS. Specifying this header with a COPY action doesn’t // affect bucket-level settings for S3 Bucket Key. - BucketKeyEnabled bool + // + // For more information, see [Amazon S3 Bucket Keys] in the Amazon S3 User Guide. + // + // Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS + // encrypted objects from general purpose buckets to directory buckets, from + // directory buckets to general purpose buckets, or between directory buckets, + // through [CopyObject]. In this case, Amazon S3 makes a call to KMS every time a copy request + // is made for a KMS-encrypted object. + // + // [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + BucketKeyEnabled *bool - // Specifies caching behavior along the request/reply chain. + // Specifies the caching behavior along the request/reply chain. CacheControl *string - // Indicates the algorithm you want Amazon S3 to use to create the checksum for - // the object. For more information, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // Indicates the algorithm that you want Amazon S3 to use to create the checksum + // for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. + // + // When you copy an object, if the source object has a checksum, that checksum + // value will be copied to the new object by default. If the CopyObject request + // does not include this x-amz-checksum-algorithm header, the checksum algorithm + // will be copied from the source object to the destination object (if it's present + // on the source object). You can optionally specify a different checksum algorithm + // to use with the x-amz-checksum-algorithm header. Unrecognized or unsupported + // values will respond with the HTTP status code 400 Bad Request . + // + // For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + // default checksum algorithm that's used for performance. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // Specifies presentational information for the object. + // Specifies presentational information for the object. Indicates whether an + // object should be displayed in a web browser or downloaded as a file. It allows + // specifying the desired filename for the downloaded file. ContentDisposition *string // Specifies what content encodings have been applied to the object and thus what // decoding mechanisms must be applied to obtain the media-type referenced by the // Content-Type header field. + // + // For directory buckets, only the aws-chunked value is supported in this header + // field. ContentEncoding *string // The language the content is in. ContentLanguage *string - // A standard MIME type describing the format of the object data. + // A standard MIME type that describes the format of the object data. ContentType *string // Copies the object if its entity tag (ETag) matches the specified tag. + // + // If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + // headers are present in the request and evaluate as follows, Amazon S3 returns + // 200 OK and copies the data: + // + // - x-amz-copy-source-if-match condition evaluates to true + // + // - x-amz-copy-source-if-unmodified-since condition evaluates to false CopySourceIfMatch *string // Copies the object if it has been modified since the specified time. + // + // If both the x-amz-copy-source-if-none-match and + // x-amz-copy-source-if-modified-since headers are present in the request and + // evaluate as follows, Amazon S3 returns the 412 Precondition Failed response + // code: + // + // - x-amz-copy-source-if-none-match condition evaluates to false + // + // - x-amz-copy-source-if-modified-since condition evaluates to true CopySourceIfModifiedSince *time.Time // Copies the object if its entity tag (ETag) is different than the specified ETag. + // + // If both the x-amz-copy-source-if-none-match and + // x-amz-copy-source-if-modified-since headers are present in the request and + // evaluate as follows, Amazon S3 returns the 412 Precondition Failed response + // code: + // + // - x-amz-copy-source-if-none-match condition evaluates to false + // + // - x-amz-copy-source-if-modified-since condition evaluates to true CopySourceIfNoneMatch *string // Copies the object if it hasn't been modified since the specified time. + // + // If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since + // headers are present in the request and evaluate as follows, Amazon S3 returns + // 200 OK and copies the data: + // + // - x-amz-copy-source-if-match condition evaluates to true + // + // - x-amz-copy-source-if-unmodified-since condition evaluates to false CopySourceIfUnmodifiedSince *time.Time // Specifies the algorithm to use when decrypting the source object (for example, - // AES256). + // AES256 ). + // + // If the source object for the copy is stored in Amazon S3 using SSE-C, you must + // provide the necessary encryption information in your request so that Amazon S3 + // can decrypt the object for copying. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - // the source object. The encryption key provided in this header must be one that - // was used when the source object was created. + // the source object. The encryption key provided in this header must be the same + // one that was used when the source object was created. + // + // If the source object for the copy is stored in Amazon S3 using SSE-C, you must + // provide the necessary encryption information in your request so that Amazon S3 + // can decrypt the object for copying. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // If the source object for the copy is stored in Amazon S3 using SSE-C, you must + // provide the necessary encryption information in your request so that Amazon S3 + // can decrypt the object for copying. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerKeyMD5 *string - // The account ID of the expected destination bucket owner. If the destination - // bucket is owned by a different account, the request fails with the HTTP status - // code 403 Forbidden (access denied). + // The account ID of the expected destination bucket owner. If the account ID that + // you provide does not match the actual owner of the destination bucket, the + // request fails with the HTTP status code 403 Forbidden (access denied). ExpectedBucketOwner *string - // The account ID of the expected source bucket owner. If the source bucket is - // owned by a different account, the request fails with the HTTP status code 403 - // Forbidden (access denied). + // The account ID of the expected source bucket owner. If the account ID that you + // provide does not match the actual owner of the source bucket, the request fails + // with the HTTP status code 403 Forbidden (access denied). ExpectedSourceBucketOwner *string // The date and time at which the object is no longer cacheable. Expires *time.Time - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. This - // action is not supported by Amazon S3 on Outposts. + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantFullControl *string - // Allows grantee to read the object data and its metadata. This action is not - // supported by Amazon S3 on Outposts. + // Allows grantee to read the object data and its metadata. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantRead *string - // Allows grantee to read the object ACL. This action is not supported by Amazon - // S3 on Outposts. + // Allows grantee to read the object ACL. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantReadACP *string - // Allows grantee to write the ACL for the applicable object. This action is not - // supported by Amazon S3 on Outposts. + // Allows grantee to write the ACL for the applicable object. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantWriteACP *string // A map of metadata to store with the object in S3. Metadata map[string]string // Specifies whether the metadata is copied from the source object or replaced - // with metadata provided in the request. + // with metadata that's provided in the request. When copying an object, you can + // preserve all metadata (the default) or specify new metadata. If this header + // isn’t specified, COPY is the default behavior. + // + // General purpose bucket - For general purpose buckets, when you grant + // permissions, you can use the s3:x-amz-metadata-directive condition key to + // enforce certain metadata behavior when objects are uploaded. For more + // information, see [Amazon S3 condition key examples]in the Amazon S3 User Guide. + // + // x-amz-website-redirect-location is unique to each object and is not copied when + // using the x-amz-metadata-directive header. To copy the value, you must specify + // x-amz-website-redirect-location in the request header. + // + // [Amazon S3 condition key examples]: https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html MetadataDirective types.MetadataDirective - // Specifies whether you want to apply a legal hold to the copied object. + // Specifies whether you want to apply a legal hold to the object copy. + // + // This functionality is not supported for directory buckets. ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus - // The Object Lock mode that you want to apply to the copied object. + // The Object Lock mode that you want to apply to the object copy. + // + // This functionality is not supported for directory buckets. ObjectLockMode types.ObjectLockMode - // The date and time when you want the copied object's Object Lock to expire. + // The date and time when you want the Object Lock of the object copy to expire. + // + // This functionality is not supported for directory buckets. ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Specifies the algorithm to use when encrypting the object (for example, AES256 ). + // + // When you perform a CopyObject operation, if you want to use a different type of + // encryption setting for the target object, you can specify appropriate + // encryption-related headers to encrypt the target object with an Amazon S3 + // managed key, a KMS key, or a customer-provided key. If the encryption setting in + // your request is different from the default encryption configuration of the + // destination bucket, the encryption setting in your request takes precedence. + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in // encrypting data. This value is used to store the object and then it is - // discarded; Amazon S3 does not store the encryption key. The key must be + // discarded. Amazon S3 does not store the encryption key. The key must be // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerKeyMD5 *string - // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. + // Specifies the Amazon Web Services KMS Encryption Context as an additional + // encryption context to use for the destination object encryption. The value of + // this header is a base64-encoded UTF-8 string holding JSON with the encryption + // context key-value pairs. + // + // General purpose buckets - This value must be explicitly added to specify + // encryption context for CopyObject requests if you want an additional encryption + // context for your destination object. The additional encryption context of the + // source object won't be copied to the destination object. For more information, + // see [Encryption context]in the Amazon S3 User Guide. + // + // Directory buckets - You can optionally provide an explicit encryption context + // value. The value must match the default encryption context - the bucket Amazon + // Resource Name (ARN). An additional encryption context value is not supported. + // + // [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context SSEKMSEncryptionContext *string - // Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object + // Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object // encryption. All GET and PUT requests for an object protected by KMS will fail if // they're not made via SSL or using SigV4. For information about configuring any // of the officially supported Amazon Web Services SDKs and Amazon Web Services - // CLI, see Specifying the Signature Version in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) - // in the Amazon S3 User Guide. + // CLI, see [Specifying the Signature Version in Request Authentication]in the Amazon S3 User Guide. + // + // Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + // the x-amz-server-side-encryption-aws-kms-key-id header is implicitly assigned + // the ID of the KMS symmetric encryption customer managed key that's configured + // for your directory bucket's default encryption setting. If you want to specify + // the x-amz-server-side-encryption-aws-kms-key-id header explicitly, you can only + // specify it with the ID (Key ID or Key ARN) of the KMS customer managed key + // that's configured for your directory bucket's default encryption setting. + // Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key + // ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + // configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + // bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't supported. + // + // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm used when storing this object in Amazon + // S3. Unrecognized or unsupported values won’t write a destination object and will + // receive a 400 Bad Request response. + // + // Amazon S3 automatically encrypts all new objects that are copied to an S3 + // bucket. When copying an object, if you don't specify encryption information in + // your copy request, the encryption setting of the target object is set to the + // default encryption configuration of the destination bucket. By default, all + // buckets have a base level of encryption configuration that uses server-side + // encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a + // different default encryption configuration, Amazon S3 uses the corresponding + // encryption key to encrypt the target object copy. + // + // With server-side encryption, Amazon S3 encrypts your data as it writes your + // data to disks in its data centers and decrypts the data when you access it. For + // more information about server-side encryption, see [Using Server-Side Encryption]in the Amazon S3 User Guide. + // + // General purpose buckets + // + // - For general purpose buckets, there are the following supported options for + // server-side encryption: server-side encryption with Key Management Service (KMS) + // keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS + // keys (DSSE-KMS), and server-side encryption with customer-provided encryption + // keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided + // key to encrypt the target object copy. + // + // - When you perform a CopyObject operation, if you want to use a different type + // of encryption setting for the target object, you can specify appropriate + // encryption-related headers to encrypt the target object with an Amazon S3 + // managed key, a KMS key, or a customer-provided key. If the encryption setting in + // your request is different from the default encryption configuration of the + // destination bucket, the encryption setting in your request takes precedence. + // + // Directory buckets + // + // - For directory buckets, there are only two supported options for server-side + // encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( + // AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). We + // recommend that the bucket's default encryption uses the desired encryption + // configuration and you don't override the bucket default encryption in your + // CreateSession requests or PUT object requests. Then, new objects are + // automatically encrypted with the desired encryption settings. For more + // information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the + // encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + // + // - To encrypt new object copies to a directory bucket with SSE-KMS, we + // recommend you specify SSE-KMS as the directory bucket's default encryption + // configuration with a KMS key (specifically, a [customer managed key]). The [Amazon Web Services managed key]( aws/s3 ) isn't + // supported. Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket + // for the lifetime of the bucket. After you specify a customer managed key for + // SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS + // configuration. Then, when you perform a CopyObject operation and want to + // specify server-side encryption settings for new object copies with SSE-KMS in + // the encryption-related request headers, you must ensure the encryption key is + // the same customer managed key that you specified for the directory bucket's + // default encryption configuration. + // + // [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html + // [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk ServerSideEncryption types.ServerSideEncryption // If the x-amz-storage-class header is not used, the copied object will be stored // in the STANDARD Storage Class by default. The STANDARD storage class provides // high durability and high availability. Depending on performance needs, you can - // specify a different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS - // Storage Class. For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. + // specify a different Storage Class. + // + // - Directory buckets - For directory buckets, only the S3 Express One Zone + // storage class is supported to store newly created objects. Unsupported storage + // class values won't write a destination object and will respond with the HTTP + // status code 400 Bad Request . + // + // - Amazon S3 on Outposts - S3 on Outposts only uses the OUTPOSTS Storage Class. + // + // You can use the CopyObject action to change the storage class of an object that + // is already stored in Amazon S3 by using the x-amz-storage-class header. For + // more information, see [Storage Classes]in the Amazon S3 User Guide. + // + // Before using an object as a source object for the copy operation, you must + // restore a copy of it if it meets any of the following conditions: + // + // - The storage class of the source object is GLACIER or DEEP_ARCHIVE . + // + // - The storage class of the source object is INTELLIGENT_TIERING and it's [S3 Intelligent-Tiering access tier]is + // Archive Access or Deep Archive Access . + // + // For more information, see [RestoreObject] and [Copying Objects] in the Amazon S3 User Guide. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html + // [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html + // [Copying Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html + // [S3 Intelligent-Tiering access tier]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering-overview.html#intel-tiering-tier-definition StorageClass types.StorageClass - // The tag-set for the object destination object this value must be used in - // conjunction with the TaggingDirective . The tag-set must be encoded as URL Query + // The tag-set for the object copy in the destination bucket. This value must be + // used in conjunction with the x-amz-tagging-directive if you choose REPLACE for + // the x-amz-tagging-directive . If you choose COPY for the x-amz-tagging-directive + // , you don't need to set the x-amz-tagging header, because the tag-set will be + // copied from the source object directly. The tag-set must be encoded as URL Query // parameters. + // + // The default value is the empty value. + // + // Directory buckets - For directory buckets in a CopyObject operation, only the + // empty tag-set is supported. Any requests that attempt to write non-empty tags + // into directory buckets will receive a 501 Not Implemented status code. When the + // destination bucket is a directory bucket, you will receive a 501 Not Implemented + // response in any of the following situations: + // + // - When you attempt to COPY the tag-set from an S3 source object that has + // non-empty tags. + // + // - When you attempt to REPLACE the tag-set of a source object and set a + // non-empty value to x-amz-tagging . + // + // - When you don't set the x-amz-tagging-directive header and the source object + // has non-empty tags. This is because the default value of + // x-amz-tagging-directive is COPY . + // + // Because only the empty tag-set is supported for directory buckets in a + // CopyObject operation, the following situations are allowed: + // + // - When you attempt to COPY the tag-set from a directory bucket source object + // that has no tags to a general purpose bucket. It copies an empty tag-set to the + // destination object. + // + // - When you attempt to REPLACE the tag-set of a directory bucket source object + // and set the x-amz-tagging value of the directory bucket destination object to + // empty. + // + // - When you attempt to REPLACE the tag-set of a general purpose bucket source + // object that has non-empty tags and set the x-amz-tagging value of the + // directory bucket destination object to empty. + // + // - When you attempt to REPLACE the tag-set of a directory bucket source object + // and don't set the x-amz-tagging value of the directory bucket destination + // object. This is because the default value of x-amz-tagging is the empty value. Tagging *string - // Specifies whether the object tag-set are copied from the source object or - // replaced with tag-set provided in the request. + // Specifies whether the object tag-set is copied from the source object or + // replaced with the tag-set that's provided in the request. + // + // The default value is COPY . + // + // Directory buckets - For directory buckets in a CopyObject operation, only the + // empty tag-set is supported. Any requests that attempt to write non-empty tags + // into directory buckets will receive a 501 Not Implemented status code. When the + // destination bucket is a directory bucket, you will receive a 501 Not Implemented + // response in any of the following situations: + // + // - When you attempt to COPY the tag-set from an S3 source object that has + // non-empty tags. + // + // - When you attempt to REPLACE the tag-set of a source object and set a + // non-empty value to x-amz-tagging . + // + // - When you don't set the x-amz-tagging-directive header and the source object + // has non-empty tags. This is because the default value of + // x-amz-tagging-directive is COPY . + // + // Because only the empty tag-set is supported for directory buckets in a + // CopyObject operation, the following situations are allowed: + // + // - When you attempt to COPY the tag-set from a directory bucket source object + // that has no tags to a general purpose bucket. It copies an empty tag-set to the + // destination object. + // + // - When you attempt to REPLACE the tag-set of a directory bucket source object + // and set the x-amz-tagging value of the directory bucket destination object to + // empty. + // + // - When you attempt to REPLACE the tag-set of a general purpose bucket source + // object that has non-empty tags and set the x-amz-tagging value of the + // directory bucket destination object to empty. + // + // - When you attempt to REPLACE the tag-set of a directory bucket source object + // and don't set the x-amz-tagging value of the directory bucket destination + // object. This is because the default value of x-amz-tagging is the empty value. TaggingDirective types.TaggingDirective - // If the bucket is configured as a website, redirects requests for this object to - // another object in the same bucket or to an external URL. Amazon S3 stores the - // value of this header in the object metadata. This value is unique to each object - // and is not copied when using the x-amz-metadata-directive header. Instead, you - // may opt to provide this header in combination with the directive. + // If the destination bucket is configured as a website, redirects requests for + // this object copy to another object in the same bucket or to an external URL. + // Amazon S3 stores the value of this header in the object metadata. This value is + // unique to each object and is not copied when using the x-amz-metadata-directive + // header. Instead, you may opt to provide this header in combination with the + // x-amz-metadata-directive header. + // + // This functionality is not supported for directory buckets. WebsiteRedirectLocation *string noSmithyDocumentSerde } +func (in *CopyObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.CopySource = in.CopySource + p.Key = in.Key + p.DisableS3ExpressSessionAuth = ptr.Bool(true) +} + type CopyObjectOutput struct { // Indicates whether the copied object uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // Container for all response elements. CopyObjectResult *types.CopyObjectResult - // Version of the copied object in the destination bucket. + // Version ID of the source object that was copied. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceVersionId *string // If the object expiration is configured, the response includes this header. + // + // Object expiration information is not returned in directory buckets and this + // header returns the value " NotImplemented " in all responses for directory + // buckets. Expiration *string // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the Amazon Web Services KMS Encryption Context to use for + // If present, indicates the Amazon Web Services KMS Encryption Context to use for // object encryption. The value of this header is a base64-encoded UTF-8 string // holding JSON with the encryption context key-value pairs. SSEKMSEncryptionContext *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms , aws:kms:dsse ). ServerSideEncryption types.ServerSideEncryption // Version ID of the newly created copy. + // + // This functionality is not supported for directory buckets. VersionId *string // Metadata pertaining to the operation's result. @@ -455,6 +882,9 @@ type CopyObjectOutput struct { } func (c *Client) addOperationCopyObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpCopyObject{}, middleware.After) if err != nil { return err @@ -463,34 +893,38 @@ func (c *Client) addOperationCopyObjectMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CopyObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -502,10 +936,19 @@ func (c *Client) addOperationCopyObjectMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addCopyObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpCopyObjectValidationMiddleware(stack); err != nil { @@ -517,7 +960,7 @@ func (c *Client) addOperationCopyObjectMiddlewares(stack *middleware.Stack, opti if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addCopyObjectUpdateEndpoint(stack, options); err != nil { @@ -538,12 +981,24 @@ func (c *Client) addOperationCopyObjectMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -558,7 +1013,6 @@ func newServiceMetadataMiddleware_opCopyObject(region string) *awsmiddleware.Reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "CopyObject", } } @@ -588,139 +1042,3 @@ func addCopyObjectUpdateEndpoint(stack *middleware.Stack, options Options) error DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opCopyObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opCopyObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opCopyObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*CopyObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addCopyObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opCopyObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucket.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucket.go index 9da6f8b9..6b4283e9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucket.go @@ -4,82 +4,129 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new S3 bucket. To create a bucket, you must register with Amazon S3 -// and have a valid Amazon Web Services Access Key ID to authenticate requests. -// Anonymous requests are never allowed to create buckets. By creating the bucket, -// you become the bucket owner. Not every string is an acceptable bucket name. For -// information about bucket naming restrictions, see Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) -// . If you want to create an Amazon S3 on Outposts bucket, see Create Bucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html) -// . By default, the bucket is created in the US East (N. Virginia) Region. You can -// optionally specify a Region in the request body. To constrain the bucket -// creation to a specific Region, you can use LocationConstraint (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketConfiguration.html) -// condition key. You might choose a Region to optimize latency, minimize costs, or -// address regulatory requirements. For example, if you reside in Europe, you will -// probably find it advantageous to create buckets in the Europe (Ireland) Region. -// For more information, see Accessing a bucket (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) -// . If you send your create bucket request to the s3.amazonaws.com endpoint, the -// request goes to the us-east-1 Region. Accordingly, the signature calculations -// in Signature Version 4 must use us-east-1 as the Region, even if the location -// constraint in the request specifies another Region where the bucket is to be -// created. If you create a bucket in a Region other than US East (N. Virginia), -// your application must be able to handle 307 redirect. For more information, see -// Virtual hosting of buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html) -// . Permissions In addition to s3:CreateBucket , the following permissions are -// required when your CreateBucket request includes specific headers: -// - Access control lists (ACLs) - If your CreateBucket request specifies access -// control list (ACL) permissions and the ACL is public-read, public-read-write, -// authenticated-read, or if you specify access permissions explicitly through any -// other ACL, both s3:CreateBucket and s3:PutBucketAcl permissions are needed. If -// the ACL for the CreateBucket request is private or if the request doesn't -// specify any ACLs, only s3:CreateBucket permission is needed. -// - Object Lock - If ObjectLockEnabledForBucket is set to true in your -// CreateBucket request, s3:PutBucketObjectLockConfiguration and -// s3:PutBucketVersioning permissions are required. +// This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts +// bucket, see [CreateBucket]CreateBucket . +// +// Creates a new S3 bucket. To create a bucket, you must set up Amazon S3 and have +// a valid Amazon Web Services Access Key ID to authenticate requests. Anonymous +// requests are never allowed to create buckets. By creating the bucket, you become +// the bucket owner. +// +// There are two types of buckets: general purpose buckets and directory buckets. +// For more information about these bucket types, see [Creating, configuring, and working with Amazon S3 buckets]in the Amazon S3 User Guide. +// +// - General purpose buckets - If you send your CreateBucket request to the +// s3.amazonaws.com global endpoint, the request goes to the us-east-1 Region. So +// the signature calculations in Signature Version 4 must use us-east-1 as the +// Region, even if the location constraint in the request specifies another Region +// where the bucket is to be created. If you create a bucket in a Region other than +// US East (N. Virginia), your application must be able to handle 307 redirect. For +// more information, see [Virtual hosting of buckets]in the Amazon S3 User Guide. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Regional endpoint. These endpoints support path-style +// requests in the format +// https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - In addition to the s3:CreateBucket +// permission, the following permissions are required in a policy when your +// CreateBucket request includes specific headers: +// +// - Access control lists (ACLs) - In your CreateBucket request, if you specify +// an access control list (ACL) and set it to public-read , public-read-write , +// authenticated-read , or if you explicitly specify any other custom ACLs, both +// s3:CreateBucket and s3:PutBucketAcl permissions are required. In your +// CreateBucket request, if you set the ACL to private , or if you don't specify +// any ACLs, only the s3:CreateBucket permission is required. +// +// - Object Lock - In your CreateBucket request, if you set +// x-amz-bucket-object-lock-enabled to true, the +// s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning permissions are +// required. +// // - S3 Object Ownership - If your CreateBucket request includes the // x-amz-object-ownership header, then the s3:PutBucketOwnershipControls -// permission is required. By default, ObjectOwnership is set to -// BucketOWnerEnforced and ACLs are disabled. We recommend keeping ACLs disabled, -// except in uncommon use cases where you must control access for each object -// individually. If you want to change the ObjectOwnership setting, you can use -// the x-amz-object-ownership header in your CreateBucket request to set the -// ObjectOwnership setting of your choice. For more information about S3 Object -// Ownership, see Controlling object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// - S3 Block Public Access - If your specific use case requires granting public -// access to your S3 resources, you can disable Block Public Access. You can create -// a new bucket with Block Public Access enabled, then separately call the -// DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) -// API. To use this operation, you must have the s3:PutBucketPublicAccessBlock -// permission. By default, all Block Public Access settings are enabled for new -// buckets. To avoid inadvertent exposure of your resources, we recommend keeping -// the S3 Block Public Access settings enabled. For more information about S3 Block -// Public Access, see Blocking public access to your Amazon S3 storage (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. +// permission is required. +// +// To set an ACL on a bucket as part of a CreateBucket request, you must explicitly +// +// set S3 Object Ownership for the bucket to a different value than the default, +// BucketOwnerEnforced . Additionally, if your desired bucket ACL grants public +// access, you must first create the bucket (without the bucket ACL) and then +// explicitly disable Block Public Access on the bucket before using PutBucketAcl +// to set the ACL. If you try to create a bucket with a public ACL, the request +// will fail. +// +// For the majority of modern use cases in S3, we recommend that you keep all +// +// Block Public Access settings enabled and keep ACLs disabled. If you would like +// to share data with users outside of your account, you can use bucket policies as +// needed. For more information, see [Controlling ownership of objects and disabling ACLs for your bucket]and [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. +// +// - S3 Block Public Access - If your specific use case requires granting public +// access to your S3 resources, you can disable Block Public Access. Specifically, +// you can create a new bucket with Block Public Access enabled, then separately +// call the [DeletePublicAccessBlock]DeletePublicAccessBlock API. To use this operation, you must have the +// s3:PutBucketPublicAccessBlock permission. For more information about S3 Block +// Public Access, see [Blocking public access to your Amazon S3 storage]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - You must have the s3express:CreateBucket +// permission in an IAM identity-based policy instead of a bucket policy. +// Cross-account access to this API operation isn't supported. This operation can +// only be performed by the Amazon Web Services account that owns the resource. For +// more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the +// Amazon S3 User Guide. +// +// The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public +// +// Access are not supported for directory buckets. For directory buckets, all Block +// Public Access settings are enabled at the bucket level and S3 Object Ownership +// is set to Bucket owner enforced (ACLs disabled). These settings can't be +// modified. +// +// For more information about permissions for creating and working with directory +// +// buckets, see [Directory buckets]in the Amazon S3 User Guide. For more information about +// supported S3 features for directory buckets, see [Features of S3 Express One Zone]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following operations are related to CreateBucket : +// +// [PutObject] +// +// [DeleteBucket] +// +// [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html +// [Virtual hosting of buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html // -// If your CreateBucket request sets BucketOwnerEnforced for Amazon S3 Object -// Ownership and specifies a bucket ACL that provides access to an external Amazon -// Web Services account, your request fails with a 400 error and returns the -// InvalidBucketAcLWithObjectOwnership error code. For more information, see -// Setting Object Ownership on an existing bucket (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-ownership-existing-bucket.html) -// in the Amazon S3 User Guide. The following operations are related to -// CreateBucket : -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) +// [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html +// [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html +// [Features of S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-one-zone.html#s3-express-features +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html +// [Blocking public access to your Amazon S3 storage]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html func (c *Client) CreateBucket(ctx context.Context, params *CreateBucketInput, optFns ...func(*Options)) (*CreateBucketOutput, error) { if params == nil { params = &CreateBucketInput{} @@ -99,10 +146,27 @@ type CreateBucketInput struct { // The name of the bucket to create. // + // General purpose buckets - For information about bucket naming restrictions, see [Bucket naming rules] + // in the Amazon S3 User Guide. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [Bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html + // // This member is required. Bucket *string // The canned ACL to apply to the bucket. + // + // This functionality is not supported for directory buckets. ACL types.BucketCannedACL // The configuration information for the bucket. @@ -110,41 +174,75 @@ type CreateBucketInput struct { // Allows grantee the read, write, read ACP, and write ACP permissions on the // bucket. + // + // This functionality is not supported for directory buckets. GrantFullControl *string // Allows grantee to list the objects in the bucket. + // + // This functionality is not supported for directory buckets. GrantRead *string // Allows grantee to read the bucket ACL. + // + // This functionality is not supported for directory buckets. GrantReadACP *string - // Allows grantee to create new objects in the bucket. For the bucket and object - // owners of existing objects, also allows deletions and overwrites of those - // objects. + // Allows grantee to create new objects in the bucket. + // + // For the bucket and object owners of existing objects, also allows deletions and + // overwrites of those objects. + // + // This functionality is not supported for directory buckets. GrantWrite *string // Allows grantee to write the ACL for the applicable bucket. + // + // This functionality is not supported for directory buckets. GrantWriteACP *string // Specifies whether you want S3 Object Lock to be enabled for the new bucket. - ObjectLockEnabledForBucket bool + // + // This functionality is not supported for directory buckets. + ObjectLockEnabledForBucket *bool // The container element for object ownership for a bucket's ownership controls. + // // BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the // bucket owner if the objects are uploaded with the bucket-owner-full-control - // canned ACL. ObjectWriter - The uploading account will own the object if the - // object is uploaded with the bucket-owner-full-control canned ACL. + // canned ACL. + // + // ObjectWriter - The uploading account will own the object if the object is + // uploaded with the bucket-owner-full-control canned ACL. + // // BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer // affect permissions. The bucket owner automatically owns and has full control // over every object in the bucket. The bucket only accepts PUT requests that don't - // specify an ACL or bucket owner full control ACLs, such as the - // bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed - // in the XML format. + // specify an ACL or specify bucket owner full control ACLs (such as the predefined + // bucket-owner-full-control canned ACL or a custom ACL in XML format that grants + // the same permissions). + // + // By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are + // disabled. We recommend keeping ACLs disabled, except in uncommon use cases where + // you must control access for each object individually. For more information about + // S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. Directory buckets + // use the bucket owner enforced setting for S3 Object Ownership. + // + // [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html ObjectOwnership types.ObjectOwnership noSmithyDocumentSerde } +func (in *CreateBucketInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) + p.DisableAccessPoints = ptr.Bool(true) +} + type CreateBucketOutput struct { // A forward slash followed by the name of the bucket. @@ -157,6 +255,9 @@ type CreateBucketOutput struct { } func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpCreateBucket{}, middleware.After) if err != nil { return err @@ -165,34 +266,38 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateBucket"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -204,10 +309,19 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addCreateBucketResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpCreateBucketValidationMiddleware(stack); err != nil { @@ -219,7 +333,7 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addCreateBucketUpdateEndpoint(stack, options); err != nil { @@ -237,12 +351,24 @@ func (c *Client) addOperationCreateBucketMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -257,7 +383,6 @@ func newServiceMetadataMiddleware_opCreateBucket(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "CreateBucket", } } @@ -287,141 +412,3 @@ func addCreateBucketUpdateEndpoint(stack *middleware.Stack, options Options) err DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opCreateBucketResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opCreateBucketResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opCreateBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*CreateBucketInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - params.DisableAccessPoints = ptr.Bool(true) - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addCreateBucketResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opCreateBucketResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucketMetadataTableConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucketMetadataTableConfiguration.go new file mode 100644 index 00000000..4e613995 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateBucketMetadataTableConfiguration.go @@ -0,0 +1,286 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a metadata table configuration for a general purpose bucket. For more +// information, see [Accelerating data discovery with S3 Metadata]in the Amazon S3 User Guide. +// +// Permissions To use this operation, you must have the following permissions. For +// more information, see [Setting up permissions for configuring metadata tables]in the Amazon S3 User Guide. +// +// If you also want to integrate your table bucket with Amazon Web Services +// analytics services so that you can query your metadata table, you need +// additional permissions. For more information, see [Integrating Amazon S3 Tables with Amazon Web Services analytics services]in the Amazon S3 User Guide. +// +// - s3:CreateBucketMetadataTableConfiguration +// +// - s3tables:CreateNamespace +// +// - s3tables:GetTable +// +// - s3tables:CreateTable +// +// - s3tables:PutTablePolicy +// +// The following operations are related to CreateBucketMetadataTableConfiguration : +// +// [DeleteBucketMetadataTableConfiguration] +// +// [GetBucketMetadataTableConfiguration] +// +// [Setting up permissions for configuring metadata tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html +// [GetBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html +// [DeleteBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html +// [Accelerating data discovery with S3 Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html +// [Integrating Amazon S3 Tables with Amazon Web Services analytics services]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html +func (c *Client) CreateBucketMetadataTableConfiguration(ctx context.Context, params *CreateBucketMetadataTableConfigurationInput, optFns ...func(*Options)) (*CreateBucketMetadataTableConfigurationOutput, error) { + if params == nil { + params = &CreateBucketMetadataTableConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateBucketMetadataTableConfiguration", params, optFns, c.addOperationCreateBucketMetadataTableConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateBucketMetadataTableConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateBucketMetadataTableConfigurationInput struct { + + // The general purpose bucket that you want to create the metadata table + // configuration in. + // + // This member is required. + Bucket *string + + // The contents of your metadata table configuration. + // + // This member is required. + MetadataTableConfiguration *types.MetadataTableConfiguration + + // The checksum algorithm to use with your metadata table configuration. + ChecksumAlgorithm types.ChecksumAlgorithm + + // The Content-MD5 header for the metadata table configuration. + ContentMD5 *string + + // The expected owner of the general purpose bucket that contains your metadata + // table configuration. + ExpectedBucketOwner *string + + noSmithyDocumentSerde +} + +func (in *CreateBucketMetadataTableConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + +type CreateBucketMetadataTableConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateBucketMetadataTableConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateBucketMetadataTableConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { + return err + } + if err = addOpCreateBucketMetadataTableConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBucketMetadataTableConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addCreateBucketMetadataTableConfigurationInputChecksumMiddlewares(stack, options); err != nil { + return err + } + if err = addCreateBucketMetadataTableConfigurationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = disableAcceptEncodingGzip(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { + return err + } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func (v *CreateBucketMetadataTableConfigurationInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +func newServiceMetadataMiddleware_opCreateBucketMetadataTableConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateBucketMetadataTableConfiguration", + } +} + +// getCreateBucketMetadataTableConfigurationRequestAlgorithmMember gets the +// request checksum algorithm value provided as input. +func getCreateBucketMetadataTableConfigurationRequestAlgorithmMember(input interface{}) (string, bool) { + in := input.(*CreateBucketMetadataTableConfigurationInput) + if len(in.ChecksumAlgorithm) == 0 { + return "", false + } + return string(in.ChecksumAlgorithm), true +} + +func addCreateBucketMetadataTableConfigurationInputChecksumMiddlewares(stack *middleware.Stack, options Options) error { + return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{ + GetAlgorithm: getCreateBucketMetadataTableConfigurationRequestAlgorithmMember, + RequireChecksum: true, + EnableTrailingChecksum: false, + EnableComputeSHA256PayloadHash: true, + EnableDecodedContentLengthHeader: true, + }) +} + +// getCreateBucketMetadataTableConfigurationBucketMember returns a pointer to +// string denoting a provided bucket member valueand a boolean indicating if the +// input has a modeled bucket name, +func getCreateBucketMetadataTableConfigurationBucketMember(input interface{}) (*string, bool) { + in := input.(*CreateBucketMetadataTableConfigurationInput) + if in.Bucket == nil { + return nil, false + } + return in.Bucket, true +} +func addCreateBucketMetadataTableConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: getCreateBucketMetadataTableConfigurationBucketMember, + }, + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: true, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go index 2831c54c..156aba56 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go @@ -4,16 +4,11 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -21,164 +16,213 @@ import ( // This action initiates a multipart upload and returns an upload ID. This upload // ID is used to associate all of the parts in the specific multipart upload. You -// specify this upload ID in each of your subsequent upload part requests (see -// UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// ). You also include this upload ID in the final request to either complete or -// abort the multipart upload request. For more information about multipart -// uploads, see Multipart Upload Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html) -// . If you have configured a lifecycle rule to abort incomplete multipart uploads, -// the upload must complete within the number of days specified in the bucket -// lifecycle configuration. Otherwise, the incomplete multipart upload becomes -// eligible for an abort action and Amazon S3 aborts the multipart upload. For more -// information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle -// Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) -// . For information about the permissions required to use the multipart upload -// API, see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// . For request signing, multipart upload is just a series of regular requests. -// You initiate a multipart upload, send one or more requests to upload parts, and -// then complete the multipart upload process. You sign each request individually. -// There is nothing special about signing multipart upload requests. For more -// information about signing, see Authenticating Requests (Amazon Web Services -// Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) -// . After you initiate a multipart upload and upload one or more parts, to stop +// specify this upload ID in each of your subsequent upload part requests (see [UploadPart]). +// You also include this upload ID in the final request to either complete or abort +// the multipart upload request. For more information about multipart uploads, see [Multipart Upload Overview] +// in the Amazon S3 User Guide. +// +// After you initiate a multipart upload and upload one or more parts, to stop // being charged for storing the uploaded parts, you must either complete or abort // the multipart upload. Amazon S3 frees up the space used to store the parts and -// stop charging you for storing them only after you either complete or abort a -// multipart upload. Server-side encryption is for data encryption at rest. Amazon -// S3 encrypts your data as it writes it to disks in its data centers and decrypts -// it when you access it. Amazon S3 automatically encrypts all new objects that are -// uploaded to an S3 bucket. When doing a multipart upload, if you don't specify -// encryption information in your request, the encryption setting of the uploaded -// parts is set to the default encryption configuration of the destination bucket. -// By default, all buckets have a base level of encryption configuration that uses -// server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination -// bucket has a default encryption configuration that uses server-side encryption -// with an Key Management Service (KMS) key (SSE-KMS), or a customer-provided -// encryption key (SSE-C), Amazon S3 uses the corresponding KMS key, or a -// customer-provided key to encrypt the uploaded parts. When you perform a -// CreateMultipartUpload operation, if you want to use a different type of -// encryption setting for the uploaded parts, you can request that Amazon S3 -// encrypts the object with a KMS key, an Amazon S3 managed key, or a -// customer-provided key. If the encryption setting in your request is different -// from the default encryption configuration of the destination bucket, the -// encryption setting in your request takes precedence. If you choose to provide -// your own encryption key, the request headers you provide in UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// and UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) -// requests must match the headers you used in the request to initiate the upload -// by using CreateMultipartUpload . You can request that Amazon S3 save the -// uploaded parts encrypted with server-side encryption with an Amazon S3 managed -// key (SSE-S3), an Key Management Service (KMS) key (SSE-KMS), or a -// customer-provided encryption key (SSE-C). To perform a multipart upload with -// encryption by using an Amazon Web Services KMS key, the requester must have -// permission to the kms:Decrypt and kms:GenerateDataKey* actions on the key. -// These permissions are required because Amazon S3 must decrypt and read data from -// the encrypted file parts before it completes the multipart upload. For more -// information, see Multipart upload API and permissions (https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions) -// and Protecting data using server-side encryption with Amazon Web Services KMS (https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html) -// in the Amazon S3 User Guide. If your Identity and Access Management (IAM) user -// or role is in the same Amazon Web Services account as the KMS key, then you must -// have these permissions on the key policy. If your IAM user or role belongs to a -// different account than the key, then you must have the permissions on both the -// key policy and your IAM user or role. For more information, see Protecting Data -// Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// . Access Permissions When copying an object, you can optionally specify the -// accounts or groups that should be granted specific permissions on the new -// object. There are two ways to grant the permissions using the request headers: -// - Specify a canned ACL with the x-amz-acl request header. For more -// information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) -// . -// - Specify access permissions explicitly with the x-amz-grant-read , -// x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control -// headers. These parameters map to the set of permissions that Amazon S3 supports -// in an ACL. For more information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// . -// -// You can use either a canned ACL or specify access permissions explicitly. You -// cannot do both. Server-Side- Encryption-Specific Request Headers Amazon S3 -// encrypts data by using server-side encryption with an Amazon S3 managed key -// (SSE-S3) by default. Server-side encryption is for data encryption at rest. -// Amazon S3 encrypts your data as it writes it to disks in its data centers and -// decrypts it when you access it. You can request that Amazon S3 encrypts data at -// rest by using server-side encryption with other key options. The option you use -// depends on whether you want to use KMS keys (SSE-KMS) or provide your own -// encryption keys (SSE-C). +// stops charging you for storing them only after you either complete or abort a +// multipart upload. +// +// If you have configured a lifecycle rule to abort incomplete multipart uploads, +// the created multipart upload must be completed within the number of days +// specified in the bucket lifecycle configuration. Otherwise, the incomplete +// multipart upload becomes eligible for an abort action and Amazon S3 aborts the +// multipart upload. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. +// +// - Directory buckets - S3 Lifecycle is not supported by directory buckets. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Request signing For request signing, multipart upload is just a series of +// regular requests. You initiate a multipart upload, send one or more requests to +// upload parts, and then complete the multipart upload process. You sign each +// request individually. There is nothing special about signing multipart upload +// requests. For more information about signing, see [Authenticating Requests (Amazon Web Services Signature Version 4)]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - To perform a multipart upload with +// encryption using an Key Management Service (KMS) KMS key, the requester must +// have permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. +// The requester must also have permissions for the kms:GenerateDataKey action +// for the CreateMultipartUpload API. Then, the requester needs permissions for +// the kms:Decrypt action on the UploadPart and UploadPartCopy APIs. These +// permissions are required because Amazon S3 must decrypt and read data from the +// encrypted file parts before it completes the multipart upload. For more +// information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// Encryption +// +// - General purpose buckets - Server-side encryption is for data encryption at +// rest. Amazon S3 encrypts your data as it writes it to disks in its data centers +// and decrypts it when you access it. Amazon S3 automatically encrypts all new +// objects that are uploaded to an S3 bucket. When doing a multipart upload, if you +// don't specify encryption information in your request, the encryption setting of +// the uploaded parts is set to the default encryption configuration of the +// destination bucket. By default, all buckets have a base level of encryption +// configuration that uses server-side encryption with Amazon S3 managed keys +// (SSE-S3). If the destination bucket has a default encryption configuration that +// uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), +// or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding +// KMS key, or a customer-provided key to encrypt the uploaded parts. When you +// perform a CreateMultipartUpload operation, if you want to use a different type +// of encryption setting for the uploaded parts, you can request that Amazon S3 +// encrypts the object with a different encryption key (such as an Amazon S3 +// managed key, a KMS key, or a customer-provided key). When the encryption setting +// in your request is different from the default encryption configuration of the +// destination bucket, the encryption setting in your request takes precedence. If +// you choose to provide your own encryption key, the request headers you provide +// in [UploadPart]and [UploadPartCopy]requests must match the headers you used in the CreateMultipartUpload +// request. +// // - Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( // aws/s3 ) and KMS customer managed keys stored in Key Management Service (KMS) // – If you want Amazon Web Services to manage the keys used to encrypt data, // specify the following headers in the request. +// // - x-amz-server-side-encryption +// // - x-amz-server-side-encryption-aws-kms-key-id -// - x-amz-server-side-encryption-context If you specify -// x-amz-server-side-encryption:aws:kms , but don't provide +// +// - x-amz-server-side-encryption-context +// +// - If you specify x-amz-server-side-encryption:aws:kms , but don't provide // x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web -// Services managed key ( aws/s3 key) in KMS to protect the data. All GET and PUT -// requests for an object protected by KMS fail if you don't make them by using -// Secure Sockets Layer (SSL), Transport Layer Security (TLS), or Signature Version -// 4. For more information about server-side encryption with KMS keys (SSE-KMS), -// see Protecting Data Using Server-Side Encryption with KMS keys (https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html) -// . -// - Use customer-provided encryption keys (SSE-C) – If you want to manage your -// own encryption keys, provide all the following headers in the request. -// - x-amz-server-side-encryption-customer-algorithm -// - x-amz-server-side-encryption-customer-key -// - x-amz-server-side-encryption-customer-key-MD5 For more information about -// server-side encryption with customer-provided encryption keys (SSE-C), see -// Protecting data using server-side encryption with customer-provided encryption -// keys (SSE-C) (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html) -// . -// -// Access-Control-List (ACL)-Specific Request Headers You also can use the -// following access control–related headers with this operation. By default, all -// objects are private. Only the owner has full access control. When adding a new -// object, you can grant permissions to individual Amazon Web Services accounts or -// to predefined groups defined by Amazon S3. These permissions are then added to -// the access control list (ACL) on the object. For more information, see Using -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) . -// With this operation, you can grant access permissions using one of the following -// two methods: -// - Specify a canned ACL ( x-amz-acl ) — Amazon S3 supports a set of predefined -// ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and -// permissions. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) -// . -// - Specify access permissions explicitly — To explicitly grant access -// permissions to specific Amazon Web Services accounts or groups, use the -// following headers. Each header maps to specific permissions that Amazon S3 -// supports in an ACL. For more information, see Access Control List (ACL) -// Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) . -// In the header, you specify a list of grantees who get the specific permission. -// To grant permissions explicitly, use: -// - x-amz-grant-read -// - x-amz-grant-write -// - x-amz-grant-read-acp -// - x-amz-grant-write-acp -// - x-amz-grant-full-control You specify each grantee as a type=value pair, -// where the type is one of the following: -// - id – if the value specified is the canonical user ID of an Amazon Web -// Services account -// - uri – if you are granting permissions to a predefined group -// - emailAddress – if the value specified is the email address of an Amazon Web -// Services account Using email addresses to specify a grantee is only supported in -// the following Amazon Web Services Regions: -// - US East (N. Virginia) -// - US West (N. California) -// - US West (Oregon) -// - Asia Pacific (Singapore) -// - Asia Pacific (Sydney) -// - Asia Pacific (Tokyo) -// - Europe (Ireland) -// - South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-read header grants the Amazon Web Services accounts identified by -// account IDs permissions to read object data and its metadata: -// x-amz-grant-read: id="11112222333", id="444455556666" +// Services managed key ( aws/s3 key) in KMS to protect the data. +// +// - To perform a multipart upload with encryption by using an Amazon Web +// Services KMS key, the requester must have permission to the kms:Decrypt and +// kms:GenerateDataKey* actions on the key. These permissions are required +// because Amazon S3 must decrypt and read data from the encrypted file parts +// before it completes the multipart upload. For more information, see [Multipart upload API and permissions]and [Protecting data using server-side encryption with Amazon Web Services KMS]in +// the Amazon S3 User Guide. +// +// - If your Identity and Access Management (IAM) user or role is in the same +// Amazon Web Services account as the KMS key, then you must have these permissions +// on the key policy. If your IAM user or role is in a different account from the +// key, then you must have the permissions on both the key policy and your IAM user +// or role. +// +// - All GET and PUT requests for an object protected by KMS fail if you don't +// make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), +// or Signature Version 4. For information about configuring any of the officially +// supported Amazon Web Services SDKs and Amazon Web Services CLI, see [Specifying the Signature Version in Request Authentication]in the +// Amazon S3 User Guide. +// +// For more information about server-side encryption with KMS keys (SSE-KMS), see [Protecting Data Using Server-Side Encryption with KMS keys] +// +// in the Amazon S3 User Guide. +// +// - Use customer-provided encryption keys (SSE-C) – If you want to manage your +// own encryption keys, provide all the following headers in the request. +// +// - x-amz-server-side-encryption-customer-algorithm +// +// - x-amz-server-side-encryption-customer-key +// +// - x-amz-server-side-encryption-customer-key-MD5 +// +// For more information about server-side encryption with customer-provided +// +// encryption keys (SSE-C), see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]in the Amazon S3 User Guide. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: server-side encryption with Amazon S3 +// managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys +// (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses +// the desired encryption configuration and you don't override the bucket default +// encryption in your CreateSession requests or PUT object requests. Then, new +// objects are automatically encrypted with the desired encryption settings. For +// more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about +// the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. +// +// In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the +// +// encryption request headers must match the encryption settings that are specified +// in the CreateSession request. You can't override the values of the encryption +// settings ( x-amz-server-side-encryption , +// x-amz-server-side-encryption-aws-kms-key-id , +// x-amz-server-side-encryption-context , and +// x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the +// CreateSession request. You don't need to explicitly specify these encryption +// settings values in Zonal endpoint API calls, and Amazon S3 will use the +// encryption settings values from the CreateSession request to protect new +// objects in the directory bucket. +// +// When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the +// +// session token refreshes automatically to avoid service interruptions when a +// session expires. The CLI or the Amazon Web Services SDKs use the bucket's +// default encryption configuration for the CreateSession request. It's not +// supported to override the encryption settings values in the CreateSession +// request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption +// request headers must match the default encryption configuration of the directory +// bucket. +// +// For directory buckets, when you perform a CreateMultipartUpload operation and an +// +// UploadPartCopy operation, the request headers you provide in the +// CreateMultipartUpload request must match the default encryption configuration +// of the destination bucket. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . // // The following operations are related to CreateMultipartUpload : -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [AbortMultipartUpload] +// +// [ListParts] +// +// [ListMultipartUploads] +// +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [Protecting Data Using Server-Side Encryption with KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html +// [Specifying the Signature Version in Request Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version +// [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html +// [Protecting data using server-side encryption with Amazon Web Services KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// +// [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html +// [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html func (c *Client) CreateMultipartUpload(ctx context.Context, params *CreateMultipartUploadInput, optFns ...func(*Options)) (*CreateMultipartUploadOutput, error) { if params == nil { params = &CreateMultipartUploadInput{} @@ -196,21 +240,41 @@ func (c *Client) CreateMultipartUpload(ctx context.Context, params *CreateMultip type CreateMultipartUploadInput struct { - // The name of the bucket to which to initiate the upload When using this action - // with an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The name of the bucket where the multipart upload is initiated and where the + // object is uploaded. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -220,23 +284,52 @@ type CreateMultipartUploadInput struct { // This member is required. Key *string - // The canned ACL to apply to the object. This action is not supported by Amazon - // S3 on Outposts. + // The canned ACL to apply to the object. Amazon S3 supports a set of predefined + // ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and + // permissions. For more information, see [Canned ACL]in the Amazon S3 User Guide. + // + // By default, all objects are private. Only the owner has full access control. + // When uploading an object, you can grant access permissions to individual Amazon + // Web Services accounts or to predefined groups defined by Amazon S3. These + // permissions are then added to the access control list (ACL) on the new object. + // For more information, see [Using ACLs]. One way to grant the permissions using the request + // headers is to specify a canned ACL with the x-amz-acl request header. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + // [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html ACL types.ObjectCannedACL // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption // with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). - // Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object - // encryption with SSE-KMS. Specifying this header with an object action doesn’t - // affect bucket-level settings for S3 Bucket Key. - BucketKeyEnabled bool + // + // General purpose buckets - Setting this header to true causes Amazon S3 to use + // an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this + // header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. + // + // Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + // operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + // supported, when you copy SSE-KMS encrypted objects from general purpose buckets + // to directory buckets, from directory buckets to general purpose buckets, or + // between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + // call to KMS every time a copy request is made for a KMS-encrypted object. + // + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + // [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + BucketKeyEnabled *bool // Specifies caching behavior along the request/reply chain. CacheControl *string - // Indicates the algorithm you want Amazon S3 to use to create the checksum for - // the object. For more information, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // Indicates the algorithm that you want Amazon S3 to use to create the checksum + // for the object. For more information, see [Checking object integrity]in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // Specifies presentational information for the object. @@ -245,61 +338,281 @@ type CreateMultipartUploadInput struct { // Specifies what content encodings have been applied to the object and thus what // decoding mechanisms must be applied to obtain the media-type referenced by the // Content-Type header field. + // + // For directory buckets, only the aws-chunked value is supported in this header + // field. ContentEncoding *string - // The language the content is in. + // The language that the content is in. ContentLanguage *string // A standard MIME type describing the format of the object data. ContentType *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The date and time at which the object is no longer cacheable. Expires *time.Time - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. This - // action is not supported by Amazon S3 on Outposts. + // Specify access permissions explicitly to give the grantee READ, READ_ACP, and + // WRITE_ACP permissions on the object. + // + // By default, all objects are private. Only the owner has full access control. + // When uploading an object, you can use this header to explicitly grant access + // permissions to specific Amazon Web Services accounts or groups. This header maps + // to specific permissions that Amazon S3 supports in an ACL. For more information, + // see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + // + // You specify each grantee as a type=value pair, where the type is one of the + // following: + // + // - id – if the value specified is the canonical user ID of an Amazon Web + // Services account + // + // - uri – if you are granting permissions to a predefined group + // + // - emailAddress – if the value specified is the email address of an Amazon Web + // Services account + // + // Using email addresses to specify a grantee is only supported in the following + // Amazon Web Services Regions: + // + // - US East (N. Virginia) + // + // - US West (N. California) + // + // - US West (Oregon) + // + // - Asia Pacific (Singapore) + // + // - Asia Pacific (Sydney) + // + // - Asia Pacific (Tokyo) + // + // - Europe (Ireland) + // + // - South America (São Paulo) + // + // For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + // Amazon Web Services General Reference. + // + // For example, the following x-amz-grant-read header grants the Amazon Web + // Services accounts identified by account IDs permissions to read object data and + // its metadata: + // + // x-amz-grant-read: id="11112222333", id="444455556666" + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + // [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html GrantFullControl *string - // Allows grantee to read the object data and its metadata. This action is not - // supported by Amazon S3 on Outposts. + // Specify access permissions explicitly to allow grantee to read the object data + // and its metadata. + // + // By default, all objects are private. Only the owner has full access control. + // When uploading an object, you can use this header to explicitly grant access + // permissions to specific Amazon Web Services accounts or groups. This header maps + // to specific permissions that Amazon S3 supports in an ACL. For more information, + // see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + // + // You specify each grantee as a type=value pair, where the type is one of the + // following: + // + // - id – if the value specified is the canonical user ID of an Amazon Web + // Services account + // + // - uri – if you are granting permissions to a predefined group + // + // - emailAddress – if the value specified is the email address of an Amazon Web + // Services account + // + // Using email addresses to specify a grantee is only supported in the following + // Amazon Web Services Regions: + // + // - US East (N. Virginia) + // + // - US West (N. California) + // + // - US West (Oregon) + // + // - Asia Pacific (Singapore) + // + // - Asia Pacific (Sydney) + // + // - Asia Pacific (Tokyo) + // + // - Europe (Ireland) + // + // - South America (São Paulo) + // + // For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + // Amazon Web Services General Reference. + // + // For example, the following x-amz-grant-read header grants the Amazon Web + // Services accounts identified by account IDs permissions to read object data and + // its metadata: + // + // x-amz-grant-read: id="11112222333", id="444455556666" + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + // [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html GrantRead *string - // Allows grantee to read the object ACL. This action is not supported by Amazon - // S3 on Outposts. + // Specify access permissions explicitly to allows grantee to read the object ACL. + // + // By default, all objects are private. Only the owner has full access control. + // When uploading an object, you can use this header to explicitly grant access + // permissions to specific Amazon Web Services accounts or groups. This header maps + // to specific permissions that Amazon S3 supports in an ACL. For more information, + // see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + // + // You specify each grantee as a type=value pair, where the type is one of the + // following: + // + // - id – if the value specified is the canonical user ID of an Amazon Web + // Services account + // + // - uri – if you are granting permissions to a predefined group + // + // - emailAddress – if the value specified is the email address of an Amazon Web + // Services account + // + // Using email addresses to specify a grantee is only supported in the following + // Amazon Web Services Regions: + // + // - US East (N. Virginia) + // + // - US West (N. California) + // + // - US West (Oregon) + // + // - Asia Pacific (Singapore) + // + // - Asia Pacific (Sydney) + // + // - Asia Pacific (Tokyo) + // + // - Europe (Ireland) + // + // - South America (São Paulo) + // + // For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + // Amazon Web Services General Reference. + // + // For example, the following x-amz-grant-read header grants the Amazon Web + // Services accounts identified by account IDs permissions to read object data and + // its metadata: + // + // x-amz-grant-read: id="11112222333", id="444455556666" + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + // [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html GrantReadACP *string - // Allows grantee to write the ACL for the applicable object. This action is not - // supported by Amazon S3 on Outposts. + // Specify access permissions explicitly to allows grantee to allow grantee to + // write the ACL for the applicable object. + // + // By default, all objects are private. Only the owner has full access control. + // When uploading an object, you can use this header to explicitly grant access + // permissions to specific Amazon Web Services accounts or groups. This header maps + // to specific permissions that Amazon S3 supports in an ACL. For more information, + // see [Access Control List (ACL) Overview]in the Amazon S3 User Guide. + // + // You specify each grantee as a type=value pair, where the type is one of the + // following: + // + // - id – if the value specified is the canonical user ID of an Amazon Web + // Services account + // + // - uri – if you are granting permissions to a predefined group + // + // - emailAddress – if the value specified is the email address of an Amazon Web + // Services account + // + // Using email addresses to specify a grantee is only supported in the following + // Amazon Web Services Regions: + // + // - US East (N. Virginia) + // + // - US West (N. California) + // + // - US West (Oregon) + // + // - Asia Pacific (Singapore) + // + // - Asia Pacific (Sydney) + // + // - Asia Pacific (Tokyo) + // + // - Europe (Ireland) + // + // - South America (São Paulo) + // + // For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the + // Amazon Web Services General Reference. + // + // For example, the following x-amz-grant-read header grants the Amazon Web + // Services accounts identified by account IDs permissions to read object data and + // its metadata: + // + // x-amz-grant-read: id="11112222333", id="444455556666" + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + // [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html GrantWriteACP *string // A map of metadata to store with the object in S3. Metadata map[string]string // Specifies whether you want to apply a legal hold to the uploaded object. + // + // This functionality is not supported for directory buckets. ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus // Specifies the Object Lock mode that you want to apply to the uploaded object. + // + // This functionality is not supported for directory buckets. ObjectLockMode types.ObjectLockMode // Specifies the date and time when you want the Object Lock to expire. + // + // This functionality is not supported for directory buckets. ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Specifies the algorithm to use when encrypting the object (for example, AES256). + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -307,88 +620,161 @@ type CreateMultipartUploadInput struct { // discarded; Amazon S3 does not store the encryption key. The key must be // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // This functionality is not supported for directory buckets. SSECustomerKey *string - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. + // Specifies the 128-bit MD5 digest of the customer-provided encryption key + // according to RFC 1321. Amazon S3 uses this header for a message integrity check + // to ensure that the encryption key was transmitted without error. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. + // encryption. The value of this header is a Base64-encoded string of a UTF-8 + // encoded JSON, which contains the encryption context as key-value pairs. + // + // Directory buckets - You can optionally provide an explicit encryption context + // value. The value must match the default encryption context - the bucket Amazon + // Resource Name (ARN). An additional encryption context value is not supported. SSEKMSEncryptionContext *string - // Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption - // customer managed key to use for object encryption. All GET and PUT requests for - // an object protected by KMS will fail if they're not made via SSL or using SigV4. - // For information about configuring any of the officially supported Amazon Web - // Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version - // in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) - // in the Amazon S3 User Guide. + // Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object + // encryption. If the KMS key doesn't exist in the same account that's issuing the + // command, you must use the full Key ARN not the Key ID. + // + // General purpose buckets - If you specify x-amz-server-side-encryption with + // aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key + // Alias) of the KMS key to use. If you specify + // x-amz-server-side-encryption:aws:kms or + // x-amz-server-side-encryption:aws:kms:dsse , but do not provide + // x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web + // Services managed key ( aws/s3 ) to protect the data. + // + // Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + // the x-amz-server-side-encryption-aws-kms-key-id header is implicitly assigned + // the ID of the KMS symmetric encryption customer managed key that's configured + // for your directory bucket's default encryption setting. If you want to specify + // the x-amz-server-side-encryption-aws-kms-key-id header explicitly, you can only + // specify it with the ID (Key ID or Key ARN) of the KMS customer managed key + // that's configured for your directory bucket's default encryption setting. + // Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key + // ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + // configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + // bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't supported. + // + // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms ). + // + // - Directory buckets - For directory buckets, there are only two supported + // options for server-side encryption: server-side encryption with Amazon S3 + // managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + // (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + // the desired encryption configuration and you don't override the bucket default + // encryption in your CreateSession requests or PUT object requests. Then, new + // objects are automatically encrypted with the desired encryption settings. For + // more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + // the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + // + // In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the + // encryption request headers must match the encryption settings that are specified + // in the CreateSession request. You can't override the values of the encryption + // settings ( x-amz-server-side-encryption , + // x-amz-server-side-encryption-aws-kms-key-id , + // x-amz-server-side-encryption-context , and + // x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the + // CreateSession request. You don't need to explicitly specify these encryption + // settings values in Zonal endpoint API calls, and Amazon S3 will use the + // encryption settings values from the CreateSession request to protect new + // objects in the directory bucket. + // + // When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + // session token refreshes automatically to avoid service interruptions when a + // session expires. The CLI or the Amazon Web Services SDKs use the bucket's + // default encryption configuration for the CreateSession request. It's not + // supported to override the encryption settings values in the CreateSession + // request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption + // request headers must match the default encryption configuration of the directory + // bucket. + // + // [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + // [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html ServerSideEncryption types.ServerSideEncryption // By default, Amazon S3 uses the STANDARD Storage Class to store newly created // objects. The STANDARD storage class provides high durability and high // availability. Depending on performance needs, you can specify a different - // Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For - // more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. + // Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. + // + // - For directory buckets, only the S3 Express One Zone storage class is + // supported to store newly created objects. + // + // - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html StorageClass types.StorageClass // The tag-set for the object. The tag-set must be encoded as URL Query parameters. + // + // This functionality is not supported for directory buckets. Tagging *string // If the bucket is configured as a website, redirects requests for this object to // another object in the same bucket or to an external URL. Amazon S3 stores the // value of this header in the object metadata. + // + // This functionality is not supported for directory buckets. WebsiteRedirectLocation *string noSmithyDocumentSerde } +func (in *CreateMultipartUploadInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type CreateMultipartUploadOutput struct { // If the bucket has a lifecycle rule configured with an action to abort // incomplete multipart uploads and the prefix in the lifecycle rule matches the // object name in the request, the response includes this header. The header // indicates when the initiated multipart upload becomes eligible for an abort - // operation. For more information, see Aborting Incomplete Multipart Uploads - // Using a Bucket Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // . The response also includes the x-amz-abort-rule-id header that provides the - // ID of the lifecycle configuration rule that defines this action. + // operation. For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. + // + // The response also includes the x-amz-abort-rule-id header that provides the ID + // of the lifecycle configuration rule that defines the abort action. + // + // This functionality is not supported for directory buckets. + // + // [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config AbortDate *time.Time // This header is returned along with the x-amz-abort-date header. It identifies // the applicable lifecycle configuration rule that defines the action to abort // incomplete multipart uploads. + // + // This functionality is not supported for directory buckets. AbortRuleId *string // The name of the bucket to which the multipart upload was initiated. Does not - // return the access point ARN or access point alias if used. When using this - // action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form - // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - // action with an access point through the Amazon Web Services SDKs, you provide - // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - // use this action with S3 on Outposts through the Amazon Web Services SDKs, you - // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // return the access point ARN or access point alias if used. + // + // Access points are not supported by directory buckets. Bucket *string // Indicates whether the multipart upload uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // The algorithm that was used to create a checksum of the object. ChecksumAlgorithm types.ChecksumAlgorithm @@ -398,29 +784,34 @@ type CreateMultipartUploadOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the Amazon Web Services KMS Encryption Context to use for - // object encryption. The value of this header is a base64-encoded UTF-8 string - // holding JSON with the encryption context key-value pairs. + // If present, indicates the Amazon Web Services KMS Encryption Context to use for + // object encryption. The value of this header is a Base64-encoded string of a + // UTF-8 encoded JSON, which contains the encryption context as key-value pairs. SSEKMSEncryptionContext *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms ). ServerSideEncryption types.ServerSideEncryption // ID for the initiated multipart upload. @@ -433,6 +824,9 @@ type CreateMultipartUploadOutput struct { } func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpCreateMultipartUpload{}, middleware.After) if err != nil { return err @@ -441,34 +835,38 @@ func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateMultipartUpload"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -480,10 +878,19 @@ func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addCreateMultipartUploadResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpCreateMultipartUploadValidationMiddleware(stack); err != nil { @@ -495,7 +902,7 @@ func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware. if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addCreateMultipartUploadUpdateEndpoint(stack, options); err != nil { @@ -513,12 +920,27 @@ func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSetCreateMPUChecksumAlgorithm(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -533,7 +955,6 @@ func newServiceMetadataMiddleware_opCreateMultipartUpload(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "CreateMultipartUpload", } } @@ -563,139 +984,3 @@ func addCreateMultipartUploadUpdateEndpoint(stack *middleware.Stack, options Opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opCreateMultipartUploadResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opCreateMultipartUploadResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opCreateMultipartUploadResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*CreateMultipartUploadInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addCreateMultipartUploadResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opCreateMultipartUploadResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateSession.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateSession.go new file mode 100644 index 00000000..f933f783 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateSession.go @@ -0,0 +1,432 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a session that establishes temporary security credentials to support +// fast authentication and authorization for the Zonal endpoint API operations on +// directory buckets. For more information about Zonal endpoint API operations that +// include the Availability Zone in the request endpoint, see [S3 Express One Zone APIs]in the Amazon S3 +// User Guide. +// +// To make Zonal endpoint API requests on a directory bucket, use the CreateSession +// API operation. Specifically, you grant s3express:CreateSession permission to a +// bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM +// credentials to make the CreateSession API request on the bucket, which returns +// temporary security credentials that include the access key ID, secret access +// key, session token, and expiration. These credentials have associated +// permissions to access the Zonal endpoint API operations. After the session is +// created, you don’t need to use other policies to grant permissions to each Zonal +// endpoint API individually. Instead, in your Zonal endpoint API requests, you +// sign your requests by applying the temporary security credentials of the session +// to the request headers and following the SigV4 protocol for authentication. You +// also apply the session token to the x-amz-s3session-token request header for +// authorization. Temporary security credentials are scoped to the bucket and +// expire after 5 minutes. After the expiration time, any calls that you make with +// those credentials will fail. You must use IAM credentials again to make a +// CreateSession API request that generates a new set of temporary credentials for +// use. Temporary credentials cannot be extended or refreshed beyond the original +// specified interval. +// +// If you use Amazon Web Services SDKs, SDKs handle the session token refreshes +// automatically to avoid service interruptions when a session expires. We +// recommend that you use the Amazon Web Services SDKs to initiate and manage +// requests to the CreateSession API. For more information, see [Performance guidelines and design patterns]in the Amazon S3 +// User Guide. +// +// - You must make requests for this API operation to the Zonal endpoint. These +// endpoints support virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style +// requests are not supported. For more information about endpoints in Availability +// Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about endpoints +// in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// - CopyObject API operation - Unlike other Zonal endpoint API operations, the +// CopyObject API operation doesn't use the temporary security credentials +// returned from the CreateSession API operation for authentication and +// authorization. For information about authentication and authorization of the +// CopyObject API operation on directory buckets, see [CopyObject]. +// +// - HeadBucket API operation - Unlike other Zonal endpoint API operations, the +// HeadBucket API operation doesn't use the temporary security credentials +// returned from the CreateSession API operation for authentication and +// authorization. For information about authentication and authorization of the +// HeadBucket API operation on directory buckets, see [HeadBucket]. +// +// Permissions To obtain temporary security credentials, you must create a bucket +// policy or an IAM identity-based policy that grants s3express:CreateSession +// permission to the bucket. In a policy, you can have the s3express:SessionMode +// condition key to control who can create a ReadWrite or ReadOnly session. For +// more information about ReadWrite or ReadOnly sessions, see [x-amz-create-session-mode] +// x-amz-create-session-mode . For example policies, see [Example bucket policies for S3 Express One Zone] and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone] in the Amazon S3 +// User Guide. +// +// To grant cross-account access to Zonal endpoint API operations, the bucket +// policy should also grant both accounts the s3express:CreateSession permission. +// +// If you want to encrypt objects with SSE-KMS, you must also have the +// kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based +// policies and KMS key policies for the target KMS key. +// +// Encryption For directory buckets, there are only two supported options for +// server-side encryption: server-side encryption with Amazon S3 managed keys +// (SSE-S3) ( AES256 ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms +// ). We recommend that the bucket's default encryption uses the desired encryption +// configuration and you don't override the bucket default encryption in your +// CreateSession requests or PUT object requests. Then, new objects are +// automatically encrypted with the desired encryption settings. For more +// information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about the +// encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. +// +// For [Zonal endpoint (object-level) API operations] except [CopyObject] and [UploadPartCopy], you authenticate and authorize requests through [CreateSession] for low +// latency. To encrypt new objects in a directory bucket with SSE-KMS, you must +// specify SSE-KMS as the directory bucket's default encryption configuration with +// a KMS key (specifically, a [customer managed key]). Then, when a session is created for Zonal +// endpoint API operations, new objects are automatically encrypted and decrypted +// with SSE-KMS and S3 Bucket Keys during the session. +// +// Only 1 [customer managed key] is supported per directory bucket for the lifetime of the bucket. The [Amazon Web Services managed key] ( +// aws/s3 ) isn't supported. After you specify SSE-KMS as your bucket's default +// encryption configuration with a customer managed key, you can't change the +// customer managed key for the bucket's SSE-KMS configuration. +// +// In the Zonal endpoint API calls (except [CopyObject] and [UploadPartCopy]) using the REST API, you can't +// override the values of the encryption settings ( x-amz-server-side-encryption , +// x-amz-server-side-encryption-aws-kms-key-id , +// x-amz-server-side-encryption-context , and +// x-amz-server-side-encryption-bucket-key-enabled ) from the CreateSession +// request. You don't need to explicitly specify these encryption settings values +// in Zonal endpoint API calls, and Amazon S3 will use the encryption settings +// values from the CreateSession request to protect new objects in the directory +// bucket. +// +// When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the +// session token refreshes automatically to avoid service interruptions when a +// session expires. The CLI or the Amazon Web Services SDKs use the bucket's +// default encryption configuration for the CreateSession request. It's not +// supported to override the encryption settings values in the CreateSession +// request. Also, in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), it's not +// supported to override the values of the encryption settings from the +// CreateSession request. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html +// [Performance guidelines and design patterns]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-optimizing-performance-guidelines-design-patterns.html#s3-express-optimizing-performance-session-authentication +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [S3 Express One Zone APIs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-APIs.html +// [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk +// [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html +// [x-amz-create-session-mode]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html#API_CreateSession_RequestParameters +// [Zonal endpoint (object-level) API operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-differences.html#s3-express-differences-api-operations +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +func (c *Client) CreateSession(ctx context.Context, params *CreateSessionInput, optFns ...func(*Options)) (*CreateSessionOutput, error) { + if params == nil { + params = &CreateSessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSession", params, optFns, c.addOperationCreateSessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSessionInput struct { + + // The name of the bucket that you create a session for. + // + // This member is required. + Bucket *string + + // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption + // with server-side encryption using KMS keys (SSE-KMS). + // + // S3 Bucket Keys are always enabled for GET and PUT operations in a directory + // bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy + // SSE-KMS encrypted objects from general purpose buckets to directory buckets, + // from directory buckets to general purpose buckets, or between directory buckets, + // through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a + // copy request is made for a KMS-encrypted object. + // + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + // [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + BucketKeyEnabled *bool + + // Specifies the Amazon Web Services KMS Encryption Context as an additional + // encryption context to use for object encryption. The value of this header is a + // Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption + // context as key-value pairs. This value is stored as object metadata and + // automatically gets passed on to Amazon Web Services KMS for future GetObject + // operations on this object. + // + // General purpose buckets - This value must be explicitly added during CopyObject + // operations if you want an additional encryption context for your object. For + // more information, see [Encryption context]in the Amazon S3 User Guide. + // + // Directory buckets - You can optionally provide an explicit encryption context + // value. The value must match the default encryption context - the bucket Amazon + // Resource Name (ARN). An additional encryption context value is not supported. + // + // [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context + SSEKMSEncryptionContext *string + + // If you specify x-amz-server-side-encryption with aws:kms , you must specify the + // x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key + // ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you + // get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key + // alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist + // in the same account that't issuing the command, you must use the full Key ARN + // not the Key ID. + // + // Your SSE-KMS configuration can only support 1 [customer managed key] per directory bucket for the + // lifetime of the bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't supported. + // + // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk + SSEKMSKeyId *string + + // The server-side encryption algorithm to use when you store objects in the + // directory bucket. + // + // For directory buckets, there are only two supported options for server-side + // encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( AES256 + // ) and server-side encryption with KMS keys (SSE-KMS) ( aws:kms ). By default, + // Amazon S3 encrypts data with SSE-S3. For more information, see [Protecting data with server-side encryption]in the Amazon S3 + // User Guide. + // + // [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + ServerSideEncryption types.ServerSideEncryption + + // Specifies the mode of the session that will be created, either ReadWrite or + // ReadOnly . By default, a ReadWrite session is created. A ReadWrite session is + // capable of executing all the Zonal endpoint API operations on a directory + // bucket. A ReadOnly session is constrained to execute the following Zonal + // endpoint API operations: GetObject , HeadObject , ListObjectsV2 , + // GetObjectAttributes , ListParts , and ListMultipartUploads . + SessionMode types.SessionMode + + noSmithyDocumentSerde +} + +func (in *CreateSessionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.DisableS3ExpressSessionAuth = ptr.Bool(true) +} + +type CreateSessionOutput struct { + + // The established temporary security credentials for the created session. + // + // This member is required. + Credentials *types.SessionCredentials + + // Indicates whether to use an S3 Bucket Key for server-side encryption with KMS + // keys (SSE-KMS). + BucketKeyEnabled *bool + + // If present, indicates the Amazon Web Services KMS Encryption Context to use for + // object encryption. The value of this header is a Base64-encoded string of a + // UTF-8 encoded JSON, which contains the encryption context as key-value pairs. + // This value is stored as object metadata and automatically gets passed on to + // Amazon Web Services KMS for future GetObject operations on this object. + SSEKMSEncryptionContext *string + + // If you specify x-amz-server-side-encryption with aws:kms , this header indicates + // the ID of the KMS symmetric encryption customer managed key that was used for + // object encryption. + SSEKMSKeyId *string + + // The server-side encryption algorithm used when you store objects in the + // directory bucket. + ServerSideEncryption types.ServerSideEncryption + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateSession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateSession{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSession"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { + return err + } + if err = addOpCreateSessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSession(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addCreateSessionUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = disableAcceptEncodingGzip(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func (v *CreateSessionInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +func newServiceMetadataMiddleware_opCreateSession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateSession", + } +} + +// getCreateSessionBucketMember returns a pointer to string denoting a provided +// bucket member valueand a boolean indicating if the input has a modeled bucket +// name, +func getCreateSessionBucketMember(input interface{}) (*string, bool) { + in := input.(*CreateSessionInput) + if in.Bucket == nil { + return nil, false + } + return in.Bucket, true +} +func addCreateSessionUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: getCreateSessionBucketMember, + }, + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: true, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucket.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucket.go index ba163363..8e34c67c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucket.go @@ -4,24 +4,56 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the S3 bucket. All objects (including all object versions and delete // markers) in the bucket must be deleted before the bucket itself can be deleted. +// +// - Directory buckets - If multipart uploads in a directory bucket are in +// progress, you can't delete the bucket until all the in-progress multipart +// uploads are aborted or completed. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Regional endpoint. These endpoints support path-style +// requests in the format +// https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - You must have the s3:DeleteBucket +// permission on the specified bucket in a policy. +// +// - Directory bucket permissions - You must have the s3express:DeleteBucket +// permission in an IAM identity-based policy instead of a bucket policy. +// Cross-account access to this API operation isn't supported. This operation can +// only be performed by the Amazon Web Services account that owns the resource. For +// more information about directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the +// Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// // The following operations are related to DeleteBucket : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) +// +// [CreateBucket] +// +// [DeleteObject] +// +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) DeleteBucket(ctx context.Context, params *DeleteBucketInput, optFns ...func(*Options)) (*DeleteBucketOutput, error) { if params == nil { params = &DeleteBucketInput{} @@ -41,17 +73,38 @@ type DeleteBucketInput struct { // Specifies the bucket being deleted. // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -60,6 +113,9 @@ type DeleteBucketOutput struct { } func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucket{}, middleware.After) if err != nil { return err @@ -68,34 +124,38 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucket"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -107,10 +167,19 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addDeleteBucketResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketValidationMiddleware(stack); err != nil { @@ -122,7 +191,7 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketUpdateEndpoint(stack, options); err != nil { @@ -140,12 +209,24 @@ func (c *Client) addOperationDeleteBucketMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -160,7 +241,6 @@ func newServiceMetadataMiddleware_opDeleteBucket(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucket", } } @@ -221,139 +301,3 @@ func addDeleteBucketPayloadAsUnsigned(stack *middleware.Stack, options Options) v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opDeleteBucketResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go index 12d12e6c..ebeba229 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go @@ -4,32 +4,41 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Deletes an analytics configuration for the bucket (specified by the analytics -// configuration ID). To use this operation, you must have permissions to perform -// the s3:PutAnalyticsConfiguration action. The bucket owner has this permission -// by default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about the Amazon S3 analytics feature, see Amazon S3 -// Analytics – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// . The following operations are related to DeleteBucketAnalyticsConfiguration : -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) +// configuration ID). +// +// To use this operation, you must have permissions to perform the +// s3:PutAnalyticsConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about the Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. +// +// The following operations are related to DeleteBucketAnalyticsConfiguration : +// +// [GetBucketAnalyticsConfiguration] +// +// [ListBucketAnalyticsConfigurations] +// +// [PutBucketAnalyticsConfiguration] +// +// [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html +// [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html +// [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) DeleteBucketAnalyticsConfiguration(ctx context.Context, params *DeleteBucketAnalyticsConfigurationInput, optFns ...func(*Options)) (*DeleteBucketAnalyticsConfigurationOutput, error) { if params == nil { params = &DeleteBucketAnalyticsConfigurationInput{} @@ -57,14 +66,20 @@ type DeleteBucketAnalyticsConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketAnalyticsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketAnalyticsConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -73,6 +88,9 @@ type DeleteBucketAnalyticsConfigurationOutput struct { } func (c *Client) addOperationDeleteBucketAnalyticsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration{}, middleware.After) if err != nil { return err @@ -81,34 +99,38 @@ func (c *Client) addOperationDeleteBucketAnalyticsConfigurationMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketAnalyticsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -120,10 +142,19 @@ func (c *Client) addOperationDeleteBucketAnalyticsConfigurationMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketAnalyticsConfigurationValidationMiddleware(stack); err != nil { @@ -135,7 +166,7 @@ func (c *Client) addOperationDeleteBucketAnalyticsConfigurationMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketAnalyticsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -153,12 +184,24 @@ func (c *Client) addOperationDeleteBucketAnalyticsConfigurationMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -173,7 +216,6 @@ func newServiceMetadataMiddleware_opDeleteBucketAnalyticsConfiguration(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketAnalyticsConfiguration", } } @@ -203,139 +245,3 @@ func addDeleteBucketAnalyticsConfigurationUpdateEndpoint(stack *middleware.Stack DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketAnalyticsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketAnalyticsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketCors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketCors.go index ae90a906..e1014475 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketCors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketCors.go @@ -4,26 +4,34 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the cors configuration information set for the bucket. To use this -// operation, you must have permission to perform the s3:PutBucketCORS action. The -// bucket owner has this permission by default and can grant this permission to -// others. For information about cors , see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// in the Amazon S3 User Guide. Related Resources -// - PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) -// - RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) +// This operation is not supported for directory buckets. +// +// Deletes the cors configuration information set for the bucket. +// +// To use this operation, you must have permission to perform the s3:PutBucketCORS +// action. The bucket owner has this permission by default and can grant this +// permission to others. +// +// For information about cors , see [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. +// +// # Related Resources +// +// [PutBucketCors] +// +// [RESTOPTIONSobject] +// +// [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html +// [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html +// [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html func (c *Client) DeleteBucketCors(ctx context.Context, params *DeleteBucketCorsInput, optFns ...func(*Options)) (*DeleteBucketCorsOutput, error) { if params == nil { params = &DeleteBucketCorsInput{} @@ -46,14 +54,20 @@ type DeleteBucketCorsInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketCorsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketCorsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -62,6 +76,9 @@ type DeleteBucketCorsOutput struct { } func (c *Client) addOperationDeleteBucketCorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketCors{}, middleware.After) if err != nil { return err @@ -70,34 +87,38 @@ func (c *Client) addOperationDeleteBucketCorsMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketCors"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -109,10 +130,19 @@ func (c *Client) addOperationDeleteBucketCorsMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketCorsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketCorsValidationMiddleware(stack); err != nil { @@ -124,7 +154,7 @@ func (c *Client) addOperationDeleteBucketCorsMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketCorsUpdateEndpoint(stack, options); err != nil { @@ -142,12 +172,24 @@ func (c *Client) addOperationDeleteBucketCorsMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -162,7 +204,6 @@ func newServiceMetadataMiddleware_opDeleteBucketCors(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketCors", } } @@ -192,139 +233,3 @@ func addDeleteBucketCorsUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketCorsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketCorsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketCorsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketCorsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketCorsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketEncryption.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketEncryption.go index 754ae6a5..c1a1b810 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketEncryption.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketEncryption.go @@ -4,33 +4,55 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) // This implementation of the DELETE action resets the default encryption for the -// bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). For -// information about the bucket default encryption feature, see Amazon S3 Bucket -// Default Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon S3 User Guide. To use this operation, you must have permissions to -// perform the s3:PutEncryptionConfiguration action. The bucket owner has this -// permission by default. The bucket owner can grant this permission to others. For -// more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. The following operations are related to -// DeleteBucketEncryption : -// - PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) -// - GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) +// bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). +// +// - General purpose buckets - For information about the bucket default +// encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: SSE-S3 and SSE-KMS. For information about +// the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. +// +// Permissions +// +// - General purpose bucket permissions - The s3:PutEncryptionConfiguration +// permission is required in a policy. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:PutEncryptionConfiguration permission in an IAM +// identity-based policy instead of a bucket policy. Cross-account access to this +// API operation isn't supported. This operation can only be performed by the +// Amazon Web Services account that owns the resource. For more information about +// directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following operations are related to DeleteBucketEncryption : +// +// [PutBucketEncryption] +// +// [GetBucketEncryption] +// +// [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html +// [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html +// [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html +// [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) DeleteBucketEncryption(ctx context.Context, params *DeleteBucketEncryptionInput, optFns ...func(*Options)) (*DeleteBucketEncryptionOutput, error) { if params == nil { params = &DeleteBucketEncryptionInput{} @@ -51,17 +73,38 @@ type DeleteBucketEncryptionInput struct { // The name of the bucket containing the server-side encryption configuration to // delete. // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketEncryptionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketEncryptionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -70,6 +113,9 @@ type DeleteBucketEncryptionOutput struct { } func (c *Client) addOperationDeleteBucketEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketEncryption{}, middleware.After) if err != nil { return err @@ -78,34 +124,38 @@ func (c *Client) addOperationDeleteBucketEncryptionMiddlewares(stack *middleware if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketEncryption"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -117,10 +167,19 @@ func (c *Client) addOperationDeleteBucketEncryptionMiddlewares(stack *middleware if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addDeleteBucketEncryptionResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketEncryptionValidationMiddleware(stack); err != nil { @@ -132,7 +191,7 @@ func (c *Client) addOperationDeleteBucketEncryptionMiddlewares(stack *middleware if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketEncryptionUpdateEndpoint(stack, options); err != nil { @@ -150,12 +209,24 @@ func (c *Client) addOperationDeleteBucketEncryptionMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -170,7 +241,6 @@ func newServiceMetadataMiddleware_opDeleteBucketEncryption(region string) *awsmi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketEncryption", } } @@ -200,139 +270,3 @@ func addDeleteBucketEncryptionUpdateEndpoint(stack *middleware.Stack, options Op DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketEncryptionResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketEncryptionResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketEncryptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketEncryptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketEncryptionResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go index e71e5fb8..3fd1f17c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go @@ -4,37 +4,47 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the S3 Intelligent-Tiering configuration from the specified bucket. The -// S3 Intelligent-Tiering storage class is designed to optimize storage costs by -// automatically moving data to the most cost-effective storage access tier, +// This operation is not supported for directory buckets. +// +// Deletes the S3 Intelligent-Tiering configuration from the specified bucket. +// +// The S3 Intelligent-Tiering storage class is designed to optimize storage costs +// by automatically moving data to the most cost-effective storage access tier, // without performance impact or operational overhead. S3 Intelligent-Tiering // delivers automatic cost savings in three low latency and high throughput access // tiers. To get the lowest storage cost on data that can be accessed in minutes to -// hours, you can choose to activate additional archiving capabilities. The S3 -// Intelligent-Tiering storage class is the ideal storage class for data with -// unknown, changing, or unpredictable access patterns, independent of object size -// or retention period. If the size of an object is less than 128 KB, it is not -// monitored and not eligible for auto-tiering. Smaller objects can be stored, but -// they are always charged at the Frequent Access tier rates in the S3 -// Intelligent-Tiering storage class. For more information, see Storage class for -// automatically optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) -// . Operations related to DeleteBucketIntelligentTieringConfiguration include: -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) +// hours, you can choose to activate additional archiving capabilities. +// +// The S3 Intelligent-Tiering storage class is the ideal storage class for data +// with unknown, changing, or unpredictable access patterns, independent of object +// size or retention period. If the size of an object is less than 128 KB, it is +// not monitored and not eligible for auto-tiering. Smaller objects can be stored, +// but they are always charged at the Frequent Access tier rates in the S3 +// Intelligent-Tiering storage class. +// +// For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. +// +// Operations related to DeleteBucketIntelligentTieringConfiguration include: +// +// [GetBucketIntelligentTieringConfiguration] +// +// [PutBucketIntelligentTieringConfiguration] +// +// [ListBucketIntelligentTieringConfigurations] +// +// [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html +// [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html +// [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html +// [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access func (c *Client) DeleteBucketIntelligentTieringConfiguration(ctx context.Context, params *DeleteBucketIntelligentTieringConfigurationInput, optFns ...func(*Options)) (*DeleteBucketIntelligentTieringConfigurationOutput, error) { if params == nil { params = &DeleteBucketIntelligentTieringConfigurationInput{} @@ -66,6 +76,12 @@ type DeleteBucketIntelligentTieringConfigurationInput struct { noSmithyDocumentSerde } +func (in *DeleteBucketIntelligentTieringConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketIntelligentTieringConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -74,6 +90,9 @@ type DeleteBucketIntelligentTieringConfigurationOutput struct { } func (c *Client) addOperationDeleteBucketIntelligentTieringConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration{}, middleware.After) if err != nil { return err @@ -82,34 +101,38 @@ func (c *Client) addOperationDeleteBucketIntelligentTieringConfigurationMiddlewa if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketIntelligentTieringConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -121,10 +144,19 @@ func (c *Client) addOperationDeleteBucketIntelligentTieringConfigurationMiddlewa if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketIntelligentTieringConfigurationValidationMiddleware(stack); err != nil { @@ -136,7 +168,7 @@ func (c *Client) addOperationDeleteBucketIntelligentTieringConfigurationMiddlewa if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketIntelligentTieringConfigurationUpdateEndpoint(stack, options); err != nil { @@ -154,12 +186,24 @@ func (c *Client) addOperationDeleteBucketIntelligentTieringConfigurationMiddlewa if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -174,7 +218,6 @@ func newServiceMetadataMiddleware_opDeleteBucketIntelligentTieringConfiguration( return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketIntelligentTieringConfiguration", } } @@ -204,139 +247,3 @@ func addDeleteBucketIntelligentTieringConfigurationUpdateEndpoint(stack *middlew DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketIntelligentTieringConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketIntelligentTieringConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketInventoryConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketInventoryConfiguration.go index 4788ce85..68fbe69d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketInventoryConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketInventoryConfiguration.go @@ -4,31 +4,41 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Deletes an inventory configuration (identified by the inventory ID) from the -// bucket. To use this operation, you must have permissions to perform the +// bucket. +// +// To use this operation, you must have permissions to perform the // s3:PutInventoryConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about the Amazon S3 inventory feature, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// . Operations related to DeleteBucketInventoryConfiguration include: -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. +// +// Operations related to DeleteBucketInventoryConfiguration include: +// +// [GetBucketInventoryConfiguration] +// +// [PutBucketInventoryConfiguration] +// +// [ListBucketInventoryConfigurations] +// +// [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html +// [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html +// [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html func (c *Client) DeleteBucketInventoryConfiguration(ctx context.Context, params *DeleteBucketInventoryConfigurationInput, optFns ...func(*Options)) (*DeleteBucketInventoryConfigurationOutput, error) { if params == nil { params = &DeleteBucketInventoryConfigurationInput{} @@ -56,14 +66,20 @@ type DeleteBucketInventoryConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketInventoryConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketInventoryConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -72,6 +88,9 @@ type DeleteBucketInventoryConfigurationOutput struct { } func (c *Client) addOperationDeleteBucketInventoryConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketInventoryConfiguration{}, middleware.After) if err != nil { return err @@ -80,34 +99,38 @@ func (c *Client) addOperationDeleteBucketInventoryConfigurationMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketInventoryConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -119,10 +142,19 @@ func (c *Client) addOperationDeleteBucketInventoryConfigurationMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketInventoryConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketInventoryConfigurationValidationMiddleware(stack); err != nil { @@ -134,7 +166,7 @@ func (c *Client) addOperationDeleteBucketInventoryConfigurationMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketInventoryConfigurationUpdateEndpoint(stack, options); err != nil { @@ -152,12 +184,24 @@ func (c *Client) addOperationDeleteBucketInventoryConfigurationMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -172,7 +216,6 @@ func newServiceMetadataMiddleware_opDeleteBucketInventoryConfiguration(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketInventoryConfiguration", } } @@ -202,139 +245,3 @@ func addDeleteBucketInventoryConfigurationUpdateEndpoint(stack *middleware.Stack DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketInventoryConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketInventoryConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketInventoryConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketInventoryConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketInventoryConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketInventoryConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketLifecycle.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketLifecycle.go index f265ec36..7eb820b4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketLifecycle.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketLifecycle.go @@ -4,16 +4,12 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -21,15 +17,57 @@ import ( // removes all the lifecycle configuration rules in the lifecycle subresource // associated with the bucket. Your objects never expire, and Amazon S3 no longer // automatically deletes any objects on the basis of rules contained in the deleted -// lifecycle configuration. To use this operation, you must have permission to -// perform the s3:PutLifecycleConfiguration action. By default, the bucket owner -// has this permission and the bucket owner can grant this permission to others. -// There is usually some time lag before lifecycle configuration deletion is fully -// propagated to all the Amazon S3 systems. For more information about the object -// expiration, see Elements to Describe Lifecycle Actions (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions) -// . Related actions include: -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) +// lifecycle configuration. +// +// Permissions +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:PutLifecycleConfiguration permission. +// +// For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - You must have the +// s3express:PutLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. +// +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . +// +// For more information about the object expiration, see [Elements to Describe Lifecycle Actions]. +// +// Related actions include: +// +// [PutBucketLifecycleConfiguration] +// +// [GetBucketLifecycleConfiguration] +// +// [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html +// [Elements to Describe Lifecycle Actions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions +// [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html func (c *Client) DeleteBucketLifecycle(ctx context.Context, params *DeleteBucketLifecycleInput, optFns ...func(*Options)) (*DeleteBucketLifecycleOutput, error) { if params == nil { params = &DeleteBucketLifecycleInput{} @@ -52,14 +90,23 @@ type DeleteBucketLifecycleInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketLifecycleInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketLifecycleOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -68,6 +115,9 @@ type DeleteBucketLifecycleOutput struct { } func (c *Client) addOperationDeleteBucketLifecycleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketLifecycle{}, middleware.After) if err != nil { return err @@ -76,34 +126,38 @@ func (c *Client) addOperationDeleteBucketLifecycleMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketLifecycle"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -115,10 +169,19 @@ func (c *Client) addOperationDeleteBucketLifecycleMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketLifecycleResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketLifecycleValidationMiddleware(stack); err != nil { @@ -130,7 +193,7 @@ func (c *Client) addOperationDeleteBucketLifecycleMiddlewares(stack *middleware. if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketLifecycleUpdateEndpoint(stack, options); err != nil { @@ -148,12 +211,24 @@ func (c *Client) addOperationDeleteBucketLifecycleMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -168,7 +243,6 @@ func newServiceMetadataMiddleware_opDeleteBucketLifecycle(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketLifecycle", } } @@ -198,139 +272,3 @@ func addDeleteBucketLifecycleUpdateEndpoint(stack *middleware.Stack, options Opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketLifecycleResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketLifecycleResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketLifecycleResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketLifecycleInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketLifecycleResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketLifecycleResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetadataTableConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetadataTableConfiguration.go new file mode 100644 index 00000000..ff44efe0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetadataTableConfiguration.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a metadata table configuration from a general purpose bucket. For more +// +// information, see [Accelerating data discovery with S3 Metadata]in the Amazon S3 User Guide. +// +// Permissions To use this operation, you must have the +// s3:DeleteBucketMetadataTableConfiguration permission. For more information, see [Setting up permissions for configuring metadata tables] +// in the Amazon S3 User Guide. +// +// The following operations are related to DeleteBucketMetadataTableConfiguration : +// +// [CreateBucketMetadataTableConfiguration] +// +// [GetBucketMetadataTableConfiguration] +// +// [Setting up permissions for configuring metadata tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html +// [GetBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html +// [CreateBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataTableConfiguration.html +// [Accelerating data discovery with S3 Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html +func (c *Client) DeleteBucketMetadataTableConfiguration(ctx context.Context, params *DeleteBucketMetadataTableConfigurationInput, optFns ...func(*Options)) (*DeleteBucketMetadataTableConfigurationOutput, error) { + if params == nil { + params = &DeleteBucketMetadataTableConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteBucketMetadataTableConfiguration", params, optFns, c.addOperationDeleteBucketMetadataTableConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteBucketMetadataTableConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteBucketMetadataTableConfigurationInput struct { + + // The general purpose bucket that you want to remove the metadata table + // configuration from. + // + // This member is required. + Bucket *string + + // The expected bucket owner of the general purpose bucket that you want to + // remove the metadata table configuration from. + ExpectedBucketOwner *string + + noSmithyDocumentSerde +} + +func (in *DeleteBucketMetadataTableConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + +type DeleteBucketMetadataTableConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteBucketMetadataTableConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketMetadataTableConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { + return err + } + if err = addOpDeleteBucketMetadataTableConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBucketMetadataTableConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addDeleteBucketMetadataTableConfigurationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = disableAcceptEncodingGzip(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func (v *DeleteBucketMetadataTableConfigurationInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +func newServiceMetadataMiddleware_opDeleteBucketMetadataTableConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteBucketMetadataTableConfiguration", + } +} + +// getDeleteBucketMetadataTableConfigurationBucketMember returns a pointer to +// string denoting a provided bucket member valueand a boolean indicating if the +// input has a modeled bucket name, +func getDeleteBucketMetadataTableConfigurationBucketMember(input interface{}) (*string, bool) { + in := input.(*DeleteBucketMetadataTableConfigurationInput) + if in.Bucket == nil { + return nil, false + } + return in.Bucket, true +} +func addDeleteBucketMetadataTableConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: getDeleteBucketMetadataTableConfigurationBucketMember, + }, + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: true, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetricsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetricsConfiguration.go index 51e57ca7..86ab9573 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetricsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketMetricsConfiguration.go @@ -4,34 +4,44 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Deletes a metrics configuration for the Amazon CloudWatch request metrics // (specified by the metrics configuration ID) from the bucket. Note that this -// doesn't include the daily storage metrics. To use this operation, you must have -// permissions to perform the s3:PutMetricsConfiguration action. The bucket owner -// has this permission by default. The bucket owner can grant this permission to -// others. For more information about permissions, see Permissions Related to -// Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about CloudWatch request metrics for Amazon S3, see -// Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// . The following operations are related to DeleteBucketMetricsConfiguration : -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) -// - Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) +// doesn't include the daily storage metrics. +// +// To use this operation, you must have permissions to perform the +// s3:PutMetricsConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. +// +// The following operations are related to DeleteBucketMetricsConfiguration : +// +// [GetBucketMetricsConfiguration] +// +// [PutBucketMetricsConfiguration] +// +// [ListBucketMetricsConfigurations] +// +// [Monitoring Metrics with Amazon CloudWatch] +// +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html +// [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html +// [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html +// [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) DeleteBucketMetricsConfiguration(ctx context.Context, params *DeleteBucketMetricsConfigurationInput, optFns ...func(*Options)) (*DeleteBucketMetricsConfigurationOutput, error) { if params == nil { params = &DeleteBucketMetricsConfigurationInput{} @@ -60,14 +70,20 @@ type DeleteBucketMetricsConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketMetricsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketMetricsConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -76,6 +92,9 @@ type DeleteBucketMetricsConfigurationOutput struct { } func (c *Client) addOperationDeleteBucketMetricsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketMetricsConfiguration{}, middleware.After) if err != nil { return err @@ -84,34 +103,38 @@ func (c *Client) addOperationDeleteBucketMetricsConfigurationMiddlewares(stack * if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketMetricsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -123,10 +146,19 @@ func (c *Client) addOperationDeleteBucketMetricsConfigurationMiddlewares(stack * if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketMetricsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketMetricsConfigurationValidationMiddleware(stack); err != nil { @@ -138,7 +170,7 @@ func (c *Client) addOperationDeleteBucketMetricsConfigurationMiddlewares(stack * if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketMetricsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -156,12 +188,24 @@ func (c *Client) addOperationDeleteBucketMetricsConfigurationMiddlewares(stack * if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -176,7 +220,6 @@ func newServiceMetadataMiddleware_opDeleteBucketMetricsConfiguration(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketMetricsConfiguration", } } @@ -206,139 +249,3 @@ func addDeleteBucketMetricsConfigurationUpdateEndpoint(stack *middleware.Stack, DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketMetricsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketMetricsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketMetricsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketMetricsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketMetricsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketMetricsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketOwnershipControls.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketOwnershipControls.go index ad99b661..da46b921 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketOwnershipControls.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketOwnershipControls.go @@ -4,26 +4,31 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you // must have the s3:PutBucketOwnershipControls permission. For more information -// about Amazon S3 permissions, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// . For information about Amazon S3 Object Ownership, see Using Object Ownership (https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html) -// . The following operations are related to DeleteBucketOwnershipControls : -// - GetBucketOwnershipControls -// - PutBucketOwnershipControls +// about Amazon S3 permissions, see [Specifying Permissions in a Policy]. +// +// For information about Amazon S3 Object Ownership, see [Using Object Ownership]. +// +// The following operations are related to DeleteBucketOwnershipControls : +// +// # GetBucketOwnershipControls +// +// # PutBucketOwnershipControls +// +// [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html func (c *Client) DeleteBucketOwnershipControls(ctx context.Context, params *DeleteBucketOwnershipControlsInput, optFns ...func(*Options)) (*DeleteBucketOwnershipControlsOutput, error) { if params == nil { params = &DeleteBucketOwnershipControlsInput{} @@ -46,14 +51,20 @@ type DeleteBucketOwnershipControlsInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketOwnershipControlsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketOwnershipControlsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -62,6 +73,9 @@ type DeleteBucketOwnershipControlsOutput struct { } func (c *Client) addOperationDeleteBucketOwnershipControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketOwnershipControls{}, middleware.After) if err != nil { return err @@ -70,34 +84,38 @@ func (c *Client) addOperationDeleteBucketOwnershipControlsMiddlewares(stack *mid if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketOwnershipControls"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -109,10 +127,19 @@ func (c *Client) addOperationDeleteBucketOwnershipControlsMiddlewares(stack *mid if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketOwnershipControlsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketOwnershipControlsValidationMiddleware(stack); err != nil { @@ -124,7 +151,7 @@ func (c *Client) addOperationDeleteBucketOwnershipControlsMiddlewares(stack *mid if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketOwnershipControlsUpdateEndpoint(stack, options); err != nil { @@ -142,12 +169,24 @@ func (c *Client) addOperationDeleteBucketOwnershipControlsMiddlewares(stack *mid if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -162,7 +201,6 @@ func newServiceMetadataMiddleware_opDeleteBucketOwnershipControls(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketOwnershipControls", } } @@ -192,139 +230,3 @@ func addDeleteBucketOwnershipControlsUpdateEndpoint(stack *middleware.Stack, opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketOwnershipControlsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketOwnershipControlsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketOwnershipControlsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketOwnershipControlsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketOwnershipControlsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketOwnershipControlsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketPolicy.go index 1718b471..8e1d89b7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketPolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketPolicy.go @@ -4,38 +4,68 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This implementation of the DELETE action uses the policy subresource to delete -// the policy of a specified bucket. If you are using an identity other than the -// root user of the Amazon Web Services account that owns the bucket, the calling -// identity must have the DeleteBucketPolicy permissions on the specified bucket -// and belong to the bucket owner's account to use this operation. If you don't -// have DeleteBucketPolicy permissions, Amazon S3 returns a 403 Access Denied -// error. If you have the correct permissions, but you're not using an identity -// that belongs to the bucket owner's account, Amazon S3 returns a 405 Method Not -// Allowed error. To ensure that bucket owners don't inadvertently lock themselves -// out of their own buckets, the root principal in a bucket owner's Amazon Web -// Services account can perform the GetBucketPolicy , PutBucketPolicy , and -// DeleteBucketPolicy API actions, even if their bucket policy explicitly denies -// the root principal's access. Bucket owner root principals can only be blocked -// from performing these API actions by VPC endpoint policies and Amazon Web -// Services Organizations policies. For more information about bucket policies, see -// Using Bucket Policies and UserPolicies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html) -// . The following operations are related to DeleteBucketPolicy -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) +// Deletes the policy of a specified bucket. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions If you are using an identity other than the root user of the Amazon +// Web Services account that owns the bucket, the calling identity must both have +// the DeleteBucketPolicy permissions on the specified bucket and belong to the +// bucket owner's account in order to use this operation. +// +// If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 +// Access Denied error. If you have the correct permissions, but you're not using +// an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 +// Method Not Allowed error. +// +// To ensure that bucket owners don't inadvertently lock themselves out of their +// own buckets, the root principal in a bucket owner's Amazon Web Services account +// can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API +// actions, even if their bucket policy explicitly denies the root principal's +// access. Bucket owner root principals can only be blocked from performing these +// API actions by VPC endpoint policies and Amazon Web Services Organizations +// policies. +// +// - General purpose bucket permissions - The s3:DeleteBucketPolicy permission is +// required in a policy. For more information about general purpose buckets bucket +// policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:DeleteBucketPolicy permission in an IAM identity-based +// policy instead of a bucket policy. Cross-account access to this API operation +// isn't supported. This operation can only be performed by the Amazon Web Services +// account that owns the resource. For more information about directory bucket +// policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// # The following operations are related to DeleteBucketPolicy +// +// [CreateBucket] +// +// [DeleteObject] +// +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) DeleteBucketPolicy(ctx context.Context, params *DeleteBucketPolicyInput, optFns ...func(*Options)) (*DeleteBucketPolicyOutput, error) { if params == nil { params = &DeleteBucketPolicyInput{} @@ -55,17 +85,38 @@ type DeleteBucketPolicyInput struct { // The bucket name. // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketPolicyInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -74,6 +125,9 @@ type DeleteBucketPolicyOutput struct { } func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketPolicy{}, middleware.After) if err != nil { return err @@ -82,34 +136,38 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -121,10 +179,19 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addDeleteBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketPolicyValidationMiddleware(stack); err != nil { @@ -136,7 +203,7 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketPolicyUpdateEndpoint(stack, options); err != nil { @@ -154,12 +221,24 @@ func (c *Client) addOperationDeleteBucketPolicyMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -174,7 +253,6 @@ func newServiceMetadataMiddleware_opDeleteBucketPolicy(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketPolicy", } } @@ -204,139 +282,3 @@ func addDeleteBucketPolicyUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketPolicyResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketPolicyResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketPolicyResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketReplication.go index 441adcea..d2c8b032 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketReplication.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketReplication.go @@ -4,31 +4,41 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the replication configuration from the bucket. To use this operation, -// you must have permissions to perform the s3:PutReplicationConfiguration action. -// The bucket owner has these permissions by default and can grant it to others. -// For more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . It can take a while for the deletion of a replication configuration to fully -// propagate. For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. The following operations are related to -// DeleteBucketReplication : -// - PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) -// - GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) +// This operation is not supported for directory buckets. +// +// Deletes the replication configuration from the bucket. +// +// To use this operation, you must have permissions to perform the +// s3:PutReplicationConfiguration action. The bucket owner has these permissions by +// default and can grant it to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] +// and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// It can take a while for the deletion of a replication configuration to fully +// propagate. +// +// For information about replication configuration, see [Replication] in the Amazon S3 User +// Guide. +// +// The following operations are related to DeleteBucketReplication : +// +// [PutBucketReplication] +// +// [GetBucketReplication] +// +// [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html +// [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) DeleteBucketReplication(ctx context.Context, params *DeleteBucketReplicationInput, optFns ...func(*Options)) (*DeleteBucketReplicationOutput, error) { if params == nil { params = &DeleteBucketReplicationInput{} @@ -46,19 +56,25 @@ func (c *Client) DeleteBucketReplication(ctx context.Context, params *DeleteBuck type DeleteBucketReplicationInput struct { - // The bucket name. + // The bucket name. // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketReplicationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketReplicationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -67,6 +83,9 @@ type DeleteBucketReplicationOutput struct { } func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketReplication{}, middleware.After) if err != nil { return err @@ -75,34 +94,38 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -114,10 +137,19 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketReplicationValidationMiddleware(stack); err != nil { @@ -129,7 +161,7 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketReplicationUpdateEndpoint(stack, options); err != nil { @@ -147,12 +179,24 @@ func (c *Client) addOperationDeleteBucketReplicationMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -167,7 +211,6 @@ func newServiceMetadataMiddleware_opDeleteBucketReplication(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketReplication", } } @@ -197,139 +240,3 @@ func addDeleteBucketReplicationUpdateEndpoint(stack *middleware.Stack, options O DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketReplicationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketReplicationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketReplicationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketReplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketReplicationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketTagging.go index 1aeef1de..22f0656e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketTagging.go @@ -4,25 +4,31 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the tags from the bucket. To use this operation, you must have -// permission to perform the s3:PutBucketTagging action. By default, the bucket -// owner has this permission and can grant this permission to others. The following -// operations are related to DeleteBucketTagging : -// - GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) -// - PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) +// This operation is not supported for directory buckets. +// +// Deletes the tags from the bucket. +// +// To use this operation, you must have permission to perform the +// s3:PutBucketTagging action. By default, the bucket owner has this permission and +// can grant this permission to others. +// +// The following operations are related to DeleteBucketTagging : +// +// [GetBucketTagging] +// +// [PutBucketTagging] +// +// [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html +// [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html func (c *Client) DeleteBucketTagging(ctx context.Context, params *DeleteBucketTaggingInput, optFns ...func(*Options)) (*DeleteBucketTaggingOutput, error) { if params == nil { params = &DeleteBucketTaggingInput{} @@ -45,14 +51,20 @@ type DeleteBucketTaggingInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketTaggingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -61,6 +73,9 @@ type DeleteBucketTaggingOutput struct { } func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketTagging{}, middleware.After) if err != nil { return err @@ -69,34 +84,38 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -108,10 +127,19 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketTaggingValidationMiddleware(stack); err != nil { @@ -123,7 +151,7 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketTaggingUpdateEndpoint(stack, options); err != nil { @@ -141,12 +169,24 @@ func (c *Client) addOperationDeleteBucketTaggingMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -161,7 +201,6 @@ func newServiceMetadataMiddleware_opDeleteBucketTagging(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketTagging", } } @@ -191,139 +230,3 @@ func addDeleteBucketTaggingUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketWebsite.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketWebsite.go index e7fc64b5..46aded0b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketWebsite.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteBucketWebsite.go @@ -4,33 +4,40 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // This action removes the website configuration for a bucket. Amazon S3 returns a // 200 OK response upon successfully deleting a website configuration on the // specified bucket. You will get a 200 OK response if the website configuration // you are trying to delete does not exist on the bucket. Amazon S3 returns a 404 -// response if the bucket specified in the request does not exist. This DELETE -// action requires the S3:DeleteBucketWebsite permission. By default, only the -// bucket owner can delete the website configuration attached to a bucket. However, -// bucket owners can grant other users permission to delete the website +// response if the bucket specified in the request does not exist. +// +// This DELETE action requires the S3:DeleteBucketWebsite permission. By default, +// only the bucket owner can delete the website configuration attached to a bucket. +// However, bucket owners can grant other users permission to delete the website // configuration by writing a bucket policy granting them the -// S3:DeleteBucketWebsite permission. For more information about hosting websites, -// see Hosting Websites on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) -// . The following operations are related to DeleteBucketWebsite : -// - GetBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) -// - PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) +// S3:DeleteBucketWebsite permission. +// +// For more information about hosting websites, see [Hosting Websites on Amazon S3]. +// +// The following operations are related to DeleteBucketWebsite : +// +// [GetBucketWebsite] +// +// [PutBucketWebsite] +// +// [GetBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html +// [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html +// [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html func (c *Client) DeleteBucketWebsite(ctx context.Context, params *DeleteBucketWebsiteInput, optFns ...func(*Options)) (*DeleteBucketWebsiteOutput, error) { if params == nil { params = &DeleteBucketWebsiteInput{} @@ -53,14 +60,20 @@ type DeleteBucketWebsiteInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeleteBucketWebsiteInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeleteBucketWebsiteOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -69,6 +82,9 @@ type DeleteBucketWebsiteOutput struct { } func (c *Client) addOperationDeleteBucketWebsiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteBucketWebsite{}, middleware.After) if err != nil { return err @@ -77,34 +93,38 @@ func (c *Client) addOperationDeleteBucketWebsiteMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteBucketWebsite"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -116,10 +136,19 @@ func (c *Client) addOperationDeleteBucketWebsiteMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteBucketWebsiteResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteBucketWebsiteValidationMiddleware(stack); err != nil { @@ -131,7 +160,7 @@ func (c *Client) addOperationDeleteBucketWebsiteMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteBucketWebsiteUpdateEndpoint(stack, options); err != nil { @@ -149,12 +178,24 @@ func (c *Client) addOperationDeleteBucketWebsiteMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -169,7 +210,6 @@ func newServiceMetadataMiddleware_opDeleteBucketWebsite(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteBucketWebsite", } } @@ -199,139 +239,3 @@ func addDeleteBucketWebsiteUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteBucketWebsiteResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteBucketWebsiteResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteBucketWebsiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteBucketWebsiteResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteBucketWebsiteResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObject.go index 5b5cbf18..fa0031a5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObject.go @@ -4,39 +4,107 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) -// Removes the null version (if there is one) of an object and inserts a delete -// marker, which becomes the latest version of the object. If there isn't a null -// version, Amazon S3 does not remove any objects but will still respond that the -// command was successful. To remove a specific version, you must use the version -// Id subresource. Using this subresource permanently deletes the version. If the -// object deleted is a delete marker, Amazon S3 sets the response header, -// x-amz-delete-marker , to true. If the object you want to delete is in a bucket -// where the bucket versioning configuration is MFA Delete enabled, you must -// include the x-amz-mfa request header in the DELETE versionId request. Requests -// that include x-amz-mfa must use HTTPS. For more information about MFA Delete, -// see Using MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html) -// . To see sample requests that use versioning, see Sample Request (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete) -// . You can delete objects by explicitly calling DELETE Object or configure its -// lifecycle ( PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) -// ) to enable Amazon S3 to remove them for you. If you want to block users or -// accounts from removing or deleting objects from your bucket, you must deny them -// the s3:DeleteObject , s3:DeleteObjectVersion , and s3:PutLifeCycleConfiguration -// actions. The following action is related to DeleteObject : -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) +// Removes an object from a bucket. The behavior depends on the bucket's +// versioning state: +// +// - If bucket versioning is not enabled, the operation permanently deletes the +// object. +// +// - If bucket versioning is enabled, the operation inserts a delete marker, +// which becomes the current version of the object. To permanently delete an object +// in a versioned bucket, you must include the object’s versionId in the request. +// For more information about versioning-enabled buckets, see [Deleting object versions from a versioning-enabled bucket]. +// +// - If bucket versioning is suspended, the operation removes the object that +// has a null versionId , if there is one, and inserts a delete marker that +// becomes the current version of the object. If there isn't an object with a null +// versionId , and all versions of the object have a versionId , Amazon S3 does +// not remove the object and only inserts a delete marker. To permanently delete an +// object that has a versionId , you must include the object’s versionId in the +// request. For more information about versioning-suspended buckets, see [Deleting objects from versioning-suspended buckets]. +// +// - Directory buckets - S3 Versioning isn't enabled and supported for directory +// buckets. For this API operation, only the null value of the version ID is +// supported by directory buckets. You can only specify null to the versionId +// query parameter in the request. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// To remove a specific version, you must use the versionId query parameter. Using +// this query parameter permanently deletes the version. If the object deleted is a +// delete marker, Amazon S3 sets the response header x-amz-delete-marker to true. +// +// If the object you want to delete is in a bucket where the bucket versioning +// configuration is MFA Delete enabled, you must include the x-amz-mfa request +// header in the DELETE versionId request. Requests that include x-amz-mfa must +// use HTTPS. For more information about MFA Delete, see [Using MFA Delete]in the Amazon S3 User +// Guide. To see sample requests that use versioning, see [Sample Request]. +// +// Directory buckets - MFA delete is not supported by directory buckets. +// +// You can delete objects by explicitly calling DELETE Object or calling ([PutBucketLifecycle] ) to +// enable Amazon S3 to remove them for you. If you want to block users or accounts +// from removing or deleting objects from your bucket, you must deny them the +// s3:DeleteObject , s3:DeleteObjectVersion , and s3:PutLifeCycleConfiguration +// actions. +// +// Directory buckets - S3 Lifecycle is not supported by directory buckets. +// +// Permissions +// +// - General purpose bucket permissions - The following permissions are required +// in your policies when your DeleteObjects request includes specific headers. +// +// - s3:DeleteObject - To delete an object from a bucket, you must always have +// the s3:DeleteObject permission. +// +// - s3:DeleteObjectVersion - To delete a specific version of an object from a +// versioning-enabled bucket, you must have the s3:DeleteObjectVersion permission. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following action is related to DeleteObject : +// +// [PutObject] +// +// [Sample Request]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete +// [Deleting objects from versioning-suspended buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Deleting object versions from a versioning-enabled bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Using MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html func (c *Client) DeleteObject(ctx context.Context, params *DeleteObjectInput, optFns ...func(*Options)) (*DeleteObjectOutput, error) { if params == nil { params = &DeleteObjectInput{} @@ -54,21 +122,40 @@ func (c *Client) DeleteObject(ctx context.Context, params *DeleteObjectInput, op type DeleteObjectInput struct { - // The bucket name of the bucket containing the object. When using this action - // with an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The bucket name of the bucket containing the object. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -81,48 +168,103 @@ type DeleteObjectInput struct { // Indicates whether S3 Object Lock should bypass Governance-mode restrictions to // process this operation. To use this header, you must have the // s3:BypassGovernanceRetention permission. - BypassGovernanceRetention bool + // + // This functionality is not supported for directory buckets. + BypassGovernanceRetention *bool - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // The If-Match header field makes the request method conditional on ETags. If the + // ETag value does not match, the operation returns a 412 Precondition Failed + // error. If the ETag matches or if the object doesn't exist, the operation will + // return a 204 Success (No Content) response . + // + // For more information about conditional requests, see [RFC 7232]. + // + // This functionality is only supported for directory buckets. + // + // [RFC 7232]: https://docs.aws.amazon.com/https:/tools.ietf.org/html/rfc7232 + IfMatch *string + + // If present, the object is deleted only if its modification times matches the + // provided Timestamp . If the Timestamp values do not match, the operation + // returns a 412 Precondition Failed error. If the Timestamp matches or if the + // object doesn’t exist, the operation returns a 204 Success (No Content) response. + // + // This functionality is only supported for directory buckets. + IfMatchLastModifiedTime *time.Time + + // If present, the object is deleted only if its size matches the provided size in + // bytes. If the Size value does not match, the operation returns a 412 + // Precondition Failed error. If the Size matches or if the object doesn’t exist, + // the operation returns a 204 Success (No Content) response. + // + // This functionality is only supported for directory buckets. + // + // You can use the If-Match , x-amz-if-match-last-modified-time and + // x-amz-if-match-size conditional headers in conjunction with each-other or + // individually. + IfMatchSize *int64 + // The concatenation of the authentication device's serial number, a space, and // the value that is displayed on your authentication device. Required to // permanently delete a versioned object if versioning is configured with MFA // delete enabled. + // + // This functionality is not supported for directory buckets. MFA *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // VersionId used to reference a specific version of the object. + // Version ID used to reference a specific version of the object. + // + // For directory buckets in this API operation, only the null value of the version + // ID is supported. VersionId *string noSmithyDocumentSerde } +func (in *DeleteObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type DeleteObjectOutput struct { // Indicates whether the specified object version that was permanently deleted was // (true) or was not (false) a delete marker before deletion. In a simple DELETE, // this header indicates whether (true) or not (false) the current version of the // object is a delete marker. - DeleteMarker bool + // + // This functionality is not supported for directory buckets. + DeleteMarker *bool // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Returns the version ID of the delete marker created as a result of the DELETE // operation. + // + // This functionality is not supported for directory buckets. VersionId *string // Metadata pertaining to the operation's result. @@ -132,6 +274,9 @@ type DeleteObjectOutput struct { } func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteObject{}, middleware.After) if err != nil { return err @@ -140,34 +285,38 @@ func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -179,10 +328,19 @@ func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteObjectValidationMiddleware(stack); err != nil { @@ -194,7 +352,7 @@ func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteObjectUpdateEndpoint(stack, options); err != nil { @@ -212,12 +370,24 @@ func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -232,7 +402,6 @@ func newServiceMetadataMiddleware_opDeleteObject(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteObject", } } @@ -293,139 +462,3 @@ func addDeleteObjectPayloadAsUnsigned(stack *middleware.Stack, options Options) v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opDeleteObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjectTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjectTagging.go index 41d46e48..54bfd7d7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjectTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjectTagging.go @@ -4,28 +4,35 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Removes the entire tag set from the specified object. For more information -// about managing object tags, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html) -// . To use this operation, you must have permission to perform the -// s3:DeleteObjectTagging action. To delete tags of a specific object version, add -// the versionId query parameter in the request. You will need permission for the -// s3:DeleteObjectVersionTagging action. The following operations are related to -// DeleteObjectTagging : -// - PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) +// about managing object tags, see [Object Tagging]. +// +// To use this operation, you must have permission to perform the +// s3:DeleteObjectTagging action. +// +// To delete tags of a specific object version, add the versionId query parameter +// in the request. You will need permission for the s3:DeleteObjectVersionTagging +// action. +// +// The following operations are related to DeleteObjectTagging : +// +// [PutObjectTagging] +// +// [GetObjectTagging] +// +// [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html +// [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html +// [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html func (c *Client) DeleteObjectTagging(ctx context.Context, params *DeleteObjectTaggingInput, optFns ...func(*Options)) (*DeleteObjectTaggingOutput, error) { if params == nil { params = &DeleteObjectTaggingInput{} @@ -43,21 +50,27 @@ func (c *Client) DeleteObjectTagging(ctx context.Context, params *DeleteObjectTa type DeleteObjectTaggingInput struct { - // The bucket name containing the objects from which to remove the tags. When - // using this action with an access point, you must direct requests to the access - // point hostname. The access point hostname takes the form + // The bucket name containing the objects from which to remove the tags. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -67,9 +80,9 @@ type DeleteObjectTaggingInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The versionId of the object that the tag-set will be removed from. @@ -78,6 +91,12 @@ type DeleteObjectTaggingInput struct { noSmithyDocumentSerde } +func (in *DeleteObjectTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type DeleteObjectTaggingOutput struct { // The versionId of the object the tag-set was removed from. @@ -90,6 +109,9 @@ type DeleteObjectTaggingOutput struct { } func (c *Client) addOperationDeleteObjectTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteObjectTagging{}, middleware.After) if err != nil { return err @@ -98,34 +120,38 @@ func (c *Client) addOperationDeleteObjectTaggingMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteObjectTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -137,10 +163,19 @@ func (c *Client) addOperationDeleteObjectTaggingMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeleteObjectTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteObjectTaggingValidationMiddleware(stack); err != nil { @@ -152,7 +187,7 @@ func (c *Client) addOperationDeleteObjectTaggingMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteObjectTaggingUpdateEndpoint(stack, options); err != nil { @@ -170,12 +205,24 @@ func (c *Client) addOperationDeleteObjectTaggingMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -190,7 +237,6 @@ func newServiceMetadataMiddleware_opDeleteObjectTagging(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteObjectTagging", } } @@ -220,139 +266,3 @@ func addDeleteObjectTaggingUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteObjectTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteObjectTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteObjectTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteObjectTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteObjectTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go index b494c18a..7ab24a88 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go @@ -4,51 +4,115 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This action enables you to delete multiple objects from a bucket using a single -// HTTP request. If you know the object keys that you want to delete, then this -// action provides a suitable alternative to sending individual delete requests, -// reducing per-request overhead. The request contains a list of up to 1000 keys -// that you want to delete. In the XML, you provide the object key names, and -// optionally, version IDs if you want to delete a specific version of the object -// from a versioning-enabled bucket. For each key, Amazon S3 performs a delete -// action and returns the result of that delete, success, or failure, in the -// response. Note that if the object specified in the request is not found, Amazon -// S3 returns the result as deleted. The action supports two modes for the -// response: verbose and quiet. By default, the action uses verbose mode in which -// the response includes the result of deletion of each key in your request. In -// quiet mode the response includes only keys where the delete action encountered -// an error. For a successful deletion, the action does not return any information -// about the delete in the response body. When performing this action on an MFA -// Delete enabled bucket, that attempts to delete any versioned objects, you must -// include an MFA token. If you do not provide one, the entire request will fail, -// even if there are non-versioned objects you are trying to delete. If you provide -// an invalid token, whether there are versioned keys in the request or not, the -// entire Multi-Object Delete request will fail. For information about MFA Delete, -// see MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete) -// . Finally, the Content-MD5 header is required for all Multi-Object Delete -// requests. Amazon S3 uses the header value to ensure that your request body has -// not been altered in transit. The following operations are related to -// DeleteObjects : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) +// This operation enables you to delete multiple objects from a bucket using a +// single HTTP request. If you know the object keys that you want to delete, then +// this operation provides a suitable alternative to sending individual delete +// requests, reducing per-request overhead. +// +// The request can contain a list of up to 1000 keys that you want to delete. In +// the XML, you provide the object key names, and optionally, version IDs if you +// want to delete a specific version of the object from a versioning-enabled +// bucket. For each key, Amazon S3 performs a delete operation and returns the +// result of that delete, success or failure, in the response. Note that if the +// object specified in the request is not found, Amazon S3 returns the result as +// deleted. +// +// - Directory buckets - S3 Versioning isn't enabled and supported for directory +// buckets. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// The operation supports two modes for the response: verbose and quiet. By +// default, the operation uses verbose mode in which the response includes the +// result of deletion of each key in your request. In quiet mode the response +// includes only keys where the delete operation encountered an error. For a +// successful deletion in a quiet mode, the operation does not return any +// information about the delete in the response body. +// +// When performing this action on an MFA Delete enabled bucket, that attempts to +// delete any versioned objects, you must include an MFA token. If you do not +// provide one, the entire request will fail, even if there are non-versioned +// objects you are trying to delete. If you provide an invalid token, whether there +// are versioned keys in the request or not, the entire Multi-Object Delete request +// will fail. For information about MFA Delete, see [MFA Delete]in the Amazon S3 User Guide. +// +// Directory buckets - MFA delete is not supported by directory buckets. +// +// Permissions +// +// - General purpose bucket permissions - The following permissions are required +// in your policies when your DeleteObjects request includes specific headers. +// +// - s3:DeleteObject - To delete an object from a bucket, you must always specify +// the s3:DeleteObject permission. +// +// - s3:DeleteObjectVersion - To delete a specific version of an object from a +// versioning-enabled bucket, you must specify the s3:DeleteObjectVersion +// permission. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// Content-MD5 request header +// +// - General purpose bucket - The Content-MD5 request header is required for all +// Multi-Object Delete requests. Amazon S3 uses the header value to ensure that +// your request body has not been altered in transit. +// +// - Directory bucket - The Content-MD5 request header or a additional checksum +// request header (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , +// x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is required for all +// Multi-Object Delete requests. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to DeleteObjects : +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [ListParts] +// +// [AbortMultipartUpload] +// +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html func (c *Client) DeleteObjects(ctx context.Context, params *DeleteObjectsInput, optFns ...func(*Options)) (*DeleteObjectsOutput, error) { if params == nil { params = &DeleteObjectsInput{} @@ -66,21 +130,40 @@ func (c *Client) DeleteObjects(ctx context.Context, params *DeleteObjectsInput, type DeleteObjectsInput struct { - // The bucket name containing the objects to delete. When using this action with - // an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The bucket name containing the objects to delete. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -93,43 +176,85 @@ type DeleteObjectsInput struct { // Specifies whether you want to delete this object even if it has a // Governance-type Object Lock in place. To use this header, you must have the // s3:BypassGovernanceRetention permission. - BypassGovernanceRetention bool - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. This checksum algorithm must - // be the same for all parts and it match the checksum value supplied in the - // CreateMultipartUpload request. + // + // This functionality is not supported for directory buckets. + BypassGovernanceRetention *bool + + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + // fails the request with the HTTP status code 400 Bad Request . + // + // For the x-amz-checksum-algorithm header, replace algorithm with the + // supported algorithm from the following list: + // + // - CRC32 + // + // - CRC32C + // + // - SHA1 + // + // - SHA256 + // + // For more information, see [Checking object integrity] in the Amazon S3 User Guide. + // + // If the individual checksum value you provide through x-amz-checksum-algorithm + // doesn't match the checksum algorithm you set through + // x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + // parameter and uses the checksum algorithm that matches the provided value in + // x-amz-checksum-algorithm . + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The concatenation of the authentication device's serial number, a space, and // the value that is displayed on your authentication device. Required to // permanently delete a versioned object if versioning is configured with MFA // delete enabled. + // + // When performing the DeleteObjects operation on an MFA delete enabled bucket, + // which attempts to delete the specified versioned objects, you must include an + // MFA token. If you don't provide an MFA token, the entire request will fail, even + // if there are non-versioned objects that you are trying to delete. If you provide + // an invalid token, whether there are versioned object keys in the request or not, + // the entire Multi-Object Delete request will fail. For information about MFA + // Delete, see [MFA Delete]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [MFA Delete]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete MFA *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer noSmithyDocumentSerde } +func (in *DeleteObjectsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type DeleteObjectsOutput struct { // Container element for a successful delete. It identifies the object that was @@ -142,6 +267,8 @@ type DeleteObjectsOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -151,6 +278,9 @@ type DeleteObjectsOutput struct { } func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteObjects{}, middleware.After) if err != nil { return err @@ -159,34 +289,38 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteObjects"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -198,10 +332,19 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addDeleteObjectsResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeleteObjectsValidationMiddleware(stack); err != nil { @@ -213,7 +356,7 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeleteObjectsInputChecksumMiddlewares(stack, options); err != nil { @@ -234,12 +377,27 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -254,7 +412,6 @@ func newServiceMetadataMiddleware_opDeleteObjects(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeleteObjects", } } @@ -304,139 +461,3 @@ func addDeleteObjectsUpdateEndpoint(stack *middleware.Stack, options Options) er DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeleteObjectsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeleteObjectsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeleteObjectsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeleteObjectsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeleteObjectsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeleteObjectsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeletePublicAccessBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeletePublicAccessBlock.go index 2bdbe421..7205bb88 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeletePublicAccessBlock.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeletePublicAccessBlock.go @@ -4,29 +4,37 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use // this operation, you must have the s3:PutBucketPublicAccessBlock permission. For -// more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . The following operations are related to DeletePublicAccessBlock : -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// - GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) +// more information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// The following operations are related to DeletePublicAccessBlock : +// +// [Using Amazon S3 Block Public Access] +// +// [GetPublicAccessBlock] +// +// [PutPublicAccessBlock] +// +// [GetBucketPolicyStatus] +// +// [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html +// [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html func (c *Client) DeletePublicAccessBlock(ctx context.Context, params *DeletePublicAccessBlockInput, optFns ...func(*Options)) (*DeletePublicAccessBlockOutput, error) { if params == nil { params = &DeletePublicAccessBlockInput{} @@ -49,14 +57,20 @@ type DeletePublicAccessBlockInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *DeletePublicAccessBlockInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type DeletePublicAccessBlockOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -65,6 +79,9 @@ type DeletePublicAccessBlockOutput struct { } func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpDeletePublicAccessBlock{}, middleware.After) if err != nil { return err @@ -73,34 +90,38 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePublicAccessBlock"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -112,10 +133,19 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addDeletePublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpDeletePublicAccessBlockValidationMiddleware(stack); err != nil { @@ -127,7 +157,7 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addDeletePublicAccessBlockUpdateEndpoint(stack, options); err != nil { @@ -145,12 +175,24 @@ func (c *Client) addOperationDeletePublicAccessBlockMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -165,7 +207,6 @@ func newServiceMetadataMiddleware_opDeletePublicAccessBlock(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "DeletePublicAccessBlock", } } @@ -195,139 +236,3 @@ func addDeletePublicAccessBlockUpdateEndpoint(stack *middleware.Stack, options O DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opDeletePublicAccessBlockResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opDeletePublicAccessBlockResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opDeletePublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*DeletePublicAccessBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addDeletePublicAccessBlockResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opDeletePublicAccessBlockResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAccelerateConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAccelerateConfiguration.go index f11b25aa..8d33fa67 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAccelerateConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAccelerateConfiguration.go @@ -4,39 +4,46 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // This implementation of the GET action uses the accelerate subresource to return // the Transfer Acceleration state of a bucket, which is either Enabled or // Suspended . Amazon S3 Transfer Acceleration is a bucket-level feature that -// enables you to perform faster data transfers to and from Amazon S3. To use this -// operation, you must have permission to perform the s3:GetAccelerateConfiguration -// action. The bucket owner has this permission by default. The bucket owner can -// grant this permission to others. For more information about permissions, see -// Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. You set the Transfer Acceleration state of an -// existing bucket to Enabled or Suspended by using the -// PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) -// operation. A GET accelerate request does not return a state value for a bucket -// that has no transfer acceleration state. A bucket has no Transfer Acceleration -// state if a state has never been set on the bucket. For more information about -// transfer acceleration, see Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon S3 User Guide. The following operations are related to -// GetBucketAccelerateConfiguration : -// - PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) +// enables you to perform faster data transfers to and from Amazon S3. +// +// To use this operation, you must have permission to perform the +// s3:GetAccelerateConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to your Amazon S3 Resources] in the Amazon S3 User Guide. +// +// You set the Transfer Acceleration state of an existing bucket to Enabled or +// Suspended by using the [PutBucketAccelerateConfiguration] operation. +// +// A GET accelerate request does not return a state value for a bucket that has no +// transfer acceleration state. A bucket has no Transfer Acceleration state if a +// state has never been set on the bucket. +// +// For more information about transfer acceleration, see [Transfer Acceleration] in the Amazon S3 User +// Guide. +// +// The following operations are related to GetBucketAccelerateConfiguration : +// +// [PutBucketAccelerateConfiguration] +// +// [PutBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Managing Access Permissions to your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html func (c *Client) GetBucketAccelerateConfiguration(ctx context.Context, params *GetBucketAccelerateConfigurationInput, optFns ...func(*Options)) (*GetBucketAccelerateConfigurationOutput, error) { if params == nil { params = &GetBucketAccelerateConfigurationInput{} @@ -59,27 +66,38 @@ type GetBucketAccelerateConfigurationInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer noSmithyDocumentSerde } +func (in *GetBucketAccelerateConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketAccelerateConfigurationOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // The accelerate configuration of the bucket. @@ -92,6 +110,9 @@ type GetBucketAccelerateConfigurationOutput struct { } func (c *Client) addOperationGetBucketAccelerateConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketAccelerateConfiguration{}, middleware.After) if err != nil { return err @@ -100,34 +121,38 @@ func (c *Client) addOperationGetBucketAccelerateConfigurationMiddlewares(stack * if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketAccelerateConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -139,10 +164,19 @@ func (c *Client) addOperationGetBucketAccelerateConfigurationMiddlewares(stack * if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketAccelerateConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketAccelerateConfigurationValidationMiddleware(stack); err != nil { @@ -154,7 +188,7 @@ func (c *Client) addOperationGetBucketAccelerateConfigurationMiddlewares(stack * if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketAccelerateConfigurationUpdateEndpoint(stack, options); err != nil { @@ -172,12 +206,24 @@ func (c *Client) addOperationGetBucketAccelerateConfigurationMiddlewares(stack * if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -192,7 +238,6 @@ func newServiceMetadataMiddleware_opGetBucketAccelerateConfiguration(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketAccelerateConfiguration", } } @@ -222,139 +267,3 @@ func addGetBucketAccelerateConfigurationUpdateEndpoint(stack *middleware.Stack, DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketAccelerateConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketAccelerateConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketAccelerateConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketAccelerateConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketAccelerateConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketAccelerateConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go index 62334951..8ae6505d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go @@ -4,39 +4,45 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // This implementation of the GET action uses the acl subresource to return the // access control list (ACL) of a bucket. To use GET to return the ACL of the -// bucket, you must have READ_ACP access to the bucket. If READ_ACP permission is -// granted to the anonymous user, you can return the ACL of the bucket without -// using an authorization header. To use this API operation against an access -// point, provide the alias of the access point in place of the bucket name. To use -// this API operation against an Object Lambda access point, provide the alias of -// the Object Lambda access point in place of the bucket name. If the Object Lambda -// access point alias in a request is not valid, the error code +// bucket, you must have the READ_ACP access to the bucket. If READ_ACP permission +// is granted to the anonymous user, you can return the ACL of the bucket without +// using an authorization header. +// +// When you use this API operation with an access point, provide the alias of the +// access point in place of the bucket name. +// +// When you use this API operation with an Object Lambda access point, provide the +// alias of the Object Lambda access point in place of the bucket name. If the +// Object Lambda access point alias in a request is not valid, the error code // InvalidAccessPointAliasError is returned. For more information about -// InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . If your bucket uses the bucket owner enforced setting for S3 Object Ownership, +// InvalidAccessPointAliasError , see [List of Error Codes]. +// +// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, // requests to read ACLs are still supported and return the // bucket-owner-full-control ACL with the owner being the account that created the -// bucket. For more information, see Controlling object ownership and disabling -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. The following operations are related to -// GetBucketAcl : -// - ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) +// bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. +// +// The following operations are related to GetBucketAcl : +// +// [ListObjects] +// +// [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html +// [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList +// [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html func (c *Client) GetBucketAcl(ctx context.Context, params *GetBucketAclInput, optFns ...func(*Options)) (*GetBucketAclOutput, error) { if params == nil { params = &GetBucketAclInput{} @@ -54,26 +60,36 @@ func (c *Client) GetBucketAcl(ctx context.Context, params *GetBucketAclInput, op type GetBucketAclInput struct { - // Specifies the S3 bucket whose ACL is being requested. To use this API operation - // against an access point, provide the alias of the access point in place of the - // bucket name. To use this API operation against an Object Lambda access point, - // provide the alias of the Object Lambda access point in place of the bucket name. - // If the Object Lambda access point alias in a request is not valid, the error - // code InvalidAccessPointAliasError is returned. For more information about - // InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . + // Specifies the S3 bucket whose ACL is being requested. + // + // When you use this API operation with an access point, provide the alias of the + // access point in place of the bucket name. + // + // When you use this API operation with an Object Lambda access point, provide the + // alias of the Object Lambda access point in place of the bucket name. If the + // Object Lambda access point alias in a request is not valid, the error code + // InvalidAccessPointAliasError is returned. For more information about + // InvalidAccessPointAliasError , see [List of Error Codes]. + // + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketAclInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketAclOutput struct { // A list of grants. @@ -89,6 +105,9 @@ type GetBucketAclOutput struct { } func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketAcl{}, middleware.After) if err != nil { return err @@ -97,34 +116,38 @@ func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketAcl"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -136,10 +159,19 @@ func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketAclResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketAclValidationMiddleware(stack); err != nil { @@ -151,7 +183,7 @@ func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketAclUpdateEndpoint(stack, options); err != nil { @@ -169,12 +201,24 @@ func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -189,7 +233,6 @@ func newServiceMetadataMiddleware_opGetBucketAcl(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketAcl", } } @@ -219,139 +262,3 @@ func addGetBucketAclUpdateEndpoint(stack *middleware.Stack, options Options) err DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketAclResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketAclResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketAclResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketAclResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketAclResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAnalyticsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAnalyticsConfiguration.go index bc8b5c31..a0e8ac7c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAnalyticsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAnalyticsConfiguration.go @@ -4,34 +4,43 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // This implementation of the GET action returns an analytics configuration -// (identified by the analytics configuration ID) from the bucket. To use this -// operation, you must have permissions to perform the s3:GetAnalyticsConfiguration -// action. The bucket owner has this permission by default. The bucket owner can -// grant this permission to others. For more information about permissions, see -// Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. For information about Amazon S3 analytics feature, -// see Amazon S3 Analytics – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// in the Amazon S3 User Guide. The following operations are related to -// GetBucketAnalyticsConfiguration : -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) +// (identified by the analytics configuration ID) from the bucket. +// +// To use this operation, you must have permissions to perform the +// s3:GetAnalyticsConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources] in the Amazon S3 User Guide. +// +// For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis] in the Amazon S3 User +// Guide. +// +// The following operations are related to GetBucketAnalyticsConfiguration : +// +// [DeleteBucketAnalyticsConfiguration] +// +// [ListBucketAnalyticsConfigurations] +// +// [PutBucketAnalyticsConfiguration] +// +// [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html +// [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html +// [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) GetBucketAnalyticsConfiguration(ctx context.Context, params *GetBucketAnalyticsConfigurationInput, optFns ...func(*Options)) (*GetBucketAnalyticsConfigurationOutput, error) { if params == nil { params = &GetBucketAnalyticsConfigurationInput{} @@ -59,14 +68,20 @@ type GetBucketAnalyticsConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketAnalyticsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketAnalyticsConfigurationOutput struct { // The configuration and any analyses for the analytics filter. @@ -79,6 +94,9 @@ type GetBucketAnalyticsConfigurationOutput struct { } func (c *Client) addOperationGetBucketAnalyticsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketAnalyticsConfiguration{}, middleware.After) if err != nil { return err @@ -87,34 +105,38 @@ func (c *Client) addOperationGetBucketAnalyticsConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketAnalyticsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -126,10 +148,19 @@ func (c *Client) addOperationGetBucketAnalyticsConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketAnalyticsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketAnalyticsConfigurationValidationMiddleware(stack); err != nil { @@ -141,7 +172,7 @@ func (c *Client) addOperationGetBucketAnalyticsConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketAnalyticsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -159,12 +190,24 @@ func (c *Client) addOperationGetBucketAnalyticsConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -179,7 +222,6 @@ func newServiceMetadataMiddleware_opGetBucketAnalyticsConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketAnalyticsConfiguration", } } @@ -209,139 +251,3 @@ func addGetBucketAnalyticsConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketAnalyticsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketAnalyticsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketAnalyticsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketAnalyticsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketAnalyticsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketCors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketCors.go index 09437e26..ee1d6b91 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketCors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketCors.go @@ -4,34 +4,46 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the Cross-Origin Resource Sharing (CORS) configuration information set -// for the bucket. To use this operation, you must have permission to perform the -// s3:GetBucketCORS action. By default, the bucket owner has this permission and -// can grant it to others. To use this API operation against an access point, -// provide the alias of the access point in place of the bucket name. To use this -// API operation against an Object Lambda access point, provide the alias of the -// Object Lambda access point in place of the bucket name. If the Object Lambda -// access point alias in a request is not valid, the error code +// for the bucket. +// +// To use this operation, you must have permission to perform the s3:GetBucketCORS +// action. By default, the bucket owner has this permission and can grant it to +// others. +// +// When you use this API operation with an access point, provide the alias of the +// access point in place of the bucket name. +// +// When you use this API operation with an Object Lambda access point, provide the +// alias of the Object Lambda access point in place of the bucket name. If the +// Object Lambda access point alias in a request is not valid, the error code // InvalidAccessPointAliasError is returned. For more information about -// InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . For more information about CORS, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// . The following operations are related to GetBucketCors : -// - PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) -// - DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) +// InvalidAccessPointAliasError , see [List of Error Codes]. +// +// For more information about CORS, see [Enabling Cross-Origin Resource Sharing]. +// +// The following operations are related to GetBucketCors : +// +// [PutBucketCors] +// +// [DeleteBucketCors] +// +// [PutBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html +// [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html +// [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList +// [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html func (c *Client) GetBucketCors(ctx context.Context, params *GetBucketCorsInput, optFns ...func(*Options)) (*GetBucketCorsOutput, error) { if params == nil { params = &GetBucketCorsInput{} @@ -49,26 +61,36 @@ func (c *Client) GetBucketCors(ctx context.Context, params *GetBucketCorsInput, type GetBucketCorsInput struct { - // The bucket name for which to get the cors configuration. To use this API - // operation against an access point, provide the alias of the access point in - // place of the bucket name. To use this API operation against an Object Lambda - // access point, provide the alias of the Object Lambda access point in place of - // the bucket name. If the Object Lambda access point alias in a request is not - // valid, the error code InvalidAccessPointAliasError is returned. For more - // information about InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . + // The bucket name for which to get the cors configuration. + // + // When you use this API operation with an access point, provide the alias of the + // access point in place of the bucket name. + // + // When you use this API operation with an Object Lambda access point, provide the + // alias of the Object Lambda access point in place of the bucket name. If the + // Object Lambda access point alias in a request is not valid, the error code + // InvalidAccessPointAliasError is returned. For more information about + // InvalidAccessPointAliasError , see [List of Error Codes]. + // + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketCorsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketCorsOutput struct { // A set of origins and methods (cross-origin access that you want to allow). You @@ -82,6 +104,9 @@ type GetBucketCorsOutput struct { } func (c *Client) addOperationGetBucketCorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketCors{}, middleware.After) if err != nil { return err @@ -90,34 +115,38 @@ func (c *Client) addOperationGetBucketCorsMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketCors"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -129,10 +158,19 @@ func (c *Client) addOperationGetBucketCorsMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketCorsResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketCorsValidationMiddleware(stack); err != nil { @@ -144,7 +182,7 @@ func (c *Client) addOperationGetBucketCorsMiddlewares(stack *middleware.Stack, o if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketCorsUpdateEndpoint(stack, options); err != nil { @@ -162,12 +200,24 @@ func (c *Client) addOperationGetBucketCorsMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -182,7 +232,6 @@ func newServiceMetadataMiddleware_opGetBucketCors(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketCors", } } @@ -212,139 +261,3 @@ func addGetBucketCorsUpdateEndpoint(stack *middleware.Stack, options Options) er DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketCorsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketCorsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketCorsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketCorsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketCorsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go index b60c5f46..a7dda520 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go @@ -4,34 +4,57 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the default encryption configuration for an Amazon S3 bucket. By // default, all buckets have a default encryption configuration that uses -// server-side encryption with Amazon S3 managed keys (SSE-S3). For information -// about the bucket default encryption feature, see Amazon S3 Bucket Default -// Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon S3 User Guide. To use this operation, you must have permission to -// perform the s3:GetEncryptionConfiguration action. The bucket owner has this -// permission by default. The bucket owner can grant this permission to others. For -// more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . The following operations are related to GetBucketEncryption : -// - PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) -// - DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) +// server-side encryption with Amazon S3 managed keys (SSE-S3). +// +// - General purpose buckets - For information about the bucket default +// encryption feature, see [Amazon S3 Bucket Default Encryption]in the Amazon S3 User Guide. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: SSE-S3 and SSE-KMS. For information about +// the default encryption configuration in directory buckets, see [Setting default server-side encryption behavior for directory buckets]. +// +// Permissions +// +// - General purpose bucket permissions - The s3:GetEncryptionConfiguration +// permission is required in a policy. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:GetEncryptionConfiguration permission in an IAM +// identity-based policy instead of a bucket policy. Cross-account access to this +// API operation isn't supported. This operation can only be performed by the +// Amazon Web Services account that owns the resource. For more information about +// directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following operations are related to GetBucketEncryption : +// +// [PutBucketEncryption] +// +// [DeleteBucketEncryption] +// +// [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html +// [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html +// [Setting default server-side encryption behavior for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html +// [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) GetBucketEncryption(ctx context.Context, params *GetBucketEncryptionInput, optFns ...func(*Options)) (*GetBucketEncryptionOutput, error) { if params == nil { params = &GetBucketEncryptionInput{} @@ -52,17 +75,38 @@ type GetBucketEncryptionInput struct { // The name of the bucket from which the server-side encryption configuration is // retrieved. // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketEncryptionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketEncryptionOutput struct { // Specifies the default server-side-encryption configuration. @@ -75,6 +119,9 @@ type GetBucketEncryptionOutput struct { } func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketEncryption{}, middleware.After) if err != nil { return err @@ -83,34 +130,38 @@ func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketEncryption"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -122,10 +173,19 @@ func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketEncryptionResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketEncryptionValidationMiddleware(stack); err != nil { @@ -137,7 +197,7 @@ func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketEncryptionUpdateEndpoint(stack, options); err != nil { @@ -155,12 +215,24 @@ func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -175,7 +247,6 @@ func newServiceMetadataMiddleware_opGetBucketEncryption(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketEncryption", } } @@ -205,139 +276,3 @@ func addGetBucketEncryptionUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketEncryptionResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketEncryptionResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketEncryptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketEncryptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketEncryptionResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go index 259b265b..ccf065ee 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go @@ -4,38 +4,48 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets the S3 Intelligent-Tiering configuration from the specified bucket. The S3 -// Intelligent-Tiering storage class is designed to optimize storage costs by -// automatically moving data to the most cost-effective storage access tier, +// This operation is not supported for directory buckets. +// +// Gets the S3 Intelligent-Tiering configuration from the specified bucket. +// +// The S3 Intelligent-Tiering storage class is designed to optimize storage costs +// by automatically moving data to the most cost-effective storage access tier, // without performance impact or operational overhead. S3 Intelligent-Tiering // delivers automatic cost savings in three low latency and high throughput access // tiers. To get the lowest storage cost on data that can be accessed in minutes to -// hours, you can choose to activate additional archiving capabilities. The S3 -// Intelligent-Tiering storage class is the ideal storage class for data with -// unknown, changing, or unpredictable access patterns, independent of object size -// or retention period. If the size of an object is less than 128 KB, it is not -// monitored and not eligible for auto-tiering. Smaller objects can be stored, but -// they are always charged at the Frequent Access tier rates in the S3 -// Intelligent-Tiering storage class. For more information, see Storage class for -// automatically optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) -// . Operations related to GetBucketIntelligentTieringConfiguration include: -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) +// hours, you can choose to activate additional archiving capabilities. +// +// The S3 Intelligent-Tiering storage class is the ideal storage class for data +// with unknown, changing, or unpredictable access patterns, independent of object +// size or retention period. If the size of an object is less than 128 KB, it is +// not monitored and not eligible for auto-tiering. Smaller objects can be stored, +// but they are always charged at the Frequent Access tier rates in the S3 +// Intelligent-Tiering storage class. +// +// For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. +// +// Operations related to GetBucketIntelligentTieringConfiguration include: +// +// [DeleteBucketIntelligentTieringConfiguration] +// +// [PutBucketIntelligentTieringConfiguration] +// +// [ListBucketIntelligentTieringConfigurations] +// +// [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html +// [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html +// [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access +// [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html func (c *Client) GetBucketIntelligentTieringConfiguration(ctx context.Context, params *GetBucketIntelligentTieringConfigurationInput, optFns ...func(*Options)) (*GetBucketIntelligentTieringConfigurationOutput, error) { if params == nil { params = &GetBucketIntelligentTieringConfigurationInput{} @@ -67,6 +77,12 @@ type GetBucketIntelligentTieringConfigurationInput struct { noSmithyDocumentSerde } +func (in *GetBucketIntelligentTieringConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketIntelligentTieringConfigurationOutput struct { // Container for S3 Intelligent-Tiering configuration. @@ -79,6 +95,9 @@ type GetBucketIntelligentTieringConfigurationOutput struct { } func (c *Client) addOperationGetBucketIntelligentTieringConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration{}, middleware.After) if err != nil { return err @@ -87,34 +106,38 @@ func (c *Client) addOperationGetBucketIntelligentTieringConfigurationMiddlewares if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketIntelligentTieringConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -126,10 +149,19 @@ func (c *Client) addOperationGetBucketIntelligentTieringConfigurationMiddlewares if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketIntelligentTieringConfigurationValidationMiddleware(stack); err != nil { @@ -141,7 +173,7 @@ func (c *Client) addOperationGetBucketIntelligentTieringConfigurationMiddlewares if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketIntelligentTieringConfigurationUpdateEndpoint(stack, options); err != nil { @@ -159,12 +191,24 @@ func (c *Client) addOperationGetBucketIntelligentTieringConfigurationMiddlewares if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -179,7 +223,6 @@ func newServiceMetadataMiddleware_opGetBucketIntelligentTieringConfiguration(reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketIntelligentTieringConfiguration", } } @@ -209,139 +252,3 @@ func addGetBucketIntelligentTieringConfigurationUpdateEndpoint(stack *middleware DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketIntelligentTieringConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketIntelligentTieringConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketInventoryConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketInventoryConfiguration.go index 4863f979..8d61953c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketInventoryConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketInventoryConfiguration.go @@ -4,31 +4,42 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns an inventory configuration (identified by the inventory configuration -// ID) from the bucket. To use this operation, you must have permissions to perform -// the s3:GetInventoryConfiguration action. The bucket owner has this permission -// by default and can grant this permission to others. For more information about -// permissions, see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about the Amazon S3 inventory feature, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// . The following operations are related to GetBucketInventoryConfiguration : -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) +// ID) from the bucket. +// +// To use this operation, you must have permissions to perform the +// s3:GetInventoryConfiguration action. The bucket owner has this permission by +// default and can grant this permission to others. For more information about +// permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory]. +// +// The following operations are related to GetBucketInventoryConfiguration : +// +// [DeleteBucketInventoryConfiguration] +// +// [ListBucketInventoryConfigurations] +// +// [PutBucketInventoryConfiguration] +// +// [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html +// [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html func (c *Client) GetBucketInventoryConfiguration(ctx context.Context, params *GetBucketInventoryConfigurationInput, optFns ...func(*Options)) (*GetBucketInventoryConfigurationOutput, error) { if params == nil { params = &GetBucketInventoryConfigurationInput{} @@ -56,14 +67,20 @@ type GetBucketInventoryConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketInventoryConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketInventoryConfigurationOutput struct { // Specifies the inventory configuration. @@ -76,6 +93,9 @@ type GetBucketInventoryConfigurationOutput struct { } func (c *Client) addOperationGetBucketInventoryConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketInventoryConfiguration{}, middleware.After) if err != nil { return err @@ -84,34 +104,38 @@ func (c *Client) addOperationGetBucketInventoryConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketInventoryConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -123,10 +147,19 @@ func (c *Client) addOperationGetBucketInventoryConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketInventoryConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketInventoryConfigurationValidationMiddleware(stack); err != nil { @@ -138,7 +171,7 @@ func (c *Client) addOperationGetBucketInventoryConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketInventoryConfigurationUpdateEndpoint(stack, options); err != nil { @@ -156,12 +189,24 @@ func (c *Client) addOperationGetBucketInventoryConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -176,7 +221,6 @@ func newServiceMetadataMiddleware_opGetBucketInventoryConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketInventoryConfiguration", } } @@ -206,139 +250,3 @@ func addGetBucketInventoryConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketInventoryConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketInventoryConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketInventoryConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketInventoryConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketInventoryConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketInventoryConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLifecycleConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLifecycleConfiguration.go index da3e47d4..547097bc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLifecycleConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLifecycleConfiguration.go @@ -4,45 +4,91 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns the lifecycle configuration information set on the bucket. For +// information about lifecycle configuration, see [Object Lifecycle Management]. +// // Bucket lifecycle configuration now supports specifying a lifecycle rule using -// an object key name prefix, one or more object tags, or a combination of both. -// Accordingly, this section describes the latest API. The response describes the -// new filter element that you can use to specify a filter to select a subset of -// objects to which the rule applies. If you are using a previous version of the -// lifecycle configuration, it still works. For the earlier action, see -// GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) -// . Returns the lifecycle configuration information set on the bucket. For -// information about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// . To use this operation, you must have permission to perform the -// s3:GetLifecycleConfiguration action. The bucket owner has this permission, by -// default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . GetBucketLifecycleConfiguration has the following special error: +// an object key name prefix, one or more object tags, object size, or any +// combination of these. Accordingly, this section describes the latest API, which +// is compatible with the new functionality. The previous version of the API +// supported filtering based only on an object key name prefix, which is supported +// for general purpose buckets for backward compatibility. For the related API +// description, see [GetBucketLifecycle]. +// +// Lifecyle configurations for directory buckets only support expiring objects and +// cancelling multipart uploads. Expiring of versioned objects, transitions and tag +// filters are not supported. +// +// Permissions +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:GetLifecycleConfiguration permission. +// +// For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - You must have the +// s3express:GetLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. +// +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . +// +// GetBucketLifecycleConfiguration has the following special error: +// // - Error code: NoSuchLifecycleConfiguration +// // - Description: The lifecycle configuration does not exist. +// // - HTTP Status Code: 404 Not Found +// // - SOAP Fault Code Prefix: Client // // The following operations are related to GetBucketLifecycleConfiguration : -// - GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) -// - PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) -// - DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) +// +// [GetBucketLifecycle] +// +// [PutBucketLifecycle] +// +// [DeleteBucketLifecycle] +// +// [GetBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html +// [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html +// +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html func (c *Client) GetBucketLifecycleConfiguration(ctx context.Context, params *GetBucketLifecycleConfigurationInput, optFns ...func(*Options)) (*GetBucketLifecycleConfigurationOutput, error) { if params == nil { params = &GetBucketLifecycleConfigurationInput{} @@ -65,19 +111,47 @@ type GetBucketLifecycleConfigurationInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketLifecycleConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketLifecycleConfigurationOutput struct { // Container for a lifecycle rule. Rules []types.LifecycleRule + // Indicates which default minimum object size behavior is applied to the + // lifecycle configuration. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // + // - all_storage_classes_128K - Objects smaller than 128 KB will not transition + // to any storage class by default. + // + // - varies_by_storage_class - Objects smaller than 128 KB will transition to + // Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + // all other storage classes will prevent transitions smaller than 128 KB. + // + // To customize the minimum object size for any transition you can add a filter + // that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + // of your transition rule. Custom filters always take precedence over the default + // transition behavior. + TransitionDefaultMinimumObjectSize types.TransitionDefaultMinimumObjectSize + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -85,6 +159,9 @@ type GetBucketLifecycleConfigurationOutput struct { } func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketLifecycleConfiguration{}, middleware.After) if err != nil { return err @@ -93,34 +170,38 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketLifecycleConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -132,10 +213,19 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketLifecycleConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketLifecycleConfigurationValidationMiddleware(stack); err != nil { @@ -147,7 +237,7 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketLifecycleConfigurationUpdateEndpoint(stack, options); err != nil { @@ -165,12 +255,24 @@ func (c *Client) addOperationGetBucketLifecycleConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -185,7 +287,6 @@ func newServiceMetadataMiddleware_opGetBucketLifecycleConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketLifecycleConfiguration", } } @@ -215,139 +316,3 @@ func addGetBucketLifecycleConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketLifecycleConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketLifecycleConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketLifecycleConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketLifecycleConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go index 9404b457..973f3959 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go @@ -6,40 +6,48 @@ import ( "bytes" "context" "encoding/xml" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" smithy "github.com/aws/smithy-go" smithyxml "github.com/aws/smithy-go/encoding/xml" - smithyendpoints "github.com/aws/smithy-go/endpoints" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "io" ) +// This operation is not supported for directory buckets. +// // Returns the Region the bucket resides in. You set the bucket's Region using the // LocationConstraint request parameter in a CreateBucket request. For more -// information, see CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// . To use this API operation against an access point, provide the alias of the -// access point in place of the bucket name. To use this API operation against an -// Object Lambda access point, provide the alias of the Object Lambda access point -// in place of the bucket name. If the Object Lambda access point alias in a -// request is not valid, the error code InvalidAccessPointAliasError is returned. -// For more information about InvalidAccessPointAliasError , see List of Error -// Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . We recommend that you use HeadBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html) -// to return the Region that a bucket resides in. For backward compatibility, -// Amazon S3 continues to support GetBucketLocation. The following operations are -// related to GetBucketLocation : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) +// information, see [CreateBucket]. +// +// When you use this API operation with an access point, provide the alias of the +// access point in place of the bucket name. +// +// When you use this API operation with an Object Lambda access point, provide the +// alias of the Object Lambda access point in place of the bucket name. If the +// Object Lambda access point alias in a request is not valid, the error code +// InvalidAccessPointAliasError is returned. For more information about +// InvalidAccessPointAliasError , see [List of Error Codes]. +// +// We recommend that you use [HeadBucket] to return the Region that a bucket resides in. For +// backward compatibility, Amazon S3 continues to support GetBucketLocation. +// +// The following operations are related to GetBucketLocation : +// +// [GetObject] +// +// [CreateBucket] +// +// [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [HeadBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html func (c *Client) GetBucketLocation(ctx context.Context, params *GetBucketLocationInput, optFns ...func(*Options)) (*GetBucketLocationOutput, error) { if params == nil { params = &GetBucketLocationInput{} @@ -57,31 +65,43 @@ func (c *Client) GetBucketLocation(ctx context.Context, params *GetBucketLocatio type GetBucketLocationInput struct { - // The name of the bucket for which to get the location. To use this API operation - // against an access point, provide the alias of the access point in place of the - // bucket name. To use this API operation against an Object Lambda access point, - // provide the alias of the Object Lambda access point in place of the bucket name. - // If the Object Lambda access point alias in a request is not valid, the error - // code InvalidAccessPointAliasError is returned. For more information about - // InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . + // The name of the bucket for which to get the location. + // + // When you use this API operation with an access point, provide the alias of the + // access point in place of the bucket name. + // + // When you use this API operation with an Object Lambda access point, provide the + // alias of the Object Lambda access point in place of the bucket name. If the + // Object Lambda access point alias in a request is not valid, the error code + // InvalidAccessPointAliasError is returned. For more information about + // InvalidAccessPointAliasError , see [List of Error Codes]. + // + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketLocationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketLocationOutput struct { // Specifies the Region where the bucket resides. For a list of all the Amazon S3 - // supported location constraints by Region, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) - // . Buckets in Region us-east-1 have a LocationConstraint of null . + // supported location constraints by Region, see [Regions and Endpoints]. Buckets in Region us-east-1 + // have a LocationConstraint of null . + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region LocationConstraint types.BucketLocationConstraint // Metadata pertaining to the operation's result. @@ -91,6 +111,9 @@ type GetBucketLocationOutput struct { } func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketLocation{}, middleware.After) if err != nil { return err @@ -99,34 +122,38 @@ func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stac if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketLocation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -141,10 +168,19 @@ func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stac if err = swapDeserializerHelper(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketLocationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketLocationValidationMiddleware(stack); err != nil { @@ -156,7 +192,7 @@ func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stac if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketLocationUpdateEndpoint(stack, options); err != nil { @@ -174,12 +210,24 @@ func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stac if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -250,7 +298,6 @@ func newServiceMetadataMiddleware_opGetBucketLocation(region string) *awsmiddlew return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketLocation", } } @@ -280,139 +327,3 @@ func addGetBucketLocationUpdateEndpoint(stack *middleware.Stack, options Options DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketLocationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketLocationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketLocationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketLocationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketLocationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketLocationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLogging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLogging.go index 13c01889..b774266d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLogging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLogging.go @@ -4,25 +4,29 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the logging status of a bucket and the permissions users have to view -// and modify that status. The following operations are related to GetBucketLogging -// : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - PutBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) +// and modify that status. +// +// The following operations are related to GetBucketLogging : +// +// [CreateBucket] +// +// [PutBucketLogging] +// +// [PutBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html func (c *Client) GetBucketLogging(ctx context.Context, params *GetBucketLoggingInput, optFns ...func(*Options)) (*GetBucketLoggingOutput, error) { if params == nil { params = &GetBucketLoggingInput{} @@ -45,19 +49,27 @@ type GetBucketLoggingInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketLoggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketLoggingOutput struct { // Describes where logs are stored and the prefix that Amazon S3 assigns to all - // log object keys for a bucket. For more information, see PUT Bucket logging (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) - // in the Amazon S3 API Reference. + // log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API + // Reference. + // + // [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html LoggingEnabled *types.LoggingEnabled // Metadata pertaining to the operation's result. @@ -67,6 +79,9 @@ type GetBucketLoggingOutput struct { } func (c *Client) addOperationGetBucketLoggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketLogging{}, middleware.After) if err != nil { return err @@ -75,34 +90,38 @@ func (c *Client) addOperationGetBucketLoggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketLogging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -114,10 +133,19 @@ func (c *Client) addOperationGetBucketLoggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketLoggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketLoggingValidationMiddleware(stack); err != nil { @@ -129,7 +157,7 @@ func (c *Client) addOperationGetBucketLoggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketLoggingUpdateEndpoint(stack, options); err != nil { @@ -147,12 +175,24 @@ func (c *Client) addOperationGetBucketLoggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -167,7 +207,6 @@ func newServiceMetadataMiddleware_opGetBucketLogging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketLogging", } } @@ -197,139 +236,3 @@ func addGetBucketLoggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketLoggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketLoggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketLoggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketLoggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketLoggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketLoggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetadataTableConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetadataTableConfiguration.go new file mode 100644 index 00000000..e3b17f1a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetadataTableConfiguration.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the metadata table configuration for a general purpose bucket. For +// +// more information, see [Accelerating data discovery with S3 Metadata]in the Amazon S3 User Guide. +// +// Permissions To use this operation, you must have the +// s3:GetBucketMetadataTableConfiguration permission. For more information, see [Setting up permissions for configuring metadata tables] +// in the Amazon S3 User Guide. +// +// The following operations are related to GetBucketMetadataTableConfiguration : +// +// [CreateBucketMetadataTableConfiguration] +// +// [DeleteBucketMetadataTableConfiguration] +// +// [Setting up permissions for configuring metadata tables]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html +// [CreateBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataTableConfiguration.html +// [DeleteBucketMetadataTableConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html +// [Accelerating data discovery with S3 Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html +func (c *Client) GetBucketMetadataTableConfiguration(ctx context.Context, params *GetBucketMetadataTableConfigurationInput, optFns ...func(*Options)) (*GetBucketMetadataTableConfigurationOutput, error) { + if params == nil { + params = &GetBucketMetadataTableConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetBucketMetadataTableConfiguration", params, optFns, c.addOperationGetBucketMetadataTableConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetBucketMetadataTableConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetBucketMetadataTableConfigurationInput struct { + + // The general purpose bucket that contains the metadata table configuration that + // you want to retrieve. + // + // This member is required. + Bucket *string + + // The expected owner of the general purpose bucket that you want to retrieve the + // metadata table configuration from. + ExpectedBucketOwner *string + + noSmithyDocumentSerde +} + +func (in *GetBucketMetadataTableConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + +type GetBucketMetadataTableConfigurationOutput struct { + + // The metadata table configuration for the general purpose bucket. + GetBucketMetadataTableConfigurationResult *types.GetBucketMetadataTableConfigurationResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetBucketMetadataTableConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetBucketMetadataTableConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketMetadataTableConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { + return err + } + if err = addOpGetBucketMetadataTableConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBucketMetadataTableConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addGetBucketMetadataTableConfigurationUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = disableAcceptEncodingGzip(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func (v *GetBucketMetadataTableConfigurationInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +func newServiceMetadataMiddleware_opGetBucketMetadataTableConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetBucketMetadataTableConfiguration", + } +} + +// getGetBucketMetadataTableConfigurationBucketMember returns a pointer to string +// denoting a provided bucket member valueand a boolean indicating if the input has +// a modeled bucket name, +func getGetBucketMetadataTableConfigurationBucketMember(input interface{}) (*string, bool) { + in := input.(*GetBucketMetadataTableConfigurationInput) + if in.Bucket == nil { + return nil, false + } + return in.Bucket, true +} +func addGetBucketMetadataTableConfigurationUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: getGetBucketMetadataTableConfigurationBucketMember, + }, + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: true, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetricsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetricsConfiguration.go index 7755975d..a83b7262 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetricsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketMetricsConfiguration.go @@ -4,35 +4,44 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Gets a metrics configuration (specified by the metrics configuration ID) from -// the bucket. Note that this doesn't include the daily storage metrics. To use -// this operation, you must have permissions to perform the +// the bucket. Note that this doesn't include the daily storage metrics. +// +// To use this operation, you must have permissions to perform the // s3:GetMetricsConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about CloudWatch request metrics for Amazon S3, see -// Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// . The following operations are related to GetBucketMetricsConfiguration : -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) -// - Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. +// +// The following operations are related to GetBucketMetricsConfiguration : +// +// [PutBucketMetricsConfiguration] +// +// [DeleteBucketMetricsConfiguration] +// +// [ListBucketMetricsConfigurations] +// +// [Monitoring Metrics with Amazon CloudWatch] +// +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html +// [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html +// [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html +// [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) GetBucketMetricsConfiguration(ctx context.Context, params *GetBucketMetricsConfigurationInput, optFns ...func(*Options)) (*GetBucketMetricsConfigurationOutput, error) { if params == nil { params = &GetBucketMetricsConfigurationInput{} @@ -61,14 +70,20 @@ type GetBucketMetricsConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketMetricsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketMetricsConfigurationOutput struct { // Specifies the metrics configuration. @@ -81,6 +96,9 @@ type GetBucketMetricsConfigurationOutput struct { } func (c *Client) addOperationGetBucketMetricsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketMetricsConfiguration{}, middleware.After) if err != nil { return err @@ -89,34 +107,38 @@ func (c *Client) addOperationGetBucketMetricsConfigurationMiddlewares(stack *mid if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketMetricsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -128,10 +150,19 @@ func (c *Client) addOperationGetBucketMetricsConfigurationMiddlewares(stack *mid if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketMetricsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketMetricsConfigurationValidationMiddleware(stack); err != nil { @@ -143,7 +174,7 @@ func (c *Client) addOperationGetBucketMetricsConfigurationMiddlewares(stack *mid if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketMetricsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -161,12 +192,24 @@ func (c *Client) addOperationGetBucketMetricsConfigurationMiddlewares(stack *mid if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -181,7 +224,6 @@ func newServiceMetadataMiddleware_opGetBucketMetricsConfiguration(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketMetricsConfiguration", } } @@ -211,139 +253,3 @@ func addGetBucketMetricsConfigurationUpdateEndpoint(stack *middleware.Stack, opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketMetricsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketMetricsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketMetricsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketMetricsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketMetricsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketMetricsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketNotificationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketNotificationConfiguration.go index 8d5eeb00..8f744ba3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketNotificationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketNotificationConfiguration.go @@ -4,37 +4,48 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the notification configuration of a bucket. If notifications are not -// enabled on the bucket, the action returns an empty NotificationConfiguration -// element. By default, you must be the bucket owner to read the notification -// configuration of a bucket. However, the bucket owner can use a bucket policy to -// grant permission to other users to read this configuration with the -// s3:GetBucketNotification permission. To use this API operation against an access -// point, provide the alias of the access point in place of the bucket name. To use -// this API operation against an Object Lambda access point, provide the alias of -// the Object Lambda access point in place of the bucket name. If the Object Lambda -// access point alias in a request is not valid, the error code +// This operation is not supported for directory buckets. +// +// Returns the notification configuration of a bucket. +// +// If notifications are not enabled on the bucket, the action returns an empty +// NotificationConfiguration element. +// +// By default, you must be the bucket owner to read the notification configuration +// of a bucket. However, the bucket owner can use a bucket policy to grant +// permission to other users to read this configuration with the +// s3:GetBucketNotification permission. +// +// When you use this API operation with an access point, provide the alias of the +// access point in place of the bucket name. +// +// When you use this API operation with an Object Lambda access point, provide the +// alias of the Object Lambda access point in place of the bucket name. If the +// Object Lambda access point alias in a request is not valid, the error code // InvalidAccessPointAliasError is returned. For more information about -// InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . For more information about setting and reading the notification configuration -// on a bucket, see Setting Up Notification of Bucket Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// . For more information about bucket policies, see Using Bucket Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html) -// . The following action is related to GetBucketNotification : -// - PutBucketNotification (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) +// InvalidAccessPointAliasError , see [List of Error Codes]. +// +// For more information about setting and reading the notification configuration +// on a bucket, see [Setting Up Notification of Bucket Events]. For more information about bucket policies, see [Using Bucket Policies]. +// +// The following action is related to GetBucketNotification : +// +// [PutBucketNotification] +// +// [Using Bucket Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html +// [Setting Up Notification of Bucket Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html +// [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList +// [PutBucketNotification]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html func (c *Client) GetBucketNotificationConfiguration(ctx context.Context, params *GetBucketNotificationConfigurationInput, optFns ...func(*Options)) (*GetBucketNotificationConfigurationOutput, error) { if params == nil { params = &GetBucketNotificationConfigurationInput{} @@ -52,26 +63,36 @@ func (c *Client) GetBucketNotificationConfiguration(ctx context.Context, params type GetBucketNotificationConfigurationInput struct { - // The name of the bucket for which to get the notification configuration. To use - // this API operation against an access point, provide the alias of the access - // point in place of the bucket name. To use this API operation against an Object - // Lambda access point, provide the alias of the Object Lambda access point in - // place of the bucket name. If the Object Lambda access point alias in a request - // is not valid, the error code InvalidAccessPointAliasError is returned. For more - // information about InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . + // The name of the bucket for which to get the notification configuration. + // + // When you use this API operation with an access point, provide the alias of the + // access point in place of the bucket name. + // + // When you use this API operation with an Object Lambda access point, provide the + // alias of the Object Lambda access point in place of the bucket name. If the + // Object Lambda access point alias in a request is not valid, the error code + // InvalidAccessPointAliasError is returned. For more information about + // InvalidAccessPointAliasError , see [List of Error Codes]. + // + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketNotificationConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + // A container for specifying the notification configuration of the bucket. If // this element is empty, notifications are turned off for the bucket. type GetBucketNotificationConfigurationOutput struct { @@ -98,6 +119,9 @@ type GetBucketNotificationConfigurationOutput struct { } func (c *Client) addOperationGetBucketNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketNotificationConfiguration{}, middleware.After) if err != nil { return err @@ -106,34 +130,38 @@ func (c *Client) addOperationGetBucketNotificationConfigurationMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -145,10 +173,19 @@ func (c *Client) addOperationGetBucketNotificationConfigurationMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetBucketNotificationConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketNotificationConfigurationValidationMiddleware(stack); err != nil { @@ -160,7 +197,7 @@ func (c *Client) addOperationGetBucketNotificationConfigurationMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketNotificationConfigurationUpdateEndpoint(stack, options); err != nil { @@ -178,12 +215,24 @@ func (c *Client) addOperationGetBucketNotificationConfigurationMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -198,7 +247,6 @@ func newServiceMetadataMiddleware_opGetBucketNotificationConfiguration(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketNotificationConfiguration", } } @@ -228,139 +276,3 @@ func addGetBucketNotificationConfigurationUpdateEndpoint(stack *middleware.Stack DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketNotificationConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketNotificationConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketNotificationConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketNotificationConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketNotificationConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketNotificationConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketOwnershipControls.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketOwnershipControls.go index 125c3e14..ac69a473 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketOwnershipControls.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketOwnershipControls.go @@ -4,27 +4,32 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you // must have the s3:GetBucketOwnershipControls permission. For more information -// about Amazon S3 permissions, see Specifying permissions in a policy (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html) -// . For information about Amazon S3 Object Ownership, see Using Object Ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// . The following operations are related to GetBucketOwnershipControls : -// - PutBucketOwnershipControls -// - DeleteBucketOwnershipControls +// about Amazon S3 permissions, see [Specifying permissions in a policy]. +// +// For information about Amazon S3 Object Ownership, see [Using Object Ownership]. +// +// The following operations are related to GetBucketOwnershipControls : +// +// # PutBucketOwnershipControls +// +// # DeleteBucketOwnershipControls +// +// [Using Object Ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html +// [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html func (c *Client) GetBucketOwnershipControls(ctx context.Context, params *GetBucketOwnershipControlsInput, optFns ...func(*Options)) (*GetBucketOwnershipControlsOutput, error) { if params == nil { params = &GetBucketOwnershipControlsInput{} @@ -47,14 +52,20 @@ type GetBucketOwnershipControlsInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketOwnershipControlsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketOwnershipControlsOutput struct { // The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or @@ -68,6 +79,9 @@ type GetBucketOwnershipControlsOutput struct { } func (c *Client) addOperationGetBucketOwnershipControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketOwnershipControls{}, middleware.After) if err != nil { return err @@ -76,34 +90,38 @@ func (c *Client) addOperationGetBucketOwnershipControlsMiddlewares(stack *middle if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketOwnershipControls"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -115,10 +133,19 @@ func (c *Client) addOperationGetBucketOwnershipControlsMiddlewares(stack *middle if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketOwnershipControlsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketOwnershipControlsValidationMiddleware(stack); err != nil { @@ -130,7 +157,7 @@ func (c *Client) addOperationGetBucketOwnershipControlsMiddlewares(stack *middle if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketOwnershipControlsUpdateEndpoint(stack, options); err != nil { @@ -148,12 +175,24 @@ func (c *Client) addOperationGetBucketOwnershipControlsMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -168,7 +207,6 @@ func newServiceMetadataMiddleware_opGetBucketOwnershipControls(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketOwnershipControls", } } @@ -198,139 +236,3 @@ func addGetBucketOwnershipControlsUpdateEndpoint(stack *middleware.Stack, option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketOwnershipControlsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketOwnershipControlsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketOwnershipControlsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketOwnershipControlsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketOwnershipControlsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketOwnershipControlsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicy.go index d167fc45..0c0a39e7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicy.go @@ -4,43 +4,72 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the policy of a specified bucket. If you are using an identity other -// than the root user of the Amazon Web Services account that owns the bucket, the -// calling identity must have the GetBucketPolicy permissions on the specified -// bucket and belong to the bucket owner's account in order to use this operation. +// Returns the policy of a specified bucket. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions If you are using an identity other than the root user of the Amazon +// Web Services account that owns the bucket, the calling identity must both have +// the GetBucketPolicy permissions on the specified bucket and belong to the +// bucket owner's account in order to use this operation. +// // If you don't have GetBucketPolicy permissions, Amazon S3 returns a 403 Access // Denied error. If you have the correct permissions, but you're not using an // identity that belongs to the bucket owner's account, Amazon S3 returns a 405 -// Method Not Allowed error. To ensure that bucket owners don't inadvertently lock -// themselves out of their own buckets, the root principal in a bucket owner's -// Amazon Web Services account can perform the GetBucketPolicy , PutBucketPolicy , -// and DeleteBucketPolicy API actions, even if their bucket policy explicitly -// denies the root principal's access. Bucket owner root principals can only be -// blocked from performing these API actions by VPC endpoint policies and Amazon -// Web Services Organizations policies. To use this API operation against an access -// point, provide the alias of the access point in place of the bucket name. To use -// this API operation against an Object Lambda access point, provide the alias of -// the Object Lambda access point in place of the bucket name. If the Object Lambda -// access point alias in a request is not valid, the error code -// InvalidAccessPointAliasError is returned. For more information about -// InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . For more information about bucket policies, see Using Bucket Policies and -// User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html) -// . The following action is related to GetBucketPolicy : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) +// Method Not Allowed error. +// +// To ensure that bucket owners don't inadvertently lock themselves out of their +// own buckets, the root principal in a bucket owner's Amazon Web Services account +// can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API +// actions, even if their bucket policy explicitly denies the root principal's +// access. Bucket owner root principals can only be blocked from performing these +// API actions by VPC endpoint policies and Amazon Web Services Organizations +// policies. +// +// - General purpose bucket permissions - The s3:GetBucketPolicy permission is +// required in a policy. For more information about general purpose buckets bucket +// policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:GetBucketPolicy permission in an IAM identity-based +// policy instead of a bucket policy. Cross-account access to this API operation +// isn't supported. This operation can only be performed by the Amazon Web Services +// account that owns the resource. For more information about directory bucket +// policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] +// in the Amazon S3 User Guide. +// +// Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following action is related to GetBucketPolicy : +// +// [GetObject] +// +// [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) GetBucketPolicy(ctx context.Context, params *GetBucketPolicyInput, optFns ...func(*Options)) (*GetBucketPolicyOutput, error) { if params == nil { params = &GetBucketPolicyInput{} @@ -58,26 +87,53 @@ func (c *Client) GetBucketPolicy(ctx context.Context, params *GetBucketPolicyInp type GetBucketPolicyInput struct { - // The bucket name for which to get the bucket policy. To use this API operation - // against an access point, provide the alias of the access point in place of the - // bucket name. To use this API operation against an Object Lambda access point, - // provide the alias of the Object Lambda access point in place of the bucket name. - // If the Object Lambda access point alias in a request is not valid, the error - // code InvalidAccessPointAliasError is returned. For more information about - // InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . + // The bucket name to get the bucket policy for. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // Access points - When you use this API operation with an access point, provide + // the alias of the access point in place of the bucket name. + // + // Object Lambda access points - When you use this API operation with an Object + // Lambda access point, provide the alias of the Object Lambda access point in + // place of the bucket name. If the Object Lambda access point alias in a request + // is not valid, the error code InvalidAccessPointAliasError is returned. For more + // information about InvalidAccessPointAliasError , see [List of Error Codes]. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketPolicyInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketPolicyOutput struct { // The bucket policy as a JSON document. @@ -90,6 +146,9 @@ type GetBucketPolicyOutput struct { } func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketPolicy{}, middleware.After) if err != nil { return err @@ -98,34 +157,38 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -137,10 +200,19 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addGetBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketPolicyValidationMiddleware(stack); err != nil { @@ -152,7 +224,7 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketPolicyUpdateEndpoint(stack, options); err != nil { @@ -170,12 +242,24 @@ func (c *Client) addOperationGetBucketPolicyMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -190,7 +274,6 @@ func newServiceMetadataMiddleware_opGetBucketPolicy(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketPolicy", } } @@ -220,139 +303,3 @@ func addGetBucketPolicyUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketPolicyResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketPolicyResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketPolicyResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicyStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicyStatus.go index 8229d4f4..a5cac1be 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicyStatus.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketPolicyStatus.go @@ -4,31 +4,41 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Retrieves the policy status for an Amazon S3 bucket, indicating whether the // bucket is public. In order to use this operation, you must have the // s3:GetBucketPolicyStatus permission. For more information about Amazon S3 -// permissions, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// . For more information about when Amazon S3 considers a bucket public, see The -// Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// . The following operations are related to GetBucketPolicyStatus : -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) +// permissions, see [Specifying Permissions in a Policy]. +// +// For more information about when Amazon S3 considers a bucket public, see [The Meaning of "Public"]. +// +// The following operations are related to GetBucketPolicyStatus : +// +// [Using Amazon S3 Block Public Access] +// +// [GetPublicAccessBlock] +// +// [PutPublicAccessBlock] +// +// [DeletePublicAccessBlock] +// +// [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html +// [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html +// [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html +// [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status func (c *Client) GetBucketPolicyStatus(ctx context.Context, params *GetBucketPolicyStatusInput, optFns ...func(*Options)) (*GetBucketPolicyStatusOutput, error) { if params == nil { params = &GetBucketPolicyStatusInput{} @@ -51,14 +61,20 @@ type GetBucketPolicyStatusInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketPolicyStatusInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketPolicyStatusOutput struct { // The policy status for the specified bucket. @@ -71,6 +87,9 @@ type GetBucketPolicyStatusOutput struct { } func (c *Client) addOperationGetBucketPolicyStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketPolicyStatus{}, middleware.After) if err != nil { return err @@ -79,34 +98,38 @@ func (c *Client) addOperationGetBucketPolicyStatusMiddlewares(stack *middleware. if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketPolicyStatus"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -118,10 +141,19 @@ func (c *Client) addOperationGetBucketPolicyStatusMiddlewares(stack *middleware. if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketPolicyStatusResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketPolicyStatusValidationMiddleware(stack); err != nil { @@ -133,7 +165,7 @@ func (c *Client) addOperationGetBucketPolicyStatusMiddlewares(stack *middleware. if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketPolicyStatusUpdateEndpoint(stack, options); err != nil { @@ -151,12 +183,24 @@ func (c *Client) addOperationGetBucketPolicyStatusMiddlewares(stack *middleware. if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -171,7 +215,6 @@ func newServiceMetadataMiddleware_opGetBucketPolicyStatus(region string) *awsmid return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketPolicyStatus", } } @@ -201,139 +244,3 @@ func addGetBucketPolicyStatusUpdateEndpoint(stack *middleware.Stack, options Opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketPolicyStatusResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketPolicyStatusResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketPolicyStatusResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketPolicyStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketPolicyStatusResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketPolicyStatusResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketReplication.go index 5cf7567a..fac6ec2d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketReplication.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketReplication.go @@ -4,34 +4,47 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the replication configuration of a bucket. It can take a while to -// propagate the put or delete a replication configuration to all Amazon S3 -// systems. Therefore, a get request soon after put or delete can return a wrong -// result. For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. This action requires permissions for the -// s3:GetReplicationConfiguration action. For more information about permissions, -// see Using Bucket Policies and User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html) -// . If you include the Filter element in a replication configuration, you must -// also include the DeleteMarkerReplication and Priority elements. The response -// also returns those elements. For information about GetBucketReplication errors, -// see List of replication-related error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) +// This operation is not supported for directory buckets. +// +// Returns the replication configuration of a bucket. +// +// It can take a while to propagate the put or delete a replication configuration +// to all Amazon S3 systems. Therefore, a get request soon after put or delete can +// return a wrong result. +// +// For information about replication configuration, see [Replication] in the Amazon S3 User +// Guide. +// +// This action requires permissions for the s3:GetReplicationConfiguration action. +// For more information about permissions, see [Using Bucket Policies and User Policies]. +// +// If you include the Filter element in a replication configuration, you must also +// include the DeleteMarkerReplication and Priority elements. The response also +// returns those elements. +// +// For information about GetBucketReplication errors, see [List of replication-related error codes] +// // The following operations are related to GetBucketReplication : -// - PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) -// - DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) +// +// [PutBucketReplication] +// +// [DeleteBucketReplication] +// +// [PutBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html +// [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html +// [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html +// [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList +// [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html func (c *Client) GetBucketReplication(ctx context.Context, params *GetBucketReplicationInput, optFns ...func(*Options)) (*GetBucketReplicationOutput, error) { if params == nil { params = &GetBucketReplicationInput{} @@ -54,14 +67,20 @@ type GetBucketReplicationInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketReplicationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketReplicationOutput struct { // A container for replication rules. You can add up to 1,000 rules. The maximum @@ -75,6 +94,9 @@ type GetBucketReplicationOutput struct { } func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketReplication{}, middleware.After) if err != nil { return err @@ -83,34 +105,38 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -122,10 +148,19 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketReplicationValidationMiddleware(stack); err != nil { @@ -137,7 +172,7 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketReplicationUpdateEndpoint(stack, options); err != nil { @@ -155,12 +190,24 @@ func (c *Client) addOperationGetBucketReplicationMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -175,7 +222,6 @@ func newServiceMetadataMiddleware_opGetBucketReplication(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketReplication", } } @@ -205,139 +251,3 @@ func addGetBucketReplicationUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketReplicationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketReplicationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketReplicationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketReplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketReplicationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketRequestPayment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketRequestPayment.go index 14a9883c..3398dfc5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketRequestPayment.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketRequestPayment.go @@ -4,25 +4,27 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the request payment configuration of a bucket. To use this version of -// the operation, you must be the bucket owner. For more information, see -// Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) -// . The following operations are related to GetBucketRequestPayment : -// - ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) +// the operation, you must be the bucket owner. For more information, see [Requester Pays Buckets]. +// +// The following operations are related to GetBucketRequestPayment : +// +// [ListObjects] +// +// [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html +// [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html func (c *Client) GetBucketRequestPayment(ctx context.Context, params *GetBucketRequestPaymentInput, optFns ...func(*Options)) (*GetBucketRequestPaymentOutput, error) { if params == nil { params = &GetBucketRequestPaymentInput{} @@ -45,14 +47,20 @@ type GetBucketRequestPaymentInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketRequestPaymentInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketRequestPaymentOutput struct { // Specifies who pays for the download and request fees. @@ -65,6 +73,9 @@ type GetBucketRequestPaymentOutput struct { } func (c *Client) addOperationGetBucketRequestPaymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketRequestPayment{}, middleware.After) if err != nil { return err @@ -73,34 +84,38 @@ func (c *Client) addOperationGetBucketRequestPaymentMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketRequestPayment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -112,10 +127,19 @@ func (c *Client) addOperationGetBucketRequestPaymentMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketRequestPaymentResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketRequestPaymentValidationMiddleware(stack); err != nil { @@ -127,7 +151,7 @@ func (c *Client) addOperationGetBucketRequestPaymentMiddlewares(stack *middlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketRequestPaymentUpdateEndpoint(stack, options); err != nil { @@ -145,12 +169,24 @@ func (c *Client) addOperationGetBucketRequestPaymentMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -165,7 +201,6 @@ func newServiceMetadataMiddleware_opGetBucketRequestPayment(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketRequestPayment", } } @@ -195,139 +230,3 @@ func addGetBucketRequestPaymentUpdateEndpoint(stack *middleware.Stack, options O DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketRequestPaymentResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketRequestPaymentResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketRequestPaymentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketRequestPaymentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketRequestPaymentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketRequestPaymentResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketTagging.go index a2cd2bb6..6ff16896 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketTagging.go @@ -4,30 +4,38 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the tag set associated with the bucket. To use this operation, you must -// have permission to perform the s3:GetBucketTagging action. By default, the -// bucket owner has this permission and can grant this permission to others. +// This operation is not supported for directory buckets. +// +// Returns the tag set associated with the bucket. +// +// To use this operation, you must have permission to perform the +// s3:GetBucketTagging action. By default, the bucket owner has this permission and +// can grant this permission to others. +// // GetBucketTagging has the following special error: +// // - Error code: NoSuchTagSet +// // - Description: There is no tag set associated with the bucket. // // The following operations are related to GetBucketTagging : -// - PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) -// - DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) +// +// [PutBucketTagging] +// +// [DeleteBucketTagging] +// +// [PutBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html +// [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html func (c *Client) GetBucketTagging(ctx context.Context, params *GetBucketTaggingInput, optFns ...func(*Options)) (*GetBucketTaggingOutput, error) { if params == nil { params = &GetBucketTaggingInput{} @@ -50,14 +58,20 @@ type GetBucketTaggingInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketTaggingOutput struct { // Contains the tag set. @@ -72,6 +86,9 @@ type GetBucketTaggingOutput struct { } func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketTagging{}, middleware.After) if err != nil { return err @@ -80,34 +97,38 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -119,10 +140,19 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addGetBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketTaggingValidationMiddleware(stack); err != nil { @@ -134,7 +164,7 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketTaggingUpdateEndpoint(stack, options); err != nil { @@ -152,12 +182,24 @@ func (c *Client) addOperationGetBucketTaggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -172,7 +214,6 @@ func newServiceMetadataMiddleware_opGetBucketTagging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketTagging", } } @@ -202,139 +243,3 @@ func addGetBucketTaggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketVersioning.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketVersioning.go index 3153eaa7..919cf688 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketVersioning.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketVersioning.go @@ -4,28 +4,37 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the versioning state of a bucket. To retrieve the versioning state of a -// bucket, you must be the bucket owner. This implementation also returns the MFA -// Delete status of the versioning state. If the MFA Delete status is enabled , the -// bucket owner must use an authentication device to change the versioning state of -// the bucket. The following operations are related to GetBucketVersioning : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) +// This operation is not supported for directory buckets. +// +// Returns the versioning state of a bucket. +// +// To retrieve the versioning state of a bucket, you must be the bucket owner. +// +// This implementation also returns the MFA Delete status of the versioning state. +// If the MFA Delete status is enabled , the bucket owner must use an +// authentication device to change the versioning state of the bucket. +// +// The following operations are related to GetBucketVersioning : +// +// [GetObject] +// +// [PutObject] +// +// [DeleteObject] +// +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html func (c *Client) GetBucketVersioning(ctx context.Context, params *GetBucketVersioningInput, optFns ...func(*Options)) (*GetBucketVersioningOutput, error) { if params == nil { params = &GetBucketVersioningInput{} @@ -48,14 +57,20 @@ type GetBucketVersioningInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketVersioningInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketVersioningOutput struct { // Specifies whether MFA delete is enabled in the bucket versioning configuration. @@ -73,6 +88,9 @@ type GetBucketVersioningOutput struct { } func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketVersioning{}, middleware.After) if err != nil { return err @@ -81,34 +99,38 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketVersioning"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -120,10 +142,19 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketVersioningResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketVersioningValidationMiddleware(stack); err != nil { @@ -135,7 +166,7 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketVersioningUpdateEndpoint(stack, options); err != nil { @@ -153,12 +184,24 @@ func (c *Client) addOperationGetBucketVersioningMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -173,7 +216,6 @@ func newServiceMetadataMiddleware_opGetBucketVersioning(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketVersioning", } } @@ -203,139 +245,3 @@ func addGetBucketVersioningUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketVersioningResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketVersioningResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketVersioningInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketVersioningResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketVersioningResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketWebsite.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketWebsite.go index c28296a6..3758b878 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketWebsite.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketWebsite.go @@ -4,30 +4,36 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the website configuration for a bucket. To host website on Amazon S3, // you can configure a bucket as website by adding a website configuration. For -// more information about hosting websites, see Hosting Websites on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) -// . This GET action requires the S3:GetBucketWebsite permission. By default, only +// more information about hosting websites, see [Hosting Websites on Amazon S3]. +// +// This GET action requires the S3:GetBucketWebsite permission. By default, only // the bucket owner can read the bucket website configuration. However, bucket // owners can allow other users to read the website configuration by writing a -// bucket policy granting them the S3:GetBucketWebsite permission. The following -// operations are related to GetBucketWebsite : -// - DeleteBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) -// - PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) +// bucket policy granting them the S3:GetBucketWebsite permission. +// +// The following operations are related to GetBucketWebsite : +// +// [DeleteBucketWebsite] +// +// [PutBucketWebsite] +// +// [PutBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html +// [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html +// [DeleteBucketWebsite]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html func (c *Client) GetBucketWebsite(ctx context.Context, params *GetBucketWebsiteInput, optFns ...func(*Options)) (*GetBucketWebsiteOutput, error) { if params == nil { params = &GetBucketWebsiteInput{} @@ -50,14 +56,20 @@ type GetBucketWebsiteInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetBucketWebsiteInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetBucketWebsiteOutput struct { // The object key name of the website error document to use for 4XX class errors. @@ -80,6 +92,9 @@ type GetBucketWebsiteOutput struct { } func (c *Client) addOperationGetBucketWebsiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetBucketWebsite{}, middleware.After) if err != nil { return err @@ -88,34 +103,38 @@ func (c *Client) addOperationGetBucketWebsiteMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetBucketWebsite"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -127,10 +146,19 @@ func (c *Client) addOperationGetBucketWebsiteMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetBucketWebsiteResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetBucketWebsiteValidationMiddleware(stack); err != nil { @@ -142,7 +170,7 @@ func (c *Client) addOperationGetBucketWebsiteMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetBucketWebsiteUpdateEndpoint(stack, options); err != nil { @@ -160,12 +188,24 @@ func (c *Client) addOperationGetBucketWebsiteMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -180,7 +220,6 @@ func newServiceMetadataMiddleware_opGetBucketWebsite(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetBucketWebsite", } } @@ -210,139 +249,3 @@ func addGetBucketWebsiteUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetBucketWebsiteResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetBucketWebsiteResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetBucketWebsiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetBucketWebsiteResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetBucketWebsiteResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go index e84be49a..3b1f59cc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go @@ -4,114 +4,165 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "time" ) -// Retrieves objects from Amazon S3. To use GET , you must have READ access to the -// object. If you grant READ access to the anonymous user, you can return the -// object without using an authorization header. An Amazon S3 bucket has no -// directory hierarchy such as you would find in a typical computer file system. -// You can, however, create a logical hierarchy by using object key names that -// imply a folder structure. For example, instead of naming an object sample.jpg , -// you can name it photos/2006/February/sample.jpg . To get an object from such a -// logical hierarchy, specify the full key name for the object in the GET -// operation. For a virtual hosted-style request example, if you have the object -// photos/2006/February/sample.jpg , specify the resource as -// /photos/2006/February/sample.jpg . For a path-style request example, if you have -// the object photos/2006/February/sample.jpg in the bucket named examplebucket , -// specify the resource as /examplebucket/photos/2006/February/sample.jpg . For -// more information about request types, see HTTP Host Header Bucket Specification (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket) -// . For more information about returning the ACL of an object, see GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) -// . If the object you are retrieving is stored in the S3 Glacier Flexible -// Retrieval or S3 Glacier Deep Archive storage class, or S3 Intelligent-Tiering -// Archive or S3 Intelligent-Tiering Deep Archive tiers, before you can retrieve -// the object you must first restore a copy using RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) -// . Otherwise, this action returns an InvalidObjectState error. For information -// about restoring archived objects, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) -// . Encryption request headers, like x-amz-server-side-encryption , should not be -// sent for GET requests if your object uses server-side encryption with Key -// Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with -// Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon -// S3 managed encryption keys (SSE-S3). If your object does use these types of -// keys, you’ll get an HTTP 400 Bad Request error. If you encrypt an object by -// using server-side encryption with customer-provided encryption keys (SSE-C) when -// you store the object in Amazon S3, then when you GET the object, you must use -// the following headers: -// - x-amz-server-side-encryption-customer-algorithm -// - x-amz-server-side-encryption-customer-key -// - x-amz-server-side-encryption-customer-key-MD5 -// -// For more information about SSE-C, see Server-Side Encryption (Using -// Customer-Provided Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// . Assuming you have the relevant permission to read object tags, the response -// also returns the x-amz-tagging-count header that provides the count of number -// of tags associated with the object. You can use GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// to retrieve the tag set associated with an object. Permissions You need the -// relevant read object (or version) permission for this operation. For more -// information, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// . If the object that you request doesn’t exist, the error that Amazon S3 returns -// depends on whether you also have the s3:ListBucket permission. If you have the -// s3:ListBucket permission on the bucket, Amazon S3 returns an HTTP status code -// 404 (Not Found) error. If you don’t have the s3:ListBucket permission, Amazon -// S3 returns an HTTP status code 403 ("access denied") error. Versioning By -// default, the GET action returns the current version of an object. To return a -// different version, use the versionId subresource. -// - If you supply a versionId , you need the s3:GetObjectVersion permission to -// access a specific version of an object. If you request a specific version, you -// do not need to have the s3:GetObject permission. If you request the current -// version without a specific version ID, only s3:GetObject permission is -// required. s3:GetObjectVersion permission won't be required. -// - If the current version of the object is a delete marker, Amazon S3 behaves -// as if the object was deleted and includes x-amz-delete-marker: true in the -// response. -// -// For more information about versioning, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) -// . Overriding Response Header Values There are times when you want to override -// certain response header values in a GET response. For example, you might -// override the Content-Disposition response header value in your GET request. You -// can override values for a set of response headers using the following query -// parameters. These response header values are sent only on a successful request, -// that is, when status code 200 OK is returned. The set of headers you can -// override using these parameters is a subset of the headers that Amazon S3 -// accepts when you create an object. The response headers that you can override -// for the GET response are Content-Type , Content-Language , Expires , -// Cache-Control , Content-Disposition , and Content-Encoding . To override these -// header values in the GET response, you use the following request parameters. -// You must sign the request, either using an Authorization header or a presigned -// URL, when using these parameters. They cannot be used with an unsigned -// (anonymous) request. -// - response-content-type -// - response-content-language -// - response-expires +// Retrieves an object from Amazon S3. +// +// In the GetObject request, specify the full key name for the object. +// +// General purpose buckets - Both the virtual-hosted-style requests and the +// path-style requests are supported. For a virtual hosted-style request example, +// if you have the object photos/2006/February/sample.jpg , specify the object key +// name as /photos/2006/February/sample.jpg . For a path-style request example, if +// you have the object photos/2006/February/sample.jpg in the bucket named +// examplebucket , specify the object key name as +// /examplebucket/photos/2006/February/sample.jpg . For more information about +// request types, see [HTTP Host Header Bucket Specification]in the Amazon S3 User Guide. +// +// Directory buckets - Only virtual-hosted-style requests are supported. For a +// virtual hosted-style request example, if you have the object +// photos/2006/February/sample.jpg in the bucket named +// examplebucket--use1-az5--x-s3 , specify the object key name as +// /photos/2006/February/sample.jpg . Also, when you make requests to this API +// operation, your requests are sent to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// - General purpose bucket permissions - You must have the required permissions +// in a policy. To use GetObject , you must have the READ access to the object +// (or version). If you grant READ access to the anonymous user, the GetObject +// operation returns the object without using an authorization header. For more +// information, see [Specifying permissions in a policy]in the Amazon S3 User Guide. +// +// If you include a versionId in your request header, you must have the +// +// s3:GetObjectVersion permission to access a specific version of an object. The +// s3:GetObject permission is not required in this scenario. +// +// If you request the current version of an object without a specific versionId in +// +// the request header, only the s3:GetObject permission is required. The +// s3:GetObjectVersion permission is not required in this scenario. +// +// If the object that you request doesn’t exist, the error that Amazon S3 returns +// +// depends on whether you also have the s3:ListBucket permission. +// +// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an +// HTTP status code 404 Not Found error. +// +// - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP +// status code 403 Access Denied error. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If the object is encrypted using SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// Storage classes If the object you are retrieving is stored in the S3 Glacier +// Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the +// S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep +// Archive Access tier, before you can retrieve the object you must first restore a +// copy using [RestoreObject]. Otherwise, this operation returns an InvalidObjectState error. For +// information about restoring archived objects, see [Restoring Archived Objects]in the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, only the S3 Express One Zone storage +// class is supported to store newly created objects. Unsupported storage class +// values won't write a destination object and will respond with the HTTP status +// code 400 Bad Request . +// +// Encryption Encryption request headers, like x-amz-server-side-encryption , +// should not be sent for the GetObject requests, if your object uses server-side +// encryption with Amazon S3 managed encryption keys (SSE-S3), server-side +// encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer +// server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you +// include the header in your GetObject requests for the object that uses these +// types of keys, you’ll get an HTTP 400 Bad Request error. +// +// Directory buckets - For directory buckets, there are only two supported options +// for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more +// information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. +// +// Overriding response header values through the request There are times when you +// want to override certain response header values of a GetObject response. For +// example, you might override the Content-Disposition response header value +// through your GetObject request. +// +// You can override values for a set of response headers. These modified response +// header values are included only in a successful response, that is, when the HTTP +// status code 200 OK is returned. The headers you can override using the +// following query parameters in the request are a subset of the headers that +// Amazon S3 accepts when you create an object. +// +// The response headers that you can override for the GetObject response are +// Cache-Control , Content-Disposition , Content-Encoding , Content-Language , +// Content-Type , and Expires . +// +// To override values for a set of response headers in the GetObject response, you +// can use the following query parameters in the request. +// // - response-cache-control +// // - response-content-disposition +// // - response-content-encoding // -// Overriding Response Header Values If both of the If-Match and -// If-Unmodified-Since headers are present in the request as follows: If-Match -// condition evaluates to true , and; If-Unmodified-Since condition evaluates to -// false ; then, S3 returns 200 OK and the data requested. If both of the -// If-None-Match and If-Modified-Since headers are present in the request as -// follows: If-None-Match condition evaluates to false , and; If-Modified-Since -// condition evaluates to true ; then, S3 returns 304 Not Modified response code. -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232) -// . The following operations are related to GetObject : -// - ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) +// - response-content-language +// +// - response-content-type +// +// - response-expires +// +// When you use these parameters, you must sign the request by using either an +// Authorization header or a presigned URL. These parameters cannot be used with an +// unsigned (anonymous) request. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to GetObject : +// +// [ListBuckets] +// +// [GetObjectAcl] +// +// [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html +// [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html +// [HTTP Host Header Bucket Specification]: https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket +// [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html +// [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html +// [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html func (c *Client) GetObject(ctx context.Context, params *GetObjectInput, optFns ...func(*Options)) (*GetObjectOutput, error) { if params == nil { params = &GetObjectInput{} @@ -129,23 +180,45 @@ func (c *Client) GetObject(ctx context.Context, params *GetObjectInput, optFns . type GetObjectInput struct { - // The bucket name containing the object. When using this action with an access - // point, you must direct requests to the access point hostname. The access point - // hostname takes the form + // The bucket name containing the object. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When using an Object Lambda access point the - // hostname takes the form - // AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com. When you use - // this action with Amazon S3 on Outposts, you must direct requests to the S3 on - // Outposts hostname. The S3 on Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Object Lambda access points - When you use this action with an Object Lambda + // access point, you must direct requests to the Object Lambda access point + // hostname. The Object Lambda access point hostname takes the form + // AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -156,53 +229,101 @@ type GetObjectInput struct { Key *string // To retrieve the checksum, this mode must be enabled. + // + // General purpose buckets - In addition, if you enable checksum mode and the + // object is uploaded with a [checksum]and encrypted with an Key Management Service (KMS) + // key, you must have permission to use the kms:Decrypt action to retrieve the + // checksum. + // + // [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html ChecksumMode types.ChecksumMode - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Return the object only if its entity tag (ETag) is the same as the one - // specified; otherwise, return a 412 (precondition failed) error. + // specified in this header; otherwise, return a 412 Precondition Failed error. + // + // If both of the If-Match and If-Unmodified-Since headers are present in the + // request as follows: If-Match condition evaluates to true , and; + // If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and + // the data requested. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfMatch *string // Return the object only if it has been modified since the specified time; - // otherwise, return a 304 (not modified) error. + // otherwise, return a 304 Not Modified error. + // + // If both of the If-None-Match and If-Modified-Since headers are present in the + // request as follows: If-None-Match condition evaluates to false , and; + // If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not + // Modified status code. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfModifiedSince *time.Time // Return the object only if its entity tag (ETag) is different from the one - // specified; otherwise, return a 304 (not modified) error. + // specified in this header; otherwise, return a 304 Not Modified error. + // + // If both of the If-None-Match and If-Modified-Since headers are present in the + // request as follows: If-None-Match condition evaluates to false , and; + // If-Modified-Since condition evaluates to true ; then, S3 returns 304 Not + // Modified HTTP status code. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfNoneMatch *string // Return the object only if it has not been modified since the specified time; - // otherwise, return a 412 (precondition failed) error. + // otherwise, return a 412 Precondition Failed error. + // + // If both of the If-Match and If-Unmodified-Since headers are present in the + // request as follows: If-Match condition evaluates to true , and; + // If-Unmodified-Since condition evaluates to false ; then, S3 returns 200 OK and + // the data requested. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfUnmodifiedSince *time.Time // Part number of the object being read. This is a positive integer between 1 and // 10,000. Effectively performs a 'ranged' GET request for the part specified. // Useful for downloading just a part of an object. - PartNumber int32 + PartNumber *int32 - // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, see - // https://www.rfc-editor.org/rfc/rfc9110.html#name-range (https://www.rfc-editor.org/rfc/rfc9110.html#name-range) - // . Amazon S3 doesn't support retrieving multiple ranges of data per GET request. + // Downloads the specified byte range of an object. For more information about the + // HTTP Range header, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]. + // + // Amazon S3 doesn't support retrieving multiple ranges of data per GET request. + // + // [https://www.rfc-editor.org/rfc/rfc9110.html#name-range]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range Range *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // Sets the Cache-Control header of the response. ResponseCacheControl *string - // Sets the Content-Disposition header of the response + // Sets the Content-Disposition header of the response. ResponseContentDisposition *string // Sets the Content-Encoding header of the response. @@ -217,31 +338,105 @@ type GetObjectInput struct { // Sets the Expires header of the response. ResponseExpires *time.Time - // Specifies the algorithm to use to when decrypting the object (for example, - // AES256). + // Specifies the algorithm to use when decrypting the object (for example, AES256 ). + // + // If you encrypt an object by using server-side encryption with customer-provided + // encryption keys (SSE-C) when you store the object in Amazon S3, then when you + // GET the object, you must use the following headers: + // + // - x-amz-server-side-encryption-customer-algorithm + // + // - x-amz-server-side-encryption-customer-key + // + // - x-amz-server-side-encryption-customer-key-MD5 + // + // For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerAlgorithm *string - // Specifies the customer-provided encryption key for Amazon S3 used to encrypt - // the data. This value is used to decrypt the object when recovering it and must - // match the one used when storing the data. The key must be appropriate for use - // with the algorithm specified in the + // Specifies the customer-provided encryption key that you originally provided for + // Amazon S3 to encrypt the data before storing it. This value is used to decrypt + // the object when recovering it and must match the one used when storing the data. + // The key must be appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // If you encrypt an object by using server-side encryption with customer-provided + // encryption keys (SSE-C) when you store the object in Amazon S3, then when you + // GET the object, you must use the following headers: + // + // - x-amz-server-side-encryption-customer-algorithm + // + // - x-amz-server-side-encryption-customer-key + // + // - x-amz-server-side-encryption-customer-key-MD5 + // + // For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKey *string - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. + // Specifies the 128-bit MD5 digest of the customer-provided encryption key + // according to RFC 1321. Amazon S3 uses this header for a message integrity check + // to ensure that the encryption key was transmitted without error. + // + // If you encrypt an object by using server-side encryption with customer-provided + // encryption keys (SSE-C) when you store the object in Amazon S3, then when you + // GET the object, you must use the following headers: + // + // - x-amz-server-side-encryption-customer-algorithm + // + // - x-amz-server-side-encryption-customer-key + // + // - x-amz-server-side-encryption-customer-key-MD5 + // + // For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKeyMD5 *string - // VersionId used to reference a specific version of the object. + // Version ID used to reference a specific version of the object. + // + // By default, the GetObject operation returns the current version of an object. + // To return a different version, use the versionId subresource. + // + // - If you include a versionId in your request header, you must have the + // s3:GetObjectVersion permission to access a specific version of an object. The + // s3:GetObject permission is not required in this scenario. + // + // - If you request the current version of an object without a specific versionId + // in the request header, only the s3:GetObject permission is required. The + // s3:GetObjectVersion permission is not required in this scenario. + // + // - Directory buckets - S3 Versioning isn't enabled and supported for directory + // buckets. For this API operation, only the null value of the version ID is + // supported by directory buckets. You can only specify null to the versionId + // query parameter in the request. + // + // For more information about versioning, see [PutBucketVersioning]. + // + // [PutBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html VersionId *string noSmithyDocumentSerde } +func (in *GetObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type GetObjectOutput struct { - // Indicates that a range of bytes was specified. + // Indicates that a range of bytes was specified in the request. AcceptRanges *string // Object data. @@ -249,43 +444,43 @@ type GetObjectOutput struct { // Indicates whether the object uses an S3 Bucket Key for server-side encryption // with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // Specifies caching behavior along the request/reply chain. CacheControl *string - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string // Specifies presentational information for the object. ContentDisposition *string - // Specifies what content encodings have been applied to the object and thus what + // Indicates what content encodings have been applied to the object and thus what // decoding mechanisms must be applied to obtain the media-type referenced by the // Content-Type header field. ContentEncoding *string @@ -294,7 +489,7 @@ type GetObjectOutput struct { ContentLanguage *string // Size of the body in bytes. - ContentLength int64 + ContentLength *int64 // The portion of the object returned in the response. ContentRange *string @@ -302,24 +497,51 @@ type GetObjectOutput struct { // A standard MIME type describing the format of the object data. ContentType *string - // Specifies whether the object retrieved was (true) or was not (false) a Delete + // Indicates whether the object retrieved was (true) or was not (false) a Delete // Marker. If false, this response header does not appear in the response. - DeleteMarker bool + // + // - If the current version of the object is a delete marker, Amazon S3 behaves + // as if the object was deleted and includes x-amz-delete-marker: true in the + // response. + // + // - If the specified version in the request is a delete marker, the response + // returns a 405 Method Not Allowed error and the Last-Modified: timestamp + // response header. + DeleteMarker *bool // An entity tag (ETag) is an opaque identifier assigned by a web server to a // specific version of a resource found at a URL. ETag *string - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key-value pairs - // providing object expiration information. The value of the rule-id is - // URL-encoded. + // If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), + // the response includes this header. It includes the expiry-date and rule-id + // key-value pairs providing object expiration information. The value of the + // rule-id is URL-encoded. + // + // Object expiration information is not returned in directory buckets and this + // header returns the value " NotImplemented " in all responses for directory + // buckets. + // + // [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html Expiration *string // The date and time at which the object is no longer cacheable. + // + // Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using + // the ExpiresString field which contains the unparsed value from the service + // response. Expires *time.Time - // Creation date of the object. + // The unparsed value of the Expires field from the service response. Prefer use + // of this value over the normal Expires response field where possible. + ExpiresString *string + + // Date and time when the object was last modified. + // + // General purpose buckets - When you specify a versionId of the object in your + // request, if the specified version in the request is a delete marker, the + // response returns a 405 Method Not Allowed error and the Last-Modified: timestamp + // response header. LastModified *time.Time // A map of metadata to store with the object in S3. @@ -327,69 +549,102 @@ type GetObjectOutput struct { // Map keys will be normalized to lower-case. Metadata map[string]string - // This is set to the number of metadata entries not returned in x-amz-meta - // headers. This can happen if you create metadata using an API like SOAP that - // supports more flexible metadata than the REST API. For example, using SOAP, you - // can create metadata whose values are not legal HTTP headers. - MissingMeta int32 + // This is set to the number of metadata entries not returned in the headers that + // are prefixed with x-amz-meta- . This can happen if you create metadata using an + // API like SOAP that supports more flexible metadata than the REST API. For + // example, using SOAP, you can create metadata whose values are not legal HTTP + // headers. + // + // This functionality is not supported for directory buckets. + MissingMeta *int32 // Indicates whether this object has an active legal hold. This field is only // returned if you have permission to view an object's legal hold status. + // + // This functionality is not supported for directory buckets. ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus - // The Object Lock mode currently in place for this object. + // The Object Lock mode that's currently in place for this object. + // + // This functionality is not supported for directory buckets. ObjectLockMode types.ObjectLockMode // The date and time when this object's Object Lock will expire. + // + // This functionality is not supported for directory buckets. ObjectLockRetainUntilDate *time.Time // The count of parts this object has. This value is only returned if you specify // partNumber in your request and the object was uploaded as a multipart upload. - PartsCount int32 + PartsCount *int32 // Amazon S3 can return this if your request involves a bucket that is either a // source or destination in a replication rule. + // + // This functionality is not supported for directory buckets. ReplicationStatus types.ReplicationStatus // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Provides information about object restoration action and expiration time of the // restored object copy. + // + // This functionality is not supported for directory buckets. Only the S3 Express + // One Zone storage class is supported by directory buckets to store objects. Restore *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3. ServerSideEncryption types.ServerSideEncryption // Provides storage class information of the object. Amazon S3 returns this header // for all objects except for S3 Standard storage class objects. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. StorageClass types.StorageClass - // The number of tags, if any, on the object. - TagCount int32 + // The number of tags, if any, on the object, when you have the relevant + // permission to read object tags. + // + // You can use [GetObjectTagging] to retrieve the tag set associated with an object. + // + // This functionality is not supported for directory buckets. + // + // [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html + TagCount *int32 - // Version of the object. + // Version ID of the object. + // + // This functionality is not supported for directory buckets. VersionId *string // If the bucket is configured as a website, redirects requests for this object to // another object in the same bucket or to an external URL. Amazon S3 stores the // value of this header in the object metadata. + // + // This functionality is not supported for directory buckets. WebsiteRedirectLocation *string // Metadata pertaining to the operation's result. @@ -399,6 +654,9 @@ type GetObjectOutput struct { } func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObject{}, middleware.After) if err != nil { return err @@ -407,34 +665,38 @@ func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -443,10 +705,19 @@ func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addGetObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectValidationMiddleware(stack); err != nil { @@ -458,7 +729,7 @@ func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, optio if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectOutputChecksumMiddlewares(stack, options); err != nil { @@ -479,12 +750,24 @@ func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -499,7 +782,6 @@ func newServiceMetadataMiddleware_opGetObject(region string) *awsmiddleware.Regi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObject", } } @@ -579,139 +861,3 @@ func addGetObjectPayloadAsUnsigned(stack *middleware.Stack, options Options) err v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opGetObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAcl.go index b6ea63ea..fde39a96 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAcl.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAcl.go @@ -4,37 +4,48 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the access control list (ACL) of an object. To use this operation, you // must have s3:GetObjectAcl permissions or READ_ACP access to the object. For -// more information, see Mapping of ACL permissions and access policy permissions (https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping) -// in the Amazon S3 User Guide This action is not supported by Amazon S3 on -// Outposts. By default, GET returns ACL information about the current version of -// an object. To return ACL information about a different version, use the -// versionId subresource. If your bucket uses the bucket owner enforced setting for -// S3 Object Ownership, requests to read ACLs are still supported and return the +// more information, see [Mapping of ACL permissions and access policy permissions]in the Amazon S3 User Guide +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// By default, GET returns ACL information about the current version of an object. +// To return ACL information about a different version, use the versionId +// subresource. +// +// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, +// requests to read ACLs are still supported and return the // bucket-owner-full-control ACL with the owner being the account that created the -// bucket. For more information, see Controlling object ownership and disabling -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. The following operations are related to -// GetObjectAcl : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) +// bucket. For more information, see [Controlling object ownership and disabling ACLs]in the Amazon S3 User Guide. +// +// The following operations are related to GetObjectAcl : +// +// [GetObject] +// +// [GetObjectAttributes] +// +// [DeleteObject] +// +// [PutObject] +// +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [Mapping of ACL permissions and access policy permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Controlling object ownership and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html func (c *Client) GetObjectAcl(ctx context.Context, params *GetObjectAclInput, optFns ...func(*Options)) (*GetObjectAclOutput, error) { if params == nil { params = &GetObjectAclInput{} @@ -53,13 +64,17 @@ func (c *Client) GetObjectAcl(ctx context.Context, params *GetObjectAclInput, op type GetObjectAclInput struct { // The bucket name that contains the object for which to get the ACL information. - // When using this action with an access point, you must direct requests to the + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -69,36 +84,50 @@ type GetObjectAclInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // VersionId used to reference a specific version of the object. + // Version ID used to reference a specific version of the object. + // + // This functionality is not supported for directory buckets. VersionId *string noSmithyDocumentSerde } +func (in *GetObjectAclInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type GetObjectAclOutput struct { // A list of grants. Grants []types.Grant - // Container for the bucket owner's display name and ID. + // Container for the bucket owner's display name and ID. Owner *types.Owner // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -108,6 +137,9 @@ type GetObjectAclOutput struct { } func (c *Client) addOperationGetObjectAclMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectAcl{}, middleware.After) if err != nil { return err @@ -116,34 +148,38 @@ func (c *Client) addOperationGetObjectAclMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectAcl"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -155,10 +191,19 @@ func (c *Client) addOperationGetObjectAclMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetObjectAclResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectAclValidationMiddleware(stack); err != nil { @@ -170,7 +215,7 @@ func (c *Client) addOperationGetObjectAclMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectAclUpdateEndpoint(stack, options); err != nil { @@ -188,12 +233,24 @@ func (c *Client) addOperationGetObjectAclMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -208,7 +265,6 @@ func newServiceMetadataMiddleware_opGetObjectAcl(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectAcl", } } @@ -238,139 +294,3 @@ func addGetObjectAclUpdateEndpoint(stack *middleware.Stack, options Options) err DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectAclResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectAclResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectAclResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectAclResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectAclResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAttributes.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAttributes.go index 06b1ac2d..ee210cc9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAttributes.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectAttributes.go @@ -4,81 +4,165 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Retrieves all the metadata from an object without returning the object itself. -// This action is useful if you're interested only in an object's metadata. To use -// GetObjectAttributes , you must have READ access to the object. +// This operation is useful if you're interested only in an object's metadata. +// // GetObjectAttributes combines the functionality of HeadObject and ListParts . All // of the data returned with each of those individual calls can be returned with a -// single call to GetObjectAttributes . If you encrypt an object by using -// server-side encryption with customer-provided encryption keys (SSE-C) when you -// store the object in Amazon S3, then when you retrieve the metadata from the -// object, you must use the following headers: +// single call to GetObjectAttributes . +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - To use GetObjectAttributes , you must +// have READ access to the object. The permissions that you need to use this +// operation depend on whether the bucket is versioned. If the bucket is versioned, +// you need both the s3:GetObjectVersion and s3:GetObjectVersionAttributes +// permissions for this operation. If the bucket is not versioned, you need the +// s3:GetObject and s3:GetObjectAttributes permissions. For more information, see [Specifying Permissions in a Policy] +// in the Amazon S3 User Guide. If the object that you request does not exist, the +// error Amazon S3 returns depends on whether you also have the s3:ListBucket +// permission. +// +// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an +// HTTP status code 404 Not Found ("no such key") error. +// +// - If you don't have the s3:ListBucket permission, Amazon S3 returns an HTTP +// status code 403 Forbidden ("access denied") error. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// Encryption Encryption request headers, like x-amz-server-side-encryption , +// should not be sent for HEAD requests if your object uses server-side encryption +// with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side +// encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side +// encryption with Amazon S3 managed encryption keys (SSE-S3). The +// x-amz-server-side-encryption header is used when you PUT an object to S3 and +// want to specify the encryption method. If you include this header in a GET +// request for an object that uses these types of keys, you’ll get an HTTP 400 Bad +// Request error. It's because the encryption method can't be changed when you +// retrieve the object. +// +// If you encrypt an object by using server-side encryption with customer-provided +// encryption keys (SSE-C) when you store the object in Amazon S3, then when you +// retrieve the metadata from the object, you must use the following headers to +// provide the encryption key for the server to be able to retrieve the object's +// metadata. The headers are: +// // - x-amz-server-side-encryption-customer-algorithm +// // - x-amz-server-side-encryption-customer-key +// // - x-amz-server-side-encryption-customer-key-MD5 // -// For more information about SSE-C, see Server-Side Encryption (Using -// Customer-Provided Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// in the Amazon S3 User Guide. -// - Encryption request headers, such as x-amz-server-side-encryption , should -// not be sent for GET requests if your object uses server-side encryption with -// Amazon Web Services KMS keys stored in Amazon Web Services Key Management -// Service (SSE-KMS) or server-side encryption with Amazon S3 managed keys -// (SSE-S3). If your object does use these types of keys, you'll get an HTTP 400 -// Bad Request error. -// - The last modified property in this case is the creation date of the object. -// -// Consider the following when using request headers: +// For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. +// +// Directory bucket permissions - For directory buckets, there are only two +// supported options for server-side encryption: server-side encryption with Amazon +// S3 managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys +// (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses +// the desired encryption configuration and you don't override the bucket default +// encryption in your CreateSession requests or PUT object requests. Then, new +// objects are automatically encrypted with the desired encryption settings. For +// more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about +// the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. +// +// Versioning Directory buckets - S3 Versioning isn't enabled and supported for +// directory buckets. For this API operation, only the null value of the version +// ID is supported by directory buckets. You can only specify null to the versionId +// query parameter in the request. +// +// Conditional request headers Consider the following when using request headers: +// // - If both of the If-Match and If-Unmodified-Since headers are present in the // request as follows, then Amazon S3 returns the HTTP status code 200 OK and the // data requested: +// // - If-Match condition evaluates to true . +// // - If-Unmodified-Since condition evaluates to false . +// +// For more information about conditional requests, see [RFC 7232]. +// // - If both of the If-None-Match and If-Modified-Since headers are present in // the request as follows, then Amazon S3 returns the HTTP status code 304 Not // Modified : +// // - If-None-Match condition evaluates to false . +// // - If-Modified-Since condition evaluates to true . // -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232) -// . Permissions The permissions that you need to use this operation depend on -// whether the bucket is versioned. If the bucket is versioned, you need both the -// s3:GetObjectVersion and s3:GetObjectVersionAttributes permissions for this -// operation. If the bucket is not versioned, you need the s3:GetObject and -// s3:GetObjectAttributes permissions. For more information, see Specifying -// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// in the Amazon S3 User Guide. If the object that you request does not exist, the -// error Amazon S3 returns depends on whether you also have the s3:ListBucket -// permission. -// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an -// HTTP status code 404 Not Found ("no such key") error. -// - If you don't have the s3:ListBucket permission, Amazon S3 returns an HTTP -// status code 403 Forbidden ("access denied") error. +// For more information about conditional requests, see [RFC 7232]. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . // // The following actions are related to GetObjectAttributes : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) -// - GetObjectLegalHold (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html) -// - GetObjectLockConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html) -// - GetObjectRetention (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html) -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// - HeadObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) +// +// [GetObject] +// +// [GetObjectAcl] +// +// [GetObjectLegalHold] +// +// [GetObjectLockConfiguration] +// +// [GetObjectRetention] +// +// [GetObjectTagging] +// +// [HeadObject] +// +// [ListParts] +// +// [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html +// [GetObjectLegalHold]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// [RFC 7232]: https://tools.ietf.org/html/rfc7232 +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [HeadObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html +// [GetObjectLockConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html +// [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html +// [GetObjectRetention]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html func (c *Client) GetObjectAttributes(ctx context.Context, params *GetObjectAttributesInput, optFns ...func(*Options)) (*GetObjectAttributesOutput, error) { if params == nil { params = &GetObjectAttributesInput{} @@ -96,21 +180,40 @@ func (c *Client) GetObjectAttributes(ctx context.Context, params *GetObjectAttri type GetObjectAttributesInput struct { - // The name of the bucket that contains the object. When using this action with an - // access point, you must direct requests to the access point hostname. The access - // point hostname takes the form + // The name of the bucket that contains the object. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -126,13 +229,13 @@ type GetObjectAttributesInput struct { // This member is required. ObjectAttributes []types.ObjectAttributes - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Sets the maximum number of parts to return. - MaxParts int32 + MaxParts *int32 // Specifies the part after which listing should begin. Only parts with higher // part numbers will be listed. @@ -140,14 +243,19 @@ type GetObjectAttributesInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // Specifies the algorithm to use when encrypting the object (for example, AES256). + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -155,19 +263,34 @@ type GetObjectAttributesInput struct { // discarded; Amazon S3 does not store the encryption key. The key must be // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // This functionality is not supported for directory buckets. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string // The version ID used to reference a specific version of the object. + // + // S3 Versioning isn't enabled and supported for directory buckets. For this API + // operation, only the null value of the version ID is supported by directory + // buckets. You can only specify null to the versionId query parameter in the + // request. VersionId *string noSmithyDocumentSerde } +func (in *GetObjectAttributesInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectAttributesOutput struct { // The checksum or digest of the object. @@ -175,32 +298,43 @@ type GetObjectAttributesOutput struct { // Specifies whether the object retrieved was ( true ) or was not ( false ) a // delete marker. If false , this response header does not appear in the response. - DeleteMarker bool + // + // This functionality is not supported for directory buckets. + DeleteMarker *bool // An ETag is an opaque identifier assigned by a web server to a specific version // of a resource found at a URL. ETag *string - // The creation date of the object. + // Date and time when the object was last modified. LastModified *time.Time // A collection of parts associated with a multipart upload. ObjectParts *types.GetObjectAttributesParts // The size of the object in bytes. - ObjectSize int64 + ObjectSize *int64 // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Provides the storage class information of the object. Amazon S3 returns this - // header for all objects except for S3 Standard storage class objects. For more - // information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // . + // header for all objects except for S3 Standard storage class objects. + // + // For more information, see [Storage Classes]. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html StorageClass types.StorageClass // The version ID of the object. + // + // This functionality is not supported for directory buckets. VersionId *string // Metadata pertaining to the operation's result. @@ -210,6 +344,9 @@ type GetObjectAttributesOutput struct { } func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectAttributes{}, middleware.After) if err != nil { return err @@ -218,34 +355,38 @@ func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectAttributes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -257,10 +398,19 @@ func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addGetObjectAttributesResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectAttributesValidationMiddleware(stack); err != nil { @@ -272,7 +422,7 @@ func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectAttributesUpdateEndpoint(stack, options); err != nil { @@ -290,12 +440,24 @@ func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -310,7 +472,6 @@ func newServiceMetadataMiddleware_opGetObjectAttributes(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectAttributes", } } @@ -340,139 +501,3 @@ func addGetObjectAttributesUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectAttributesResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectAttributesResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectAttributesResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectAttributesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectAttributesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectAttributesResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLegalHold.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLegalHold.go index c4344169..f341d2ad 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLegalHold.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLegalHold.go @@ -4,25 +4,27 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets an object's current legal hold status. For more information, see Locking -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) . -// This action is not supported by Amazon S3 on Outposts. The following action is -// related to GetObjectLegalHold : -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) +// This operation is not supported for directory buckets. +// +// Gets an object's current legal hold status. For more information, see [Locking Objects]. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// The following action is related to GetObjectLegalHold : +// +// [GetObjectAttributes] +// +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) GetObjectLegalHold(ctx context.Context, params *GetObjectLegalHoldInput, optFns ...func(*Options)) (*GetObjectLegalHoldOutput, error) { if params == nil { params = &GetObjectLegalHoldInput{} @@ -41,13 +43,18 @@ func (c *Client) GetObjectLegalHold(ctx context.Context, params *GetObjectLegalH type GetObjectLegalHoldInput struct { // The bucket name containing the object whose legal hold status you want to - // retrieve. When using this action with an access point, you must direct requests - // to the access point hostname. The access point hostname takes the form + // retrieve. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -57,18 +64,21 @@ type GetObjectLegalHoldInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The version ID of the object whose legal hold status you want to retrieve. @@ -77,6 +87,12 @@ type GetObjectLegalHoldInput struct { noSmithyDocumentSerde } +func (in *GetObjectLegalHoldInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectLegalHoldOutput struct { // The current legal hold status for the specified object. @@ -89,6 +105,9 @@ type GetObjectLegalHoldOutput struct { } func (c *Client) addOperationGetObjectLegalHoldMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectLegalHold{}, middleware.After) if err != nil { return err @@ -97,34 +116,38 @@ func (c *Client) addOperationGetObjectLegalHoldMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectLegalHold"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -136,10 +159,19 @@ func (c *Client) addOperationGetObjectLegalHoldMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addGetObjectLegalHoldResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectLegalHoldValidationMiddleware(stack); err != nil { @@ -151,7 +183,7 @@ func (c *Client) addOperationGetObjectLegalHoldMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectLegalHoldUpdateEndpoint(stack, options); err != nil { @@ -169,12 +201,24 @@ func (c *Client) addOperationGetObjectLegalHoldMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -189,7 +233,6 @@ func newServiceMetadataMiddleware_opGetObjectLegalHold(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectLegalHold", } } @@ -219,139 +262,3 @@ func addGetObjectLegalHoldUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectLegalHoldResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectLegalHoldResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectLegalHoldResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectLegalHoldInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectLegalHoldResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectLegalHoldResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLockConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLockConfiguration.go index eb142dad..7b34287c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLockConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectLockConfiguration.go @@ -4,25 +4,27 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Gets the Object Lock configuration for a bucket. The rule specified in the // Object Lock configuration will be applied by default to every new object placed -// in the specified bucket. For more information, see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// . The following action is related to GetObjectLockConfiguration : -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) +// in the specified bucket. For more information, see [Locking Objects]. +// +// The following action is related to GetObjectLockConfiguration : +// +// [GetObjectAttributes] +// +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) GetObjectLockConfiguration(ctx context.Context, params *GetObjectLockConfigurationInput, optFns ...func(*Options)) (*GetObjectLockConfigurationOutput, error) { if params == nil { params = &GetObjectLockConfigurationInput{} @@ -40,26 +42,36 @@ func (c *Client) GetObjectLockConfiguration(ctx context.Context, params *GetObje type GetObjectLockConfigurationInput struct { - // The bucket whose Object Lock configuration you want to retrieve. When using - // this action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form + // The bucket whose Object Lock configuration you want to retrieve. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetObjectLockConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectLockConfigurationOutput struct { // The specified bucket's Object Lock configuration. @@ -72,6 +84,9 @@ type GetObjectLockConfigurationOutput struct { } func (c *Client) addOperationGetObjectLockConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectLockConfiguration{}, middleware.After) if err != nil { return err @@ -80,34 +95,38 @@ func (c *Client) addOperationGetObjectLockConfigurationMiddlewares(stack *middle if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectLockConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -119,10 +138,19 @@ func (c *Client) addOperationGetObjectLockConfigurationMiddlewares(stack *middle if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addGetObjectLockConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectLockConfigurationValidationMiddleware(stack); err != nil { @@ -134,7 +162,7 @@ func (c *Client) addOperationGetObjectLockConfigurationMiddlewares(stack *middle if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectLockConfigurationUpdateEndpoint(stack, options); err != nil { @@ -152,12 +180,24 @@ func (c *Client) addOperationGetObjectLockConfigurationMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -172,7 +212,6 @@ func newServiceMetadataMiddleware_opGetObjectLockConfiguration(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectLockConfiguration", } } @@ -202,139 +241,3 @@ func addGetObjectLockConfigurationUpdateEndpoint(stack *middleware.Stack, option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectLockConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectLockConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectLockConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectLockConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectLockConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectLockConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectRetention.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectRetention.go index 278d1352..7a72820e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectRetention.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectRetention.go @@ -4,25 +4,27 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves an object's retention settings. For more information, see Locking -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) . -// This action is not supported by Amazon S3 on Outposts. The following action is -// related to GetObjectRetention : -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) +// This operation is not supported for directory buckets. +// +// Retrieves an object's retention settings. For more information, see [Locking Objects]. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// The following action is related to GetObjectRetention : +// +// [GetObjectAttributes] +// +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) GetObjectRetention(ctx context.Context, params *GetObjectRetentionInput, optFns ...func(*Options)) (*GetObjectRetentionOutput, error) { if params == nil { params = &GetObjectRetentionInput{} @@ -41,13 +43,18 @@ func (c *Client) GetObjectRetention(ctx context.Context, params *GetObjectRetent type GetObjectRetentionInput struct { // The bucket name containing the object whose retention settings you want to - // retrieve. When using this action with an access point, you must direct requests - // to the access point hostname. The access point hostname takes the form + // retrieve. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -57,18 +64,21 @@ type GetObjectRetentionInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The version ID for the object whose retention settings you want to retrieve. @@ -77,6 +87,12 @@ type GetObjectRetentionInput struct { noSmithyDocumentSerde } +func (in *GetObjectRetentionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectRetentionOutput struct { // The container element for an object's retention settings. @@ -89,6 +105,9 @@ type GetObjectRetentionOutput struct { } func (c *Client) addOperationGetObjectRetentionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectRetention{}, middleware.After) if err != nil { return err @@ -97,34 +116,38 @@ func (c *Client) addOperationGetObjectRetentionMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectRetention"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -136,10 +159,19 @@ func (c *Client) addOperationGetObjectRetentionMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addGetObjectRetentionResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectRetentionValidationMiddleware(stack); err != nil { @@ -151,7 +183,7 @@ func (c *Client) addOperationGetObjectRetentionMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectRetentionUpdateEndpoint(stack, options); err != nil { @@ -169,12 +201,24 @@ func (c *Client) addOperationGetObjectRetentionMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -189,7 +233,6 @@ func newServiceMetadataMiddleware_opGetObjectRetention(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectRetention", } } @@ -219,139 +262,3 @@ func addGetObjectRetentionUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectRetentionResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectRetentionResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectRetentionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectRetentionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectRetentionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectRetentionResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go index 14ebf1c4..805d16c2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go @@ -4,33 +4,44 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns the tag-set of an object. You send the GET request against the tagging -// subresource associated with the object. To use this operation, you must have -// permission to perform the s3:GetObjectTagging action. By default, the GET -// action returns information about current version of an object. For a versioned -// bucket, you can have multiple versions of an object in your bucket. To retrieve -// tags of any other version, use the versionId query parameter. You also need -// permission for the s3:GetObjectVersionTagging action. By default, the bucket -// owner has this permission and can grant this permission to others. For -// information about the Amazon S3 object tagging feature, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html) -// . The following actions are related to GetObjectTagging : -// - DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// - PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) +// subresource associated with the object. +// +// To use this operation, you must have permission to perform the +// s3:GetObjectTagging action. By default, the GET action returns information about +// current version of an object. For a versioned bucket, you can have multiple +// versions of an object in your bucket. To retrieve tags of any other version, use +// the versionId query parameter. You also need permission for the +// s3:GetObjectVersionTagging action. +// +// By default, the bucket owner has this permission and can grant this permission +// to others. +// +// For information about the Amazon S3 object tagging feature, see [Object Tagging]. +// +// The following actions are related to GetObjectTagging : +// +// [DeleteObjectTagging] +// +// [GetObjectAttributes] +// +// [PutObjectTagging] +// +// [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html +// [PutObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html func (c *Client) GetObjectTagging(ctx context.Context, params *GetObjectTaggingInput, optFns ...func(*Options)) (*GetObjectTaggingOutput, error) { if params == nil { params = &GetObjectTaggingInput{} @@ -49,20 +60,26 @@ func (c *Client) GetObjectTagging(ctx context.Context, params *GetObjectTaggingI type GetObjectTaggingInput struct { // The bucket name containing the object for which to get the tagging information. - // When using this action with an access point, you must direct requests to the + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -72,18 +89,21 @@ type GetObjectTaggingInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The versionId of the object for which to get the tagging information. @@ -92,6 +112,12 @@ type GetObjectTaggingInput struct { noSmithyDocumentSerde } +func (in *GetObjectTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectTaggingOutput struct { // Contains the tag set. @@ -109,6 +135,9 @@ type GetObjectTaggingOutput struct { } func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectTagging{}, middleware.After) if err != nil { return err @@ -117,34 +146,38 @@ func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -156,10 +189,19 @@ func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addGetObjectTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectTaggingValidationMiddleware(stack); err != nil { @@ -171,7 +213,7 @@ func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectTaggingUpdateEndpoint(stack, options); err != nil { @@ -189,12 +231,24 @@ func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -209,7 +263,6 @@ func newServiceMetadataMiddleware_opGetObjectTagging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectTagging", } } @@ -239,139 +292,3 @@ func addGetObjectTaggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTorrent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTorrent.go index dd06c1bd..dc314d66 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTorrent.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTorrent.go @@ -4,28 +4,34 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io" ) +// This operation is not supported for directory buckets. +// // Returns torrent files from a bucket. BitTorrent can save you bandwidth when -// you're distributing large files. You can get torrent only for objects that are -// less than 5 GB in size, and that are not encrypted using server-side encryption -// with a customer-provided encryption key. To use GET, you must have READ access -// to the object. This action is not supported by Amazon S3 on Outposts. The -// following action is related to GetObjectTorrent : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) +// you're distributing large files. +// +// You can get torrent only for objects that are less than 5 GB in size, and that +// are not encrypted using server-side encryption with a customer-provided +// encryption key. +// +// To use GET, you must have READ access to the object. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// The following action is related to GetObjectTorrent : +// +// [GetObject] +// +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html func (c *Client) GetObjectTorrent(ctx context.Context, params *GetObjectTorrentInput, optFns ...func(*Options)) (*GetObjectTorrentOutput, error) { if params == nil { params = &GetObjectTorrentInput{} @@ -53,23 +59,32 @@ type GetObjectTorrentInput struct { // This member is required. Key *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer noSmithyDocumentSerde } +func (in *GetObjectTorrentInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type GetObjectTorrentOutput struct { // A Bencoded dictionary as defined by the BitTorrent specification @@ -77,6 +92,8 @@ type GetObjectTorrentOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -86,6 +103,9 @@ type GetObjectTorrentOutput struct { } func (c *Client) addOperationGetObjectTorrentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectTorrent{}, middleware.After) if err != nil { return err @@ -94,34 +114,38 @@ func (c *Client) addOperationGetObjectTorrentMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetObjectTorrent"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -130,10 +154,19 @@ func (c *Client) addOperationGetObjectTorrentMiddlewares(stack *middleware.Stack if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetObjectTorrentResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetObjectTorrentValidationMiddleware(stack); err != nil { @@ -145,7 +178,7 @@ func (c *Client) addOperationGetObjectTorrentMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetObjectTorrentUpdateEndpoint(stack, options); err != nil { @@ -163,12 +196,24 @@ func (c *Client) addOperationGetObjectTorrentMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -183,7 +228,6 @@ func newServiceMetadataMiddleware_opGetObjectTorrent(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetObjectTorrent", } } @@ -213,139 +257,3 @@ func addGetObjectTorrentUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetObjectTorrentResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetObjectTorrentResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetObjectTorrentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetObjectTorrentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetObjectTorrentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetObjectTorrentResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetPublicAccessBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetPublicAccessBlock.go index cd09834c..bd760d74 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetPublicAccessBlock.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetPublicAccessBlock.go @@ -4,36 +4,48 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To use // this operation, you must have the s3:GetBucketPublicAccessBlock permission. For -// more information about Amazon S3 permissions, see Specifying Permissions in a -// Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// . When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or -// an object, it checks the PublicAccessBlock configuration for both the bucket -// (or the bucket that contains the object) and the bucket owner's account. If the +// more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. +// +// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an +// object, it checks the PublicAccessBlock configuration for both the bucket (or +// the bucket that contains the object) and the bucket owner's account. If the // PublicAccessBlock settings are different between the bucket and the account, // Amazon S3 uses the most restrictive combination of the bucket-level and -// account-level settings. For more information about when Amazon S3 considers a -// bucket or an object public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// . The following operations are related to GetPublicAccessBlock : -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) +// account-level settings. +// +// For more information about when Amazon S3 considers a bucket or an object +// public, see [The Meaning of "Public"]. +// +// The following operations are related to GetPublicAccessBlock : +// +// [Using Amazon S3 Block Public Access] +// +// [PutPublicAccessBlock] +// +// [GetPublicAccessBlock] +// +// [DeletePublicAccessBlock] +// +// [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html +// [PutPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html +// [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html +// [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status func (c *Client) GetPublicAccessBlock(ctx context.Context, params *GetPublicAccessBlockInput, optFns ...func(*Options)) (*GetPublicAccessBlockOutput, error) { if params == nil { params = &GetPublicAccessBlockInput{} @@ -57,14 +69,20 @@ type GetPublicAccessBlockInput struct { // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *GetPublicAccessBlockInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type GetPublicAccessBlockOutput struct { // The PublicAccessBlock configuration currently in effect for this Amazon S3 @@ -78,6 +96,9 @@ type GetPublicAccessBlockOutput struct { } func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpGetPublicAccessBlock{}, middleware.After) if err != nil { return err @@ -86,34 +107,38 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPublicAccessBlock"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -125,10 +150,19 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addGetPublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpGetPublicAccessBlockValidationMiddleware(stack); err != nil { @@ -140,7 +174,7 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addGetPublicAccessBlockUpdateEndpoint(stack, options); err != nil { @@ -158,12 +192,24 @@ func (c *Client) addOperationGetPublicAccessBlockMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -178,7 +224,6 @@ func newServiceMetadataMiddleware_opGetPublicAccessBlock(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "GetPublicAccessBlock", } } @@ -208,139 +253,3 @@ func addGetPublicAccessBlockUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opGetPublicAccessBlockResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opGetPublicAccessBlockResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opGetPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*GetPublicAccessBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addGetPublicAccessBlockResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opGetPublicAccessBlockResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go index a6521822..e98b80c4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go @@ -6,14 +6,10 @@ import ( "context" "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -21,30 +17,61 @@ import ( "time" ) -// This action is useful to determine if a bucket exists and you have permission -// to access it. The action returns a 200 OK if the bucket exists and you have -// permission to access it. If the bucket does not exist or you do not have -// permission to access it, the HEAD request returns a generic 400 Bad Request , -// 403 Forbidden or 404 Not Found code. A message body is not included, so you -// cannot determine the exception beyond these error codes. To use this operation, -// you must have permissions to perform the s3:ListBucket action. The bucket owner -// has this permission by default and can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . To use this API operation against an access point, you must provide the alias -// of the access point in place of the bucket name or specify the access point ARN. -// When using the access point ARN, you must direct requests to the access point -// hostname. The access point hostname takes the form -// AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using the -// Amazon Web Services SDKs, you provide the ARN in place of the bucket name. For -// more information, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) -// . To use this API operation against an Object Lambda access point, provide the -// alias of the Object Lambda access point in place of the bucket name. If the -// Object Lambda access point alias in a request is not valid, the error code -// InvalidAccessPointAliasError is returned. For more information about -// InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) -// . +// You can use this operation to determine if a bucket exists and if you have +// permission to access it. The action returns a 200 OK if the bucket exists and +// you have permission to access it. +// +// If the bucket does not exist or you do not have permission to access it, the +// HEAD request returns a generic 400 Bad Request , 403 Forbidden or 404 Not Found +// code. A message body is not included, so you cannot determine the exception +// beyond these HTTP response codes. +// +// Authentication and authorization General purpose buckets - Request to public +// buckets that grant the s3:ListBucket permission publicly do not need to be +// signed. All other HeadBucket requests must be authenticated and signed by using +// IAM credentials (access key ID and secret access key for the IAM identities). +// All headers with the x-amz- prefix, including x-amz-copy-source , must be +// signed. For more information, see [REST Authentication]. +// +// Directory buckets - You must use IAM credentials to authenticate and authorize +// your access to the HeadBucket API operation, instead of using the temporary +// security credentials through the CreateSession API operation. +// +// Amazon Web Services CLI or SDKs handles authentication and authorization on +// your behalf. +// +// Permissions +// +// - General purpose bucket permissions - To use this operation, you must have +// permissions to perform the s3:ListBucket action. The bucket owner has this +// permission by default and can grant this permission to others. For more +// information about permissions, see [Managing access permissions to your Amazon S3 resources]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - You must have the s3express:CreateSession +// permission in the Action element of a policy. By default, the session is in +// the ReadWrite mode. If you want to restrict the access, you can explicitly set +// the s3express:SessionMode condition key to ReadOnly on the bucket. +// +// For more information about example bucket policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 +// +// User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// You must make requests for this API operation to the Zonal endpoint. These +// endpoints support virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style +// requests are not supported. For more information about endpoints in Availability +// Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about endpoints in +// Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html +// [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [Managing access permissions to your Amazon S3 resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html func (c *Client) HeadBucket(ctx context.Context, params *HeadBucketInput, optFns ...func(*Options)) (*HeadBucketOutput, error) { if params == nil { params = &HeadBucketInput{} @@ -62,37 +89,89 @@ func (c *Client) HeadBucket(ctx context.Context, params *HeadBucketInput, optFns type HeadBucketInput struct { - // The bucket name. When using this action with an access point, you must direct - // requests to the access point hostname. The access point hostname takes the form + // The bucket name. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with an Object Lambda - // access point, provide the alias of the Object Lambda access point in place of - // the bucket name. If the Object Lambda access point alias in a request is not - // valid, the error code InvalidAccessPointAliasError is returned. For more - // information about InvalidAccessPointAliasError , see List of Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList) - // . When you use this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Object Lambda access points - When you use this API operation with an Object + // Lambda access point, provide the alias of the Object Lambda access point in + // place of the bucket name. If the Object Lambda access point alias in a request + // is not valid, the error code InvalidAccessPointAliasError is returned. For more + // information about InvalidAccessPointAliasError , see [List of Error Codes]. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + // [List of Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList // // This member is required. Bucket *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *HeadBucketInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type HeadBucketOutput struct { + + // Indicates whether the bucket name used in the request is an access point alias. + // + // For directory buckets, the value of this field is false . + AccessPointAlias *bool + + // The name of the location where the bucket will be created. + // + // For directory buckets, the Zone ID of the Availability Zone or the Local Zone + // where the bucket is created. An example Zone ID value for an Availability Zone + // is usw2-az1 . + // + // This functionality is only supported by directory buckets. + BucketLocationName *string + + // The type of location where the bucket is created. + // + // This functionality is only supported by directory buckets. + BucketLocationType types.LocationType + + // The Region that the bucket is located. + BucketRegion *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -100,6 +179,9 @@ type HeadBucketOutput struct { } func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpHeadBucket{}, middleware.After) if err != nil { return err @@ -108,34 +190,38 @@ func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "HeadBucket"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -147,10 +233,19 @@ func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addHeadBucketResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpHeadBucketValidationMiddleware(stack); err != nil { @@ -162,7 +257,7 @@ func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, opti if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addHeadBucketUpdateEndpoint(stack, options); err != nil { @@ -180,37 +275,44 @@ func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } - return nil -} - -func (v *HeadBucketInput) bucket() (string, bool) { - if v.Bucket == nil { - return "", false + if err = addSpanInitializeStart(stack); err != nil { + return err } - return *v.Bucket, true -} - -// HeadBucketAPIClient is a client that implements the HeadBucket operation. -type HeadBucketAPIClient interface { - HeadBucket(context.Context, *HeadBucketInput, ...func(*Options)) (*HeadBucketOutput, error) + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil } -var _ HeadBucketAPIClient = (*Client)(nil) - // BucketExistsWaiterOptions are waiter options for BucketExistsWaiter type BucketExistsWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + // MinDelay is the minimum amount of time to delay between retries. If unset, // BucketExistsWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. @@ -226,12 +328,13 @@ type BucketExistsWaiterOptions struct { // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. By - // default service-modeled logic will populate this option. This option can thus be - // used to define a custom waiter state with fall-back to service-modeled waiter - // state mutators.The function returns an error in case of a failure state. In case - // of retry state, this function returns a bool value of true and nil error, while - // in case of success it returns a bool value of false and nil error. + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *HeadBucketInput, *HeadBucketOutput, error) (bool, error) } @@ -307,7 +410,16 @@ func (w *BucketExistsWaiter) WaitForOutput(ctx context.Context, params *HeadBuck } out, err := w.client.HeadBucket(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -362,8 +474,17 @@ type BucketNotExistsWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + // MinDelay is the minimum amount of time to delay between retries. If unset, // BucketNotExistsWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. @@ -379,12 +500,13 @@ type BucketNotExistsWaiterOptions struct { // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. By - // default service-modeled logic will populate this option. This option can thus be - // used to define a custom waiter state with fall-back to service-modeled waiter - // state mutators.The function returns an error in case of a failure state. In case - // of retry state, this function returns a bool value of true and nil error, while - // in case of success it returns a bool value of false and nil error. + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *HeadBucketInput, *HeadBucketOutput, error) (bool, error) } @@ -461,7 +583,16 @@ func (w *BucketNotExistsWaiter) WaitForOutput(ctx context.Context, params *HeadB } out, err := w.client.HeadBucket(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -506,11 +637,24 @@ func bucketNotExistsStateRetryable(ctx context.Context, input *HeadBucketInput, return true, nil } +func (v *HeadBucketInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +// HeadBucketAPIClient is a client that implements the HeadBucket operation. +type HeadBucketAPIClient interface { + HeadBucket(context.Context, *HeadBucketInput, ...func(*Options)) (*HeadBucketOutput, error) +} + +var _ HeadBucketAPIClient = (*Client)(nil) + func newServiceMetadataMiddleware_opHeadBucket(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "HeadBucket", } } @@ -571,139 +715,3 @@ func addHeadBucketPayloadAsUnsigned(stack *middleware.Stack, options Options) er v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opHeadBucketResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opHeadBucketResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opHeadBucketResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*HeadBucketInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addHeadBucketResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opHeadBucketResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go index a121acb1..fe72ac6b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go @@ -6,14 +6,10 @@ import ( "context" "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -21,60 +17,127 @@ import ( "time" ) -// The HEAD action retrieves metadata from an object without returning the object -// itself. This action is useful if you're only interested in an object's metadata. -// To use HEAD , you must have READ access to the object. A HEAD request has the -// same options as a GET action on an object. The response is identical to the GET -// response except that there is no response body. Because of this, if the HEAD -// request generates an error, it returns a generic 400 Bad Request , 403 Forbidden -// or 404 Not Found code. It is not possible to retrieve the exact exception -// beyond these error codes. If you encrypt an object by using server-side -// encryption with customer-provided encryption keys (SSE-C) when you store the -// object in Amazon S3, then when you retrieve the metadata from the object, you -// must use the following headers: +// The HEAD operation retrieves metadata from an object without returning the +// object itself. This operation is useful if you're interested only in an object's +// metadata. +// +// A HEAD request has the same options as a GET operation on an object. The +// response is identical to the GET response except that there is no response +// body. Because of this, if the HEAD request generates an error, it returns a +// generic code, such as 400 Bad Request , 403 Forbidden , 404 Not Found , 405 +// Method Not Allowed , 412 Precondition Failed , or 304 Not Modified . It's not +// possible to retrieve the exact exception of these error codes. +// +// Request headers are limited to 8 KB in size. For more information, see [Common Request Headers]. +// +// Permissions +// +// - General purpose bucket permissions - To use HEAD , you must have the +// s3:GetObject permission. You need the relevant read object (or version) +// permission for this operation. For more information, see [Actions, resources, and condition keys for Amazon S3]in the Amazon S3 +// User Guide. For more information about the permissions to S3 API operations by +// S3 resource types, see Required permissions for Amazon S3 API operationsin the Amazon S3 User Guide. +// +// If the object you request doesn't exist, the error that Amazon S3 returns +// +// depends on whether you also have the s3:ListBucket permission. +// +// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an +// HTTP status code 404 Not Found error. +// +// - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP +// status code 403 Forbidden error. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If you enable x-amz-checksum-mode in the request and the object is encrypted +// +// with Amazon Web Services Key Management Service (Amazon Web Services KMS), you +// must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM +// identity-based policies and KMS key policies for the KMS key to retrieve the +// checksum of the object. +// +// Encryption Encryption request headers, like x-amz-server-side-encryption , +// should not be sent for HEAD requests if your object uses server-side encryption +// with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side +// encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side +// encryption with Amazon S3 managed encryption keys (SSE-S3). The +// x-amz-server-side-encryption header is used when you PUT an object to S3 and +// want to specify the encryption method. If you include this header in a HEAD +// request for an object that uses these types of keys, you’ll get an HTTP 400 Bad +// Request error. It's because the encryption method can't be changed when you +// retrieve the object. +// +// If you encrypt an object by using server-side encryption with customer-provided +// encryption keys (SSE-C) when you store the object in Amazon S3, then when you +// retrieve the metadata from the object, you must use the following headers to +// provide the encryption key for the server to be able to retrieve the object's +// metadata. The headers are: +// // - x-amz-server-side-encryption-customer-algorithm +// // - x-amz-server-side-encryption-customer-key +// // - x-amz-server-side-encryption-customer-key-MD5 // -// For more information about SSE-C, see Server-Side Encryption (Using -// Customer-Provided Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// . -// - Encryption request headers, like x-amz-server-side-encryption , should not -// be sent for GET requests if your object uses server-side encryption with Key -// Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with -// Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon -// S3 managed encryption keys (SSE-S3). If your object does use these types of -// keys, you’ll get an HTTP 400 Bad Request error. -// - The last modified property in this case is the creation date of the object. +// For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)] in the Amazon S3 User Guide. // -// Request headers are limited to 8 KB in size. For more information, see Common -// Request Headers (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html) -// . Consider the following when using request headers: -// - Consideration 1 – If both of the If-Match and If-Unmodified-Since headers -// are present in the request as follows: -// - If-Match condition evaluates to true , and; -// - If-Unmodified-Since condition evaluates to false ; Then Amazon S3 returns -// 200 OK and the data requested. -// - Consideration 2 – If both of the If-None-Match and If-Modified-Since headers -// are present in the request as follows: -// - If-None-Match condition evaluates to false , and; -// - If-Modified-Since condition evaluates to true ; Then Amazon S3 returns the -// 304 Not Modified response code. +// Directory bucket - For directory buckets, there are only two supported options +// for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more +// information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. // -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232) -// . Permissions You need the relevant read object (or version) permission for this -// operation. For more information, see Actions, resources, and condition keys for -// Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html) . -// If the object you request doesn't exist, the error that Amazon S3 returns -// depends on whether you also have the s3:ListBucket permission. -// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an -// HTTP status code 404 error. -// - If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP -// status code 403 error. +// Versioning +// +// - If the current version of the object is a delete marker, Amazon S3 behaves +// as if the object was deleted and includes x-amz-delete-marker: true in the +// response. +// +// - If the specified version is a delete marker, the response returns a 405 +// Method Not Allowed error and the Last-Modified: timestamp response header. +// +// - Directory buckets - Delete marker is not supported for directory buckets. +// +// - Directory buckets - S3 Versioning isn't enabled and supported for directory +// buckets. For this API operation, only the null value of the version ID is +// supported by directory buckets. You can only specify null to the versionId +// query parameter in the request. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// For directory buckets, you must make requests for this API operation to the +// Zonal endpoint. These endpoints support virtual-hosted-style requests in the +// format https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name +// . Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. // // The following actions are related to HeadObject : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) +// +// [GetObject] +// +// [GetObjectAttributes] +// +// [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html +// [Actions, resources, and condition keys for Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Common Request Headers]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html func (c *Client) HeadObject(ctx context.Context, params *HeadObjectInput, optFns ...func(*Options)) (*HeadObjectOutput, error) { if params == nil { params = &HeadObjectInput{} @@ -92,21 +155,40 @@ func (c *Client) HeadObject(ctx context.Context, params *HeadObjectInput, optFns type HeadObjectInput struct { - // The name of the bucket containing the object. When using this action with an - // access point, you must direct requests to the access point hostname. The access - // point hostname takes the form + // The name of the bucket that contains the object. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -116,38 +198,99 @@ type HeadObjectInput struct { // This member is required. Key *string - // To retrieve the checksum, this parameter must be enabled. In addition, if you - // enable ChecksumMode and the object is encrypted with Amazon Web Services Key - // Management Service (Amazon Web Services KMS), you must have permission to use - // the kms:Decrypt action for the request to succeed. + // To retrieve the checksum, this parameter must be enabled. + // + // General purpose buckets - If you enable checksum mode and the object is + // uploaded with a [checksum]and encrypted with an Key Management Service (KMS) key, you + // must have permission to use the kms:Decrypt action to retrieve the checksum. + // + // Directory buckets - If you enable ChecksumMode and the object is encrypted with + // Amazon Web Services Key Management Service (Amazon Web Services KMS), you must + // also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM + // identity-based policies and KMS key policies for the KMS key to retrieve the + // checksum of the object. + // + // [checksum]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html ChecksumMode types.ChecksumMode - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Return the object only if its entity tag (ETag) is the same as the one // specified; otherwise, return a 412 (precondition failed) error. + // + // If both of the If-Match and If-Unmodified-Since headers are present in the + // request as follows: + // + // - If-Match condition evaluates to true , and; + // + // - If-Unmodified-Since condition evaluates to false ; + // + // Then Amazon S3 returns 200 OK and the data requested. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfMatch *string // Return the object only if it has been modified since the specified time; // otherwise, return a 304 (not modified) error. + // + // If both of the If-None-Match and If-Modified-Since headers are present in the + // request as follows: + // + // - If-None-Match condition evaluates to false , and; + // + // - If-Modified-Since condition evaluates to true ; + // + // Then Amazon S3 returns the 304 Not Modified response code. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfModifiedSince *time.Time // Return the object only if its entity tag (ETag) is different from the one // specified; otherwise, return a 304 (not modified) error. + // + // If both of the If-None-Match and If-Modified-Since headers are present in the + // request as follows: + // + // - If-None-Match condition evaluates to false , and; + // + // - If-Modified-Since condition evaluates to true ; + // + // Then Amazon S3 returns the 304 Not Modified response code. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfNoneMatch *string // Return the object only if it has not been modified since the specified time; // otherwise, return a 412 (precondition failed) error. + // + // If both of the If-Match and If-Unmodified-Since headers are present in the + // request as follows: + // + // - If-Match condition evaluates to true , and; + // + // - If-Unmodified-Since condition evaluates to false ; + // + // Then Amazon S3 returns 200 OK and the data requested. + // + // For more information about conditional requests, see [RFC 7232]. + // + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 IfUnmodifiedSince *time.Time // Part number of the object being read. This is a positive integer between 1 and // 10,000. Effectively performs a 'ranged' HEAD request for the part specified. // Useful querying about the size of the part and the number of parts in this // object. - PartNumber int32 + PartNumber *int32 // HeadObject returns only the metadata for an object. If the Range is // satisfiable, only the ContentLength is affected in the response. If the Range @@ -156,15 +299,37 @@ type HeadObjectInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Sets the Cache-Control header of the response. + ResponseCacheControl *string + + // Sets the Content-Disposition header of the response. + ResponseContentDisposition *string + + // Sets the Content-Encoding header of the response. + ResponseContentEncoding *string + + // Sets the Content-Language header of the response. + ResponseContentLanguage *string + + // Sets the Content-Type header of the response. + ResponseContentType *string + + // Sets the Expires header of the response. + ResponseExpires *time.Time + + // Specifies the algorithm to use when encrypting the object (for example, AES256). + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -172,66 +337,98 @@ type HeadObjectInput struct { // discarded; Amazon S3 does not store the encryption key. The key must be // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // This functionality is not supported for directory buckets. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // VersionId used to reference a specific version of the object. + // Version ID used to reference a specific version of the object. + // + // For directory buckets in this API operation, only the null value of the version + // ID is supported. VersionId *string noSmithyDocumentSerde } +func (in *HeadObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type HeadObjectOutput struct { // Indicates that a range of bytes was specified. AcceptRanges *string // The archive state of the head object. + // + // This functionality is not supported for directory buckets. ArchiveStatus types.ArchiveStatus // Indicates whether the object uses an S3 Bucket Key for server-side encryption // with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // Specifies caching behavior along the request/reply chain. CacheControl *string - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Specifies presentational information for the object. ContentDisposition *string - // Specifies what content encodings have been applied to the object and thus what + // Indicates what content encodings have been applied to the object and thus what // decoding mechanisms must be applied to obtain the media-type referenced by the // Content-Type header field. ContentEncoding *string @@ -240,29 +437,45 @@ type HeadObjectOutput struct { ContentLanguage *string // Size of the body in bytes. - ContentLength int64 + ContentLength *int64 // A standard MIME type describing the format of the object data. ContentType *string // Specifies whether the object retrieved was (true) or was not (false) a Delete // Marker. If false, this response header does not appear in the response. - DeleteMarker bool + // + // This functionality is not supported for directory buckets. + DeleteMarker *bool // An entity tag (ETag) is an opaque identifier assigned by a web server to a // specific version of a resource found at a URL. ETag *string - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key-value pairs - // providing object expiration information. The value of the rule-id is - // URL-encoded. + // If the object expiration is configured (see [PutBucketLifecycleConfiguration]PutBucketLifecycleConfiguration ), + // the response includes this header. It includes the expiry-date and rule-id + // key-value pairs providing object expiration information. The value of the + // rule-id is URL-encoded. + // + // Object expiration information is not returned in directory buckets and this + // header returns the value " NotImplemented " in all responses for directory + // buckets. + // + // [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html Expiration *string // The date and time at which the object is no longer cacheable. + // + // Deprecated: This field is handled inconsistently across AWS SDKs. Prefer using + // the ExpiresString field which contains the unparsed value from the service + // response. Expires *time.Time - // Creation date of the object. + // The unparsed value of the Expires field from the service response. Prefer use + // of this value over the normal Expires response field where possible. + ExpiresString *string + + // Date and time when the object was last modified. LastModified *time.Time // A map of metadata to store with the object in S3. @@ -274,104 +487,149 @@ type HeadObjectOutput struct { // headers. This can happen if you create metadata using an API like SOAP that // supports more flexible metadata than the REST API. For example, using SOAP, you // can create metadata whose values are not legal HTTP headers. - MissingMeta int32 + // + // This functionality is not supported for directory buckets. + MissingMeta *int32 // Specifies whether a legal hold is in effect for this object. This header is // only returned if the requester has the s3:GetObjectLegalHold permission. This // header is not returned if the specified version of this object has never had a - // legal hold applied. For more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) - // . + // legal hold applied. For more information about S3 Object Lock, see [Object Lock]. + // + // This functionality is not supported for directory buckets. + // + // [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus // The Object Lock mode, if any, that's in effect for this object. This header is // only returned if the requester has the s3:GetObjectRetention permission. For - // more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) - // . + // more information about S3 Object Lock, see [Object Lock]. + // + // This functionality is not supported for directory buckets. + // + // [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html ObjectLockMode types.ObjectLockMode // The date and time when the Object Lock retention period expires. This header is // only returned if the requester has the s3:GetObjectRetention permission. + // + // This functionality is not supported for directory buckets. ObjectLockRetainUntilDate *time.Time // The count of parts this object has. This value is only returned if you specify // partNumber in your request and the object was uploaded as a multipart upload. - PartsCount int32 + PartsCount *int32 // Amazon S3 can return this header if your request involves a bucket that is - // either a source or a destination in a replication rule. In replication, you have - // a source bucket on which you configure replication and destination bucket or - // buckets where Amazon S3 stores object replicas. When you request an object ( - // GetObject ) or object metadata ( HeadObject ) from these buckets, Amazon S3 will - // return the x-amz-replication-status header in the response as follows: + // either a source or a destination in a replication rule. + // + // In replication, you have a source bucket on which you configure replication and + // destination bucket or buckets where Amazon S3 stores object replicas. When you + // request an object ( GetObject ) or object metadata ( HeadObject ) from these + // buckets, Amazon S3 will return the x-amz-replication-status header in the + // response as follows: + // // - If requesting an object from the source bucket, Amazon S3 will return the // x-amz-replication-status header if the object in your request is eligible for - // replication. For example, suppose that in your replication configuration, you - // specify object prefix TaxDocs requesting Amazon S3 to replicate objects with - // key prefix TaxDocs . Any objects you upload with this key name prefix, for - // example TaxDocs/document1.pdf , are eligible for replication. For any object - // request with this key name prefix, Amazon S3 will return the - // x-amz-replication-status header with value PENDING, COMPLETED or FAILED - // indicating object replication status. + // replication. + // + // For example, suppose that in your replication configuration, you specify object + // prefix TaxDocs requesting Amazon S3 to replicate objects with key prefix + // TaxDocs . Any objects you upload with this key name prefix, for example + // TaxDocs/document1.pdf , are eligible for replication. For any object request + // with this key name prefix, Amazon S3 will return the x-amz-replication-status + // header with value PENDING, COMPLETED or FAILED indicating object replication + // status. + // // - If requesting an object from a destination bucket, Amazon S3 will return // the x-amz-replication-status header with value REPLICA if the object in your // request is a replica that Amazon S3 created and there is no replica modification // replication in progress. + // // - When replicating objects to multiple destination buckets, the // x-amz-replication-status header acts differently. The header of the source // object will only return a value of COMPLETED when replication is successful to // all destinations. The header will remain at value PENDING until replication has // completed for all destinations. If one or more destinations fails replication // the header will return FAILED. - // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // . + // + // For more information, see [Replication]. + // + // This functionality is not supported for directory buckets. + // + // [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html ReplicationStatus types.ReplicationStatus // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If the object is an archived object (an object whose storage class is GLACIER), // the response includes this header if either the archive restoration is in - // progress (see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) - // or an archive copy is already restored. If an archive copy is already restored, - // the header value indicates when Amazon S3 is scheduled to delete the object - // copy. For example: x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 - // Dec 2012 00:00:00 GMT" If the object restoration is in progress, the header - // returns the value ongoing-request="true" . For more information about archiving - // objects, see Transitioning Objects: General Considerations (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations) - // . + // progress (see [RestoreObject]or an archive copy is already restored. + // + // If an archive copy is already restored, the header value indicates when Amazon + // S3 is scheduled to delete the object copy. For example: + // + // x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 + // GMT" + // + // If the object restoration is in progress, the header returns the value + // ongoing-request="true" . + // + // For more information about archiving objects, see [Transitioning Objects: General Considerations]. + // + // This functionality is not supported for directory buckets. Only the S3 Express + // One Zone storage class is supported by directory buckets to store objects. + // + // [Transitioning Objects: General Considerations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations + // [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html Restore *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms , aws:kms:dsse ). ServerSideEncryption types.ServerSideEncryption // Provides storage class information of the object. Amazon S3 returns this header - // for all objects except for S3 Standard storage class objects. For more - // information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // . + // for all objects except for S3 Standard storage class objects. + // + // For more information, see [Storage Classes]. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html StorageClass types.StorageClass - // Version of the object. + // Version ID of the object. + // + // This functionality is not supported for directory buckets. VersionId *string // If the bucket is configured as a website, redirects requests for this object to // another object in the same bucket or to an external URL. Amazon S3 stores the // value of this header in the object metadata. + // + // This functionality is not supported for directory buckets. WebsiteRedirectLocation *string // Metadata pertaining to the operation's result. @@ -381,6 +639,9 @@ type HeadObjectOutput struct { } func (c *Client) addOperationHeadObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpHeadObject{}, middleware.After) if err != nil { return err @@ -389,34 +650,38 @@ func (c *Client) addOperationHeadObjectMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "HeadObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -428,10 +693,19 @@ func (c *Client) addOperationHeadObjectMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addHeadObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpHeadObjectValidationMiddleware(stack); err != nil { @@ -443,7 +717,7 @@ func (c *Client) addOperationHeadObjectMiddlewares(stack *middleware.Stack, opti if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addHeadObjectUpdateEndpoint(stack, options); err != nil { @@ -461,37 +735,44 @@ func (c *Client) addOperationHeadObjectMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } - return nil -} - -func (v *HeadObjectInput) bucket() (string, bool) { - if v.Bucket == nil { - return "", false + if err = addSpanInitializeStart(stack); err != nil { + return err } - return *v.Bucket, true -} - -// HeadObjectAPIClient is a client that implements the HeadObject operation. -type HeadObjectAPIClient interface { - HeadObject(context.Context, *HeadObjectInput, ...func(*Options)) (*HeadObjectOutput, error) + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil } -var _ HeadObjectAPIClient = (*Client)(nil) - // ObjectExistsWaiterOptions are waiter options for ObjectExistsWaiter type ObjectExistsWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + // MinDelay is the minimum amount of time to delay between retries. If unset, // ObjectExistsWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. @@ -507,12 +788,13 @@ type ObjectExistsWaiterOptions struct { // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. By - // default service-modeled logic will populate this option. This option can thus be - // used to define a custom waiter state with fall-back to service-modeled waiter - // state mutators.The function returns an error in case of a failure state. In case - // of retry state, this function returns a bool value of true and nil error, while - // in case of success it returns a bool value of false and nil error. + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *HeadObjectInput, *HeadObjectOutput, error) (bool, error) } @@ -588,7 +870,16 @@ func (w *ObjectExistsWaiter) WaitForOutput(ctx context.Context, params *HeadObje } out, err := w.client.HeadObject(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -643,8 +934,17 @@ type ObjectNotExistsWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. + // + // Passing options here is functionally equivalent to passing values to this + // config's ClientOptions field that extend the inner client's APIOptions directly. APIOptions []func(*middleware.Stack) error + // Functional options to be passed to all operations invoked by this client. + // + // Function values that modify the inner APIOptions are applied after the waiter + // config's own APIOptions modifiers. + ClientOptions []func(*Options) + // MinDelay is the minimum amount of time to delay between retries. If unset, // ObjectNotExistsWaiter will use default minimum delay of 5 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. @@ -660,12 +960,13 @@ type ObjectNotExistsWaiterOptions struct { // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is - // used by the waiter to decide if a state is retryable or a terminal state. By - // default service-modeled logic will populate this option. This option can thus be - // used to define a custom waiter state with fall-back to service-modeled waiter - // state mutators.The function returns an error in case of a failure state. In case - // of retry state, this function returns a bool value of true and nil error, while - // in case of success it returns a bool value of false and nil error. + // used by the waiter to decide if a state is retryable or a terminal state. + // + // By default service-modeled logic will populate this option. This option can + // thus be used to define a custom waiter state with fall-back to service-modeled + // waiter state mutators.The function returns an error in case of a failure state. + // In case of retry state, this function returns a bool value of true and nil + // error, while in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *HeadObjectInput, *HeadObjectOutput, error) (bool, error) } @@ -742,7 +1043,16 @@ func (w *ObjectNotExistsWaiter) WaitForOutput(ctx context.Context, params *HeadO } out, err := w.client.HeadObject(ctx, params, func(o *Options) { + baseOpts := []func(*Options){ + addIsWaiterUserAgent, + } o.APIOptions = append(o.APIOptions, apiOptions...) + for _, opt := range baseOpts { + opt(o) + } + for _, opt := range options.ClientOptions { + opt(o) + } }) retryable, err := options.Retryable(ctx, params, out, err) @@ -787,11 +1097,24 @@ func objectNotExistsStateRetryable(ctx context.Context, input *HeadObjectInput, return true, nil } +func (v *HeadObjectInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +// HeadObjectAPIClient is a client that implements the HeadObject operation. +type HeadObjectAPIClient interface { + HeadObject(context.Context, *HeadObjectInput, ...func(*Options)) (*HeadObjectOutput, error) +} + +var _ HeadObjectAPIClient = (*Client)(nil) + func newServiceMetadataMiddleware_opHeadObject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "HeadObject", } } @@ -852,139 +1175,3 @@ func addHeadObjectPayloadAsUnsigned(stack *middleware.Stack, options Options) er v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opHeadObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opHeadObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opHeadObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*HeadObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addHeadObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opHeadObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketAnalyticsConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketAnalyticsConfigurations.go index 99ad3827..dd35f119 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketAnalyticsConfigurations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketAnalyticsConfigurations.go @@ -4,40 +4,50 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Lists the analytics configurations for the bucket. You can have up to 1,000 -// analytics configurations per bucket. This action supports list pagination and -// does not return more than 100 configurations at a time. You should always check -// the IsTruncated element in the response. If there are no more configurations to -// list, IsTruncated is set to false. If there are more configurations to list, -// IsTruncated is set to true, and there will be a value in NextContinuationToken . -// You use the NextContinuationToken value to continue the pagination of the list -// by passing the value in continuation-token in the request to GET the next page. +// analytics configurations per bucket. +// +// This action supports list pagination and does not return more than 100 +// configurations at a time. You should always check the IsTruncated element in +// the response. If there are no more configurations to list, IsTruncated is set +// to false. If there are more configurations to list, IsTruncated is set to true, +// and there will be a value in NextContinuationToken . You use the +// NextContinuationToken value to continue the pagination of the list by passing +// the value in continuation-token in the request to GET the next page. +// // To use this operation, you must have permissions to perform the // s3:GetAnalyticsConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about Amazon S3 analytics feature, see Amazon S3 Analytics – -// Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// . The following operations are related to ListBucketAnalyticsConfigurations : -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about Amazon S3 analytics feature, see [Amazon S3 Analytics – Storage Class Analysis]. +// +// The following operations are related to ListBucketAnalyticsConfigurations : +// +// [GetBucketAnalyticsConfiguration] +// +// [DeleteBucketAnalyticsConfiguration] +// +// [PutBucketAnalyticsConfiguration] +// +// [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html +// [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html +// [PutBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) ListBucketAnalyticsConfigurations(ctx context.Context, params *ListBucketAnalyticsConfigurationsInput, optFns ...func(*Options)) (*ListBucketAnalyticsConfigurationsOutput, error) { if params == nil { params = &ListBucketAnalyticsConfigurationsInput{} @@ -64,14 +74,20 @@ type ListBucketAnalyticsConfigurationsInput struct { // should begin. ContinuationToken *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *ListBucketAnalyticsConfigurationsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type ListBucketAnalyticsConfigurationsOutput struct { // The list of analytics configurations for a bucket. @@ -84,7 +100,7 @@ type ListBucketAnalyticsConfigurationsOutput struct { // Indicates whether the returned list of analytics configurations is complete. A // value of true indicates that the list is not complete and the // NextContinuationToken will be provided for a subsequent request. - IsTruncated bool + IsTruncated *bool // NextContinuationToken is sent when isTruncated is true, which indicates that // there are more analytics configurations to list. The next request must include @@ -98,6 +114,9 @@ type ListBucketAnalyticsConfigurationsOutput struct { } func (c *Client) addOperationListBucketAnalyticsConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListBucketAnalyticsConfigurations{}, middleware.After) if err != nil { return err @@ -106,34 +125,38 @@ func (c *Client) addOperationListBucketAnalyticsConfigurationsMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBucketAnalyticsConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -145,10 +168,19 @@ func (c *Client) addOperationListBucketAnalyticsConfigurationsMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListBucketAnalyticsConfigurationsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListBucketAnalyticsConfigurationsValidationMiddleware(stack); err != nil { @@ -160,7 +192,7 @@ func (c *Client) addOperationListBucketAnalyticsConfigurationsMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListBucketAnalyticsConfigurationsUpdateEndpoint(stack, options); err != nil { @@ -178,12 +210,24 @@ func (c *Client) addOperationListBucketAnalyticsConfigurationsMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -198,7 +242,6 @@ func newServiceMetadataMiddleware_opListBucketAnalyticsConfigurations(region str return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListBucketAnalyticsConfigurations", } } @@ -228,139 +271,3 @@ func addListBucketAnalyticsConfigurationsUpdateEndpoint(stack *middleware.Stack, DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListBucketAnalyticsConfigurationsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListBucketAnalyticsConfigurationsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListBucketAnalyticsConfigurationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListBucketAnalyticsConfigurationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListBucketAnalyticsConfigurationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListBucketAnalyticsConfigurationsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go index 74eff196..3f6d19a3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go @@ -4,38 +4,48 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the S3 Intelligent-Tiering configuration from the specified bucket. The -// S3 Intelligent-Tiering storage class is designed to optimize storage costs by -// automatically moving data to the most cost-effective storage access tier, +// This operation is not supported for directory buckets. +// +// Lists the S3 Intelligent-Tiering configuration from the specified bucket. +// +// The S3 Intelligent-Tiering storage class is designed to optimize storage costs +// by automatically moving data to the most cost-effective storage access tier, // without performance impact or operational overhead. S3 Intelligent-Tiering // delivers automatic cost savings in three low latency and high throughput access // tiers. To get the lowest storage cost on data that can be accessed in minutes to -// hours, you can choose to activate additional archiving capabilities. The S3 -// Intelligent-Tiering storage class is the ideal storage class for data with -// unknown, changing, or unpredictable access patterns, independent of object size -// or retention period. If the size of an object is less than 128 KB, it is not -// monitored and not eligible for auto-tiering. Smaller objects can be stored, but -// they are always charged at the Frequent Access tier rates in the S3 -// Intelligent-Tiering storage class. For more information, see Storage class for -// automatically optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) -// . Operations related to ListBucketIntelligentTieringConfigurations include: -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) +// hours, you can choose to activate additional archiving capabilities. +// +// The S3 Intelligent-Tiering storage class is the ideal storage class for data +// with unknown, changing, or unpredictable access patterns, independent of object +// size or retention period. If the size of an object is less than 128 KB, it is +// not monitored and not eligible for auto-tiering. Smaller objects can be stored, +// but they are always charged at the Frequent Access tier rates in the S3 +// Intelligent-Tiering storage class. +// +// For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. +// +// Operations related to ListBucketIntelligentTieringConfigurations include: +// +// [DeleteBucketIntelligentTieringConfiguration] +// +// [PutBucketIntelligentTieringConfiguration] +// +// [GetBucketIntelligentTieringConfiguration] +// +// [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html +// [PutBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html +// [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access +// [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html func (c *Client) ListBucketIntelligentTieringConfigurations(ctx context.Context, params *ListBucketIntelligentTieringConfigurationsInput, optFns ...func(*Options)) (*ListBucketIntelligentTieringConfigurationsOutput, error) { if params == nil { params = &ListBucketIntelligentTieringConfigurationsInput{} @@ -66,6 +76,12 @@ type ListBucketIntelligentTieringConfigurationsInput struct { noSmithyDocumentSerde } +func (in *ListBucketIntelligentTieringConfigurationsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type ListBucketIntelligentTieringConfigurationsOutput struct { // The ContinuationToken that represents a placeholder from where this request @@ -78,7 +94,7 @@ type ListBucketIntelligentTieringConfigurationsOutput struct { // Indicates whether the returned list of analytics configurations is complete. A // value of true indicates that the list is not complete and the // NextContinuationToken will be provided for a subsequent request. - IsTruncated bool + IsTruncated *bool // The marker used to continue this inventory configuration listing. Use the // NextContinuationToken from this response to continue the listing in a subsequent @@ -92,6 +108,9 @@ type ListBucketIntelligentTieringConfigurationsOutput struct { } func (c *Client) addOperationListBucketIntelligentTieringConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListBucketIntelligentTieringConfigurations{}, middleware.After) if err != nil { return err @@ -100,34 +119,38 @@ func (c *Client) addOperationListBucketIntelligentTieringConfigurationsMiddlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBucketIntelligentTieringConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -139,10 +162,19 @@ func (c *Client) addOperationListBucketIntelligentTieringConfigurationsMiddlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListBucketIntelligentTieringConfigurationsValidationMiddleware(stack); err != nil { @@ -154,7 +186,7 @@ func (c *Client) addOperationListBucketIntelligentTieringConfigurationsMiddlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListBucketIntelligentTieringConfigurationsUpdateEndpoint(stack, options); err != nil { @@ -172,12 +204,24 @@ func (c *Client) addOperationListBucketIntelligentTieringConfigurationsMiddlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -192,7 +236,6 @@ func newServiceMetadataMiddleware_opListBucketIntelligentTieringConfigurations(r return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListBucketIntelligentTieringConfigurations", } } @@ -222,139 +265,3 @@ func addListBucketIntelligentTieringConfigurationsUpdateEndpoint(stack *middlewa DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListBucketIntelligentTieringConfigurationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListBucketIntelligentTieringConfigurationsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketInventoryConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketInventoryConfigurations.go index fd2cf048..5a675d2a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketInventoryConfigurations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketInventoryConfigurations.go @@ -4,39 +4,50 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns a list of inventory configurations for the bucket. You can have up to -// 1,000 analytics configurations per bucket. This action supports list pagination -// and does not return more than 100 configurations at a time. Always check the -// IsTruncated element in the response. If there are no more configurations to -// list, IsTruncated is set to false. If there are more configurations to list, -// IsTruncated is set to true, and there is a value in NextContinuationToken . You -// use the NextContinuationToken value to continue the pagination of the list by -// passing the value in continuation-token in the request to GET the next page. To -// use this operation, you must have permissions to perform the +// 1,000 analytics configurations per bucket. +// +// This action supports list pagination and does not return more than 100 +// configurations at a time. Always check the IsTruncated element in the response. +// If there are no more configurations to list, IsTruncated is set to false. If +// there are more configurations to list, IsTruncated is set to true, and there is +// a value in NextContinuationToken . You use the NextContinuationToken value to +// continue the pagination of the list by passing the value in continuation-token +// in the request to GET the next page. +// +// To use this operation, you must have permissions to perform the // s3:GetInventoryConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about the Amazon S3 inventory feature, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about the Amazon S3 inventory feature, see [Amazon S3 Inventory] +// // The following operations are related to ListBucketInventoryConfigurations : -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) +// +// [GetBucketInventoryConfiguration] +// +// [DeleteBucketInventoryConfiguration] +// +// [PutBucketInventoryConfiguration] +// +// [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [PutBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html +// [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html func (c *Client) ListBucketInventoryConfigurations(ctx context.Context, params *ListBucketInventoryConfigurationsInput, optFns ...func(*Options)) (*ListBucketInventoryConfigurationsOutput, error) { if params == nil { params = &ListBucketInventoryConfigurationsInput{} @@ -65,14 +76,20 @@ type ListBucketInventoryConfigurationsInput struct { // Amazon S3 understands. ContinuationToken *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *ListBucketInventoryConfigurationsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type ListBucketInventoryConfigurationsOutput struct { // If sent in the request, the marker that is used as a starting point for this @@ -85,7 +102,7 @@ type ListBucketInventoryConfigurationsOutput struct { // Tells whether the returned list of inventory configurations is complete. A // value of true indicates that the list is not complete and the // NextContinuationToken is provided for a subsequent request. - IsTruncated bool + IsTruncated *bool // The marker used to continue this inventory configuration listing. Use the // NextContinuationToken from this response to continue the listing in a subsequent @@ -99,6 +116,9 @@ type ListBucketInventoryConfigurationsOutput struct { } func (c *Client) addOperationListBucketInventoryConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListBucketInventoryConfigurations{}, middleware.After) if err != nil { return err @@ -107,34 +127,38 @@ func (c *Client) addOperationListBucketInventoryConfigurationsMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBucketInventoryConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -146,10 +170,19 @@ func (c *Client) addOperationListBucketInventoryConfigurationsMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListBucketInventoryConfigurationsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListBucketInventoryConfigurationsValidationMiddleware(stack); err != nil { @@ -161,7 +194,7 @@ func (c *Client) addOperationListBucketInventoryConfigurationsMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListBucketInventoryConfigurationsUpdateEndpoint(stack, options); err != nil { @@ -179,12 +212,24 @@ func (c *Client) addOperationListBucketInventoryConfigurationsMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -199,7 +244,6 @@ func newServiceMetadataMiddleware_opListBucketInventoryConfigurations(region str return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListBucketInventoryConfigurations", } } @@ -229,139 +273,3 @@ func addListBucketInventoryConfigurationsUpdateEndpoint(stack *middleware.Stack, DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListBucketInventoryConfigurationsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListBucketInventoryConfigurationsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListBucketInventoryConfigurationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListBucketInventoryConfigurationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListBucketInventoryConfigurationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListBucketInventoryConfigurationsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketMetricsConfigurations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketMetricsConfigurations.go index 45e145e8..e6484f4b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketMetricsConfigurations.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBucketMetricsConfigurations.go @@ -4,41 +4,51 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Lists the metrics configurations for the bucket. The metrics configurations are // only for the request metrics of the bucket and do not provide information on -// daily storage metrics. You can have up to 1,000 configurations per bucket. This -// action supports list pagination and does not return more than 100 configurations -// at a time. Always check the IsTruncated element in the response. If there are -// no more configurations to list, IsTruncated is set to false. If there are more -// configurations to list, IsTruncated is set to true, and there is a value in -// NextContinuationToken . You use the NextContinuationToken value to continue the -// pagination of the list by passing the value in continuation-token in the -// request to GET the next page. To use this operation, you must have permissions -// to perform the s3:GetMetricsConfiguration action. The bucket owner has this -// permission by default. The bucket owner can grant this permission to others. For -// more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For more information about metrics configurations and CloudWatch request -// metrics, see Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// . The following operations are related to ListBucketMetricsConfigurations : -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) +// daily storage metrics. You can have up to 1,000 configurations per bucket. +// +// This action supports list pagination and does not return more than 100 +// configurations at a time. Always check the IsTruncated element in the response. +// If there are no more configurations to list, IsTruncated is set to false. If +// there are more configurations to list, IsTruncated is set to true, and there is +// a value in NextContinuationToken . You use the NextContinuationToken value to +// continue the pagination of the list by passing the value in continuation-token +// in the request to GET the next page. +// +// To use this operation, you must have permissions to perform the +// s3:GetMetricsConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For more information about metrics configurations and CloudWatch request +// metrics, see [Monitoring Metrics with Amazon CloudWatch]. +// +// The following operations are related to ListBucketMetricsConfigurations : +// +// [PutBucketMetricsConfiguration] +// +// [GetBucketMetricsConfiguration] +// +// [DeleteBucketMetricsConfiguration] +// +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html +// [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html +// [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html +// [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) ListBucketMetricsConfigurations(ctx context.Context, params *ListBucketMetricsConfigurationsInput, optFns ...func(*Options)) (*ListBucketMetricsConfigurationsOutput, error) { if params == nil { params = &ListBucketMetricsConfigurationsInput{} @@ -67,14 +77,20 @@ type ListBucketMetricsConfigurationsInput struct { // Amazon S3 understands. ContinuationToken *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *ListBucketMetricsConfigurationsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type ListBucketMetricsConfigurationsOutput struct { // The marker that is used as a starting point for this metrics configuration list @@ -84,7 +100,7 @@ type ListBucketMetricsConfigurationsOutput struct { // Indicates whether the returned list of metrics configurations is complete. A // value of true indicates that the list is not complete and the // NextContinuationToken will be provided for a subsequent request. - IsTruncated bool + IsTruncated *bool // The list of metrics configurations for a bucket. MetricsConfigurationList []types.MetricsConfiguration @@ -102,6 +118,9 @@ type ListBucketMetricsConfigurationsOutput struct { } func (c *Client) addOperationListBucketMetricsConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListBucketMetricsConfigurations{}, middleware.After) if err != nil { return err @@ -110,34 +129,38 @@ func (c *Client) addOperationListBucketMetricsConfigurationsMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBucketMetricsConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -149,10 +172,19 @@ func (c *Client) addOperationListBucketMetricsConfigurationsMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListBucketMetricsConfigurationsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListBucketMetricsConfigurationsValidationMiddleware(stack); err != nil { @@ -164,7 +196,7 @@ func (c *Client) addOperationListBucketMetricsConfigurationsMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListBucketMetricsConfigurationsUpdateEndpoint(stack, options); err != nil { @@ -182,12 +214,24 @@ func (c *Client) addOperationListBucketMetricsConfigurationsMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -202,7 +246,6 @@ func newServiceMetadataMiddleware_opListBucketMetricsConfigurations(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListBucketMetricsConfigurations", } } @@ -232,139 +275,3 @@ func addListBucketMetricsConfigurationsUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListBucketMetricsConfigurationsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListBucketMetricsConfigurationsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListBucketMetricsConfigurationsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListBucketMetricsConfigurationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListBucketMetricsConfigurationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListBucketMetricsConfigurationsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBuckets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBuckets.go index 37240226..d8754082 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBuckets.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListBuckets.go @@ -4,25 +4,32 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns a list of all buckets owned by the authenticated sender of the request. -// To use this operation, you must have the s3:ListAllMyBuckets permission. For -// information about Amazon S3 buckets, see Creating, configuring, and working -// with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) -// . +// To grant IAM permission to use this operation, you must add the +// s3:ListAllMyBuckets policy action. +// +// For information about Amazon S3 buckets, see [Creating, configuring, and working with Amazon S3 buckets]. +// +// We strongly recommend using only paginated ListBuckets requests. Unpaginated +// ListBuckets requests are only supported for Amazon Web Services accounts set to +// the default general purpose bucket quota of 10,000. If you have an approved +// general purpose bucket quota above 10,000, you must send paginated ListBuckets +// requests to list your account’s buckets. All unpaginated ListBuckets requests +// will be rejected for Amazon Web Services accounts with a general purpose bucket +// quota greater than 10,000. +// +// [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html func (c *Client) ListBuckets(ctx context.Context, params *ListBucketsInput, optFns ...func(*Options)) (*ListBucketsOutput, error) { if params == nil { params = &ListBucketsInput{} @@ -39,6 +46,44 @@ func (c *Client) ListBuckets(ctx context.Context, params *ListBucketsInput, optF } type ListBucketsInput struct { + + // Limits the response to buckets that are located in the specified Amazon Web + // Services Region. The Amazon Web Services Region must be expressed according to + // the Amazon Web Services Region code, such as us-west-2 for the US West (Oregon) + // Region. For a list of the valid values for all of the Amazon Web Services + // Regions, see [Regions and Endpoints]. + // + // Requests made to a Regional endpoint that is different from the bucket-region + // parameter are not supported. For example, if you want to limit the response to + // your buckets in Region us-west-2 , the request must be made to an endpoint in + // Region us-west-2 . + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + BucketRegion *string + + // ContinuationToken indicates to Amazon S3 that the list is being continued on + // this bucket with a token. ContinuationToken is obfuscated and is not a real + // key. You can use this ContinuationToken for pagination of the list results. + // + // Length Constraints: Minimum length of 0. Maximum length of 1024. + // + // Required: No. + // + // If you specify the bucket-region , prefix , or continuation-token query + // parameters without using max-buckets to set the maximum number of buckets + // returned in the response, Amazon S3 applies a default page size of 10,000 and + // provides a continuation token if there are more buckets. + ContinuationToken *string + + // Maximum number of buckets to be returned in response. When the number is more + // than the count of buckets that are owned by an Amazon Web Services account, + // return all the buckets in response. + MaxBuckets *int32 + + // Limits the response to bucket names that begin with the specified bucket name + // prefix. + Prefix *string + noSmithyDocumentSerde } @@ -47,9 +92,20 @@ type ListBucketsOutput struct { // The list of buckets owned by the requester. Buckets []types.Bucket + // ContinuationToken is included in the response when there are more buckets that + // can be listed with pagination. The next ListBuckets request to Amazon S3 can be + // continued with this ContinuationToken . ContinuationToken is obfuscated and is + // not a real bucket. + ContinuationToken *string + // The owner of the buckets listed. Owner *types.Owner + // If Prefix was sent with the request, it is included in the response. + // + // All bucket names in the response begin with the specified bucket name prefix. + Prefix *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -57,6 +113,9 @@ type ListBucketsOutput struct { } func (c *Client) addOperationListBucketsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListBuckets{}, middleware.After) if err != nil { return err @@ -65,34 +124,38 @@ func (c *Client) addOperationListBucketsMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListBuckets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -104,10 +167,19 @@ func (c *Client) addOperationListBucketsMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addListBucketsResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBuckets(options.Region), middleware.Before); err != nil { @@ -116,7 +188,7 @@ func (c *Client) addOperationListBucketsMiddlewares(stack *middleware.Stack, opt if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListBucketsUpdateEndpoint(stack, options); err != nil { @@ -134,165 +206,141 @@ func (c *Client) addOperationListBucketsMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } -func newServiceMetadataMiddleware_opListBuckets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - SigningName: "s3", - OperationName: "ListBuckets", - } -} +// ListBucketsPaginatorOptions is the paginator options for ListBuckets +type ListBucketsPaginatorOptions struct { + // Maximum number of buckets to be returned in response. When the number is more + // than the count of buckets that are owned by an Amazon Web Services account, + // return all the buckets in response. + Limit int32 -func addListBucketsUpdateEndpoint(stack *middleware.Stack, options Options) error { - return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ - Accessor: s3cust.UpdateEndpointParameterAccessor{ - GetBucketFromInput: nopGetBucketAccessor, - }, - UsePathStyle: options.UsePathStyle, - UseAccelerate: options.UseAccelerate, - SupportsAccelerate: false, - TargetS3ObjectLambda: false, - EndpointResolver: options.EndpointResolver, - EndpointResolverOptions: options.EndpointOptions, - UseARNRegion: options.UseARNRegion, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - }) + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool } -type opListBucketsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver +// ListBucketsPaginator is a paginator for ListBuckets +type ListBucketsPaginator struct { + options ListBucketsPaginatorOptions + client ListBucketsAPIClient + params *ListBucketsInput + nextToken *string + firstPage bool } -func (*opListBucketsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} +// NewListBucketsPaginator returns a new ListBucketsPaginator +func NewListBucketsPaginator(client ListBucketsAPIClient, params *ListBucketsInput, optFns ...func(*ListBucketsPaginatorOptions)) *ListBucketsPaginator { + if params == nil { + params = &ListBucketsInput{} + } -func (m *opListBucketsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) + options := ListBucketsPaginatorOptions{} + if params.MaxBuckets != nil { + options.Limit = *params.MaxBuckets } - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + for _, fn := range optFns { + fn(&options) } - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + return &ListBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.ContinuationToken, } +} - params := EndpointParameters{} +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBucketsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} - m.BuiltInResolver.ResolveBuiltIns(¶ms) +// NextPage retrieves the next ListBuckets page. +func (p *ListBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ContinuationToken = p.nextToken - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxBuckets = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListBuckets(ctx, ¶ms, optFns...) if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + return nil, err } + p.firstPage = false - req.URL = &resolvedEndpoint.URI + prevToken := p.nextToken + p.nextToken = result.ContinuationToken - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil } - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) + return result, nil +} + +// ListBucketsAPIClient is a client that implements the ListBuckets operation. +type ListBucketsAPIClient interface { + ListBuckets(context.Context, *ListBucketsInput, ...func(*Options)) (*ListBucketsOutput, error) } -func addListBucketsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListBucketsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, +var _ ListBucketsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListBuckets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListBuckets", + } +} + +func addListBucketsUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: nopGetBucketAccessor, }, - }, "ResolveEndpoint", middleware.After) + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: false, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListDirectoryBuckets.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListDirectoryBuckets.go new file mode 100644 index 00000000..ca9ccb58 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListDirectoryBuckets.go @@ -0,0 +1,328 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all Amazon S3 directory buckets owned by the authenticated +// sender of the request. For more information about directory buckets, see [Directory buckets]in the +// Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions You must have the s3express:ListAllMyDirectoryBuckets permission in +// an IAM identity-based policy instead of a bucket policy. Cross-account access to +// this API operation isn't supported. This operation can only be performed by the +// Amazon Web Services account that owns the resource. For more information about +// directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . +// +// The BucketRegion response element is not part of the ListDirectoryBuckets +// Response Syntax. +// +// [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +func (c *Client) ListDirectoryBuckets(ctx context.Context, params *ListDirectoryBucketsInput, optFns ...func(*Options)) (*ListDirectoryBucketsOutput, error) { + if params == nil { + params = &ListDirectoryBucketsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDirectoryBuckets", params, optFns, c.addOperationListDirectoryBucketsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDirectoryBucketsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDirectoryBucketsInput struct { + + // ContinuationToken indicates to Amazon S3 that the list is being continued on + // buckets in this account with a token. ContinuationToken is obfuscated and is + // not a real bucket name. You can use this ContinuationToken for the pagination + // of the list results. + ContinuationToken *string + + // Maximum number of buckets to be returned in response. When the number is more + // than the count of buckets that are owned by an Amazon Web Services account, + // return all the buckets in response. + MaxDirectoryBuckets *int32 + + noSmithyDocumentSerde +} + +func (in *ListDirectoryBucketsInput) bindEndpointParams(p *EndpointParameters) { + + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + +type ListDirectoryBucketsOutput struct { + + // The list of buckets owned by the requester. + Buckets []types.Bucket + + // If ContinuationToken was sent with the request, it is included in the response. + // You can use the returned ContinuationToken for pagination of the list response. + ContinuationToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDirectoryBucketsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestxml_serializeOpListDirectoryBuckets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListDirectoryBuckets{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDirectoryBuckets"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDirectoryBuckets(options.Region), middleware.Before); err != nil { + return err + } + if err = addMetadataRetrieverMiddleware(stack); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addListDirectoryBucketsUpdateEndpoint(stack, options); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + return err + } + if err = disableAcceptEncodingGzip(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListDirectoryBucketsPaginatorOptions is the paginator options for +// ListDirectoryBuckets +type ListDirectoryBucketsPaginatorOptions struct { + // Maximum number of buckets to be returned in response. When the number is more + // than the count of buckets that are owned by an Amazon Web Services account, + // return all the buckets in response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListDirectoryBucketsPaginator is a paginator for ListDirectoryBuckets +type ListDirectoryBucketsPaginator struct { + options ListDirectoryBucketsPaginatorOptions + client ListDirectoryBucketsAPIClient + params *ListDirectoryBucketsInput + nextToken *string + firstPage bool +} + +// NewListDirectoryBucketsPaginator returns a new ListDirectoryBucketsPaginator +func NewListDirectoryBucketsPaginator(client ListDirectoryBucketsAPIClient, params *ListDirectoryBucketsInput, optFns ...func(*ListDirectoryBucketsPaginatorOptions)) *ListDirectoryBucketsPaginator { + if params == nil { + params = &ListDirectoryBucketsInput{} + } + + options := ListDirectoryBucketsPaginatorOptions{} + if params.MaxDirectoryBuckets != nil { + options.Limit = *params.MaxDirectoryBuckets + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDirectoryBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.ContinuationToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDirectoryBucketsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDirectoryBuckets page. +func (p *ListDirectoryBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDirectoryBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ContinuationToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxDirectoryBuckets = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListDirectoryBuckets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.ContinuationToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListDirectoryBucketsAPIClient is a client that implements the +// ListDirectoryBuckets operation. +type ListDirectoryBucketsAPIClient interface { + ListDirectoryBuckets(context.Context, *ListDirectoryBucketsInput, ...func(*Options)) (*ListDirectoryBucketsOutput, error) +} + +var _ ListDirectoryBucketsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListDirectoryBuckets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDirectoryBuckets", + } +} + +func addListDirectoryBucketsUpdateEndpoint(stack *middleware.Stack, options Options) error { + return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{ + Accessor: s3cust.UpdateEndpointParameterAccessor{ + GetBucketFromInput: nopGetBucketAccessor, + }, + UsePathStyle: options.UsePathStyle, + UseAccelerate: options.UseAccelerate, + SupportsAccelerate: true, + TargetS3ObjectLambda: false, + EndpointResolver: options.EndpointResolver, + EndpointResolverOptions: options.EndpointOptions, + UseARNRegion: options.UseARNRegion, + DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListMultipartUploads.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListMultipartUploads.go index 4749ad10..1c2ecf1d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListMultipartUploads.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListMultipartUploads.go @@ -4,43 +4,111 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This action lists in-progress multipart uploads. An in-progress multipart -// upload is a multipart upload that has been initiated using the Initiate -// Multipart Upload request, but has not yet been completed or aborted. This action -// returns at most 1,000 multipart uploads in the response. 1,000 multipart uploads -// is the maximum number of uploads a response can include, which is also the -// default value. You can further limit the number of uploads in a response by -// specifying the max-uploads parameter in the response. If additional multipart -// uploads satisfy the list criteria, the response will contain an IsTruncated -// element with the value true. To list the additional multipart uploads, use the -// key-marker and upload-id-marker request parameters. In the response, the -// uploads are sorted by key. If your application has initiated more than one -// multipart upload using the same object key, then uploads in the response are -// first sorted by key. Additionally, uploads are sorted in ascending order within -// each key by the upload initiation time. For more information on multipart -// uploads, see Uploading Objects Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// . For information on permissions required to use the multipart upload API, see -// Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// . The following operations are related to ListMultipartUploads : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) +// This operation lists in-progress multipart uploads in a bucket. An in-progress +// multipart upload is a multipart upload that has been initiated by the +// CreateMultipartUpload request, but has not yet been completed or aborted. +// +// Directory buckets - If multipart uploads in a directory bucket are in progress, +// you can't delete the bucket until all the in-progress multipart uploads are +// aborted or completed. To delete these in-progress multipart uploads, use the +// ListMultipartUploads operation to list the in-progress multipart uploads in the +// bucket and use the AbortMultipartUpload operation to abort all the in-progress +// multipart uploads. +// +// The ListMultipartUploads operation returns a maximum of 1,000 multipart uploads +// in the response. The limit of 1,000 multipart uploads is also the default value. +// You can further limit the number of uploads in a response by specifying the +// max-uploads request parameter. If there are more than 1,000 multipart uploads +// that satisfy your ListMultipartUploads request, the response returns an +// IsTruncated element with the value of true , a NextKeyMarker element, and a +// NextUploadIdMarker element. To list the remaining multipart uploads, you need to +// make subsequent ListMultipartUploads requests. In these requests, include two +// query parameters: key-marker and upload-id-marker . Set the value of key-marker +// to the NextKeyMarker value from the previous response. Similarly, set the value +// of upload-id-marker to the NextUploadIdMarker value from the previous response. +// +// Directory buckets - The upload-id-marker element and the NextUploadIdMarker +// element aren't supported by directory buckets. To list the additional multipart +// uploads, you only need to set the value of key-marker to the NextKeyMarker +// value from the previous response. +// +// For more information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - For information about permissions +// required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// Sorting of multipart uploads in response +// +// - General purpose bucket - In the ListMultipartUploads response, the multipart +// uploads are sorted based on two criteria: +// +// - Key-based sorting - Multipart uploads are initially sorted in ascending +// order based on their object keys. +// +// - Time-based sorting - For uploads that share the same object key, they are +// further sorted in ascending order based on the upload initiation time. Among +// uploads with the same key, the one that was initiated first will appear before +// the ones that were initiated later. +// +// - Directory bucket - In the ListMultipartUploads response, the multipart +// uploads aren't sorted lexicographically based on the object keys. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to ListMultipartUploads : +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [ListParts] +// +// [AbortMultipartUpload] +// +// [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html func (c *Client) ListMultipartUploads(ctx context.Context, params *ListMultipartUploadsInput, optFns ...func(*Options)) (*ListMultipartUploadsOutput, error) { if params == nil { params = &ListMultipartUploadsInput{} @@ -58,73 +126,123 @@ func (c *Client) ListMultipartUploads(ctx context.Context, params *ListMultipart type ListMultipartUploadsInput struct { - // The name of the bucket to which the multipart upload was initiated. When using - // this action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form + // The name of the bucket to which the multipart upload was initiated. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string - // Character you use to group keys. All keys that contain the same string between - // the prefix, if specified, and the first occurrence of the delimiter after the - // prefix are grouped under a single result element, CommonPrefixes . If you don't - // specify the prefix parameter, then the substring starts at the beginning of the - // key. The keys that are grouped under CommonPrefixes result element are not - // returned elsewhere in the response. + // Character you use to group keys. + // + // All keys that contain the same string between the prefix, if specified, and the + // first occurrence of the delimiter after the prefix are grouped under a single + // result element, CommonPrefixes . If you don't specify the prefix parameter, then + // the substring starts at the beginning of the key. The keys that are grouped + // under CommonPrefixes result element are not returned elsewhere in the response. + // + // Directory buckets - For directory buckets, / is the only supported delimiter. Delimiter *string - // Requests Amazon S3 to encode the object keys in the response and specifies the - // encoding method to use. An object key can contain any Unicode character; - // however, the XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in XML - // 1.0, you can add this parameter to request that Amazon S3 encode the keys in the - // response. + // Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + // encoded only in UTF-8. An object key can contain any Unicode character. However, + // the XML 1.0 parser can't parse certain characters, such as characters with an + // ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + // can add this parameter to request that Amazon S3 encode the keys in the + // response. For more information about characters to avoid in object key names, + // see [Object key naming guidelines]. + // + // When using the URL encoding type, non-ASCII characters that are used in an + // object's key name will be percent-encoded according to UTF-8 code values. For + // example, the object test_file(3).png will appear as test_file%283%29.png . + // + // [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + // [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html EncodingType types.EncodingType - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string - // Together with upload-id-marker , this parameter specifies the multipart upload - // after which listing should begin. If upload-id-marker is not specified, only - // the keys lexicographically greater than the specified key-marker will be - // included in the list. If upload-id-marker is specified, any multipart uploads - // for a key equal to the key-marker might also be included, provided those - // multipart uploads have upload IDs lexicographically greater than the specified - // upload-id-marker . + // Specifies the multipart upload after which listing should begin. + // + // - General purpose buckets - For general purpose buckets, key-marker is an + // object key. Together with upload-id-marker , this parameter specifies the + // multipart upload after which listing should begin. + // + // If upload-id-marker is not specified, only the keys lexicographically greater + // than the specified key-marker will be included in the list. + // + // If upload-id-marker is specified, any multipart uploads for a key equal to the + // key-marker might also be included, provided those multipart uploads have + // upload IDs lexicographically greater than the specified upload-id-marker . + // + // - Directory buckets - For directory buckets, key-marker is obfuscated and + // isn't a real object key. The upload-id-marker parameter isn't supported by + // directory buckets. To list the additional multipart uploads, you only need to + // set the value of key-marker to the NextKeyMarker value from the previous + // response. + // + // In the ListMultipartUploads response, the multipart uploads aren't sorted + // lexicographically based on the object keys. KeyMarker *string // Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the // response body. 1,000 is the maximum number of uploads that can be returned in a // response. - MaxUploads int32 + MaxUploads *int32 // Lists in-progress uploads only for those keys that begin with the specified // prefix. You can use prefixes to separate a bucket into different grouping of // keys. (You can think of using prefix to make groups in the same way that you'd // use a folder in a file system.) + // + // Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. Prefix *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // Together with key-marker, specifies the multipart upload after which listing @@ -132,11 +250,20 @@ type ListMultipartUploadsInput struct { // ignored. Otherwise, any multipart uploads for a key equal to the key-marker // might be included in the list only if they have an upload ID lexicographically // greater than the specified upload-id-marker . + // + // This functionality is not supported for directory buckets. UploadIdMarker *string noSmithyDocumentSerde } +func (in *ListMultipartUploadsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Prefix = in.Prefix + +} + type ListMultipartUploadsOutput struct { // The name of the bucket to which the multipart upload was initiated. Does not @@ -146,30 +273,38 @@ type ListMultipartUploadsOutput struct { // If you specify a delimiter in the request, then the result returns each // distinct key prefix containing the delimiter in a CommonPrefixes element. The // distinct key prefixes are returned in the Prefix child element. + // + // Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. CommonPrefixes []types.CommonPrefix // Contains the delimiter you specified in the request. If you don't specify a // delimiter in your request, this element is absent from the response. + // + // Directory buckets - For directory buckets, / is the only supported delimiter. Delimiter *string - // Encoding type used by Amazon S3 to encode object keys in the response. If you - // specify the encoding-type request parameter, Amazon S3 includes this element in - // the response, and returns encoded key name values in the following response - // elements: Delimiter , KeyMarker , Prefix , NextKeyMarker , Key . + // Encoding type used by Amazon S3 to encode object keys in the response. + // + // If you specify the encoding-type request parameter, Amazon S3 includes this + // element in the response, and returns encoded key name values in the following + // response elements: + // + // Delimiter , KeyMarker , Prefix , NextKeyMarker , Key . EncodingType types.EncodingType // Indicates whether the returned list of multipart uploads is truncated. A value // of true indicates that the list was truncated. The list can be truncated if the // number of multipart uploads exceeds the limit allowed or specified by max // uploads. - IsTruncated bool + IsTruncated *bool // The key at or after which the listing began. KeyMarker *string // Maximum number of multipart uploads that could have been included in the // response. - MaxUploads int32 + MaxUploads *int32 // When a list is truncated, this element specifies the value that should be used // for the key-marker request parameter in a subsequent request. @@ -177,17 +312,30 @@ type ListMultipartUploadsOutput struct { // When a list is truncated, this element specifies the value that should be used // for the upload-id-marker request parameter in a subsequent request. + // + // This functionality is not supported for directory buckets. NextUploadIdMarker *string // When a prefix is provided in the request, this field contains the specified // prefix. The result contains only keys starting with the specified prefix. + // + // Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. Prefix *string // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged - // Upload ID after which listing began. + // Together with key-marker, specifies the multipart upload after which listing + // should begin. If key-marker is not specified, the upload-id-marker parameter is + // ignored. Otherwise, any multipart uploads for a key equal to the key-marker + // might be included in the list only if they have an upload ID lexicographically + // greater than the specified upload-id-marker . + // + // This functionality is not supported for directory buckets. UploadIdMarker *string // Container for elements related to a particular multipart upload. A response can @@ -201,6 +349,9 @@ type ListMultipartUploadsOutput struct { } func (c *Client) addOperationListMultipartUploadsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListMultipartUploads{}, middleware.After) if err != nil { return err @@ -209,34 +360,38 @@ func (c *Client) addOperationListMultipartUploadsMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListMultipartUploads"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -248,10 +403,19 @@ func (c *Client) addOperationListMultipartUploadsMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addListMultipartUploadsResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListMultipartUploadsValidationMiddleware(stack); err != nil { @@ -263,7 +427,7 @@ func (c *Client) addOperationListMultipartUploadsMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListMultipartUploadsUpdateEndpoint(stack, options); err != nil { @@ -281,12 +445,24 @@ func (c *Client) addOperationListMultipartUploadsMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -301,7 +477,6 @@ func newServiceMetadataMiddleware_opListMultipartUploads(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListMultipartUploads", } } @@ -331,139 +506,3 @@ func addListMultipartUploadsUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListMultipartUploadsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListMultipartUploadsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListMultipartUploadsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListMultipartUploadsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListMultipartUploadsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListMultipartUploadsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go index 00ef2e9e..32898706 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go @@ -4,33 +4,43 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns metadata about all versions of the objects in a bucket. You can also // use request parameters as selection criteria to return metadata about a subset -// of all the object versions. To use this operation, you must have permission to -// perform the s3:ListBucketVersions action. Be aware of the name difference. A -// 200 OK response can contain valid or invalid XML. Make sure to design your +// of all the object versions. +// +// To use this operation, you must have permission to perform the +// s3:ListBucketVersions action. Be aware of the name difference. +// +// A 200 OK response can contain valid or invalid XML. Make sure to design your // application to parse the contents of the response and handle it appropriately. -// To use this operation, you must have READ access to the bucket. This action is -// not supported by Amazon S3 on Outposts. The following operations are related to -// ListObjectVersions : -// - ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) +// +// To use this operation, you must have READ access to the bucket. +// +// The following operations are related to ListObjectVersions : +// +// [ListObjectsV2] +// +// [GetObject] +// +// [PutObject] +// +// [DeleteObject] +// +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html func (c *Client) ListObjectVersions(ctx context.Context, params *ListObjectVersionsInput, optFns ...func(*Options)) (*ListObjectVersionsOutput, error) { if params == nil { params = &ListObjectVersionsInput{} @@ -60,17 +70,25 @@ type ListObjectVersionsInput struct { // are not returned elsewhere in the response. Delimiter *string - // Requests Amazon S3 to encode the object keys in the response and specifies the - // encoding method to use. An object key can contain any Unicode character; - // however, the XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in XML - // 1.0, you can add this parameter to request that Amazon S3 encode the keys in the - // response. + // Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + // encoded only in UTF-8. An object key can contain any Unicode character. However, + // the XML 1.0 parser can't parse certain characters, such as characters with an + // ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + // can add this parameter to request that Amazon S3 encode the keys in the + // response. For more information about characters to avoid in object key names, + // see [Object key naming guidelines]. + // + // When using the URL encoding type, non-ASCII characters that are used in an + // object's key name will be percent-encoded according to UTF-8 code values. For + // example, the object test_file(3).png will appear as test_file%283%29.png . + // + // [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + // [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html EncodingType types.EncodingType - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Specifies the key to start with when listing objects in a bucket. @@ -81,7 +99,7 @@ type ListObjectVersionsInput struct { // will never contain more. If additional keys satisfy the search criteria, but // were not returned because max-keys was exceeded, the response contains true . To // return the additional keys, see key-marker and version-id-marker . - MaxKeys int32 + MaxKeys *int32 // Specifies the optional fields that you want returned in the response. Fields // that you do not specify are not returned. @@ -96,11 +114,14 @@ type ListObjectVersionsInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // Specifies the object version you want to start listing from. @@ -109,6 +130,13 @@ type ListObjectVersionsInput struct { noSmithyDocumentSerde } +func (in *ListObjectVersionsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Prefix = in.Prefix + +} + type ListObjectVersionsOutput struct { // All of the keys rolled up into a common prefix count as a single return when @@ -125,10 +153,13 @@ type ListObjectVersionsOutput struct { // max-keys limitation. These keys are not returned elsewhere in the response. Delimiter *string - // Encoding type used by Amazon S3 to encode object key names in the XML response. + // Encoding type used by Amazon S3 to encode object key names in the XML response. + // // If you specify the encoding-type request parameter, Amazon S3 includes this // element in the response, and returns encoded key name values in the following - // response elements: KeyMarker, NextKeyMarker, Prefix, Key , and Delimiter . + // response elements: + // + // KeyMarker, NextKeyMarker, Prefix, Key , and Delimiter . EncodingType types.EncodingType // A flag that indicates whether Amazon S3 returned all of the results that @@ -136,13 +167,13 @@ type ListObjectVersionsOutput struct { // follow-up paginated request by using the NextKeyMarker and NextVersionIdMarker // response parameters as a starting place in another request to return the rest of // the results. - IsTruncated bool + IsTruncated *bool // Marks the last key returned in a truncated response. KeyMarker *string // Specifies the maximum number of objects to return. - MaxKeys int32 + MaxKeys *int32 // The bucket name. Name *string @@ -163,6 +194,8 @@ type ListObjectVersionsOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Marks the last version of the key returned in a truncated response. @@ -178,6 +211,9 @@ type ListObjectVersionsOutput struct { } func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListObjectVersions{}, middleware.After) if err != nil { return err @@ -186,34 +222,38 @@ func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListObjectVersions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -225,10 +265,19 @@ func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListObjectVersionsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListObjectVersionsValidationMiddleware(stack); err != nil { @@ -240,7 +289,7 @@ func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListObjectVersionsUpdateEndpoint(stack, options); err != nil { @@ -258,12 +307,24 @@ func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -278,7 +339,6 @@ func newServiceMetadataMiddleware_opListObjectVersions(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListObjectVersions", } } @@ -308,139 +368,3 @@ func addListObjectVersionsUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListObjectVersionsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListObjectVersionsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListObjectVersionsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListObjectVersionsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListObjectVersionsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListObjectVersionsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjects.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjects.go index 19821bba..de91cd3b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjects.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjects.go @@ -4,33 +4,44 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Returns some or all (up to 1,000) of the objects in a bucket. You can use the // request parameters as selection criteria to return a subset of the objects in a // bucket. A 200 OK response can contain valid or invalid XML. Be sure to design // your application to parse the contents of the response and handle it -// appropriately. This action has been revised. We recommend that you use the newer -// version, ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) -// , when developing applications. For backward compatibility, Amazon S3 continues -// to support ListObjects . The following operations are related to ListObjects : -// - ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) +// appropriately. +// +// This action has been revised. We recommend that you use the newer version, [ListObjectsV2], +// when developing applications. For backward compatibility, Amazon S3 continues to +// support ListObjects . +// +// The following operations are related to ListObjects : +// +// [ListObjectsV2] +// +// [GetObject] +// +// [PutObject] +// +// [CreateBucket] +// +// [ListBuckets] +// +// [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [ListObjectsV2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html func (c *Client) ListObjects(ctx context.Context, params *ListObjectsInput, optFns ...func(*Options)) (*ListObjectsOutput, error) { if params == nil { params = &ListObjectsInput{} @@ -48,21 +59,40 @@ func (c *Client) ListObjects(ctx context.Context, params *ListObjectsInput, optF type ListObjectsInput struct { - // The name of the bucket containing the objects. When using this action with an - // access point, you must direct requests to the access point hostname. The access - // point hostname takes the form + // The name of the bucket containing the objects. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -70,17 +100,25 @@ type ListObjectsInput struct { // A delimiter is a character that you use to group keys. Delimiter *string - // Requests Amazon S3 to encode the object keys in the response and specifies the - // encoding method to use. An object key can contain any Unicode character; - // however, the XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in XML - // 1.0, you can add this parameter to request that Amazon S3 encode the keys in the - // response. + // Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + // encoded only in UTF-8. An object key can contain any Unicode character. However, + // the XML 1.0 parser can't parse certain characters, such as characters with an + // ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + // can add this parameter to request that Amazon S3 encode the keys in the + // response. For more information about characters to avoid in object key names, + // see [Object key naming guidelines]. + // + // When using the URL encoding type, non-ASCII characters that are used in an + // object's key name will be percent-encoded according to UTF-8 code values. For + // example, the object test_file(3).png will appear as test_file%283%29.png . + // + // [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + // [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html EncodingType types.EncodingType - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Marker is where you want Amazon S3 to start listing from. Amazon S3 starts @@ -90,7 +128,7 @@ type ListObjectsInput struct { // Sets the maximum number of keys returned in the response. By default, the // action returns up to 1,000 key names. The response might contain fewer keys but // will never contain more. - MaxKeys int32 + MaxKeys *int32 // Specifies the optional fields that you want returned in the response. Fields // that you do not specify are not returned. @@ -107,17 +145,30 @@ type ListObjectsInput struct { noSmithyDocumentSerde } +func (in *ListObjectsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Prefix = in.Prefix + +} + type ListObjectsOutput struct { // All of the keys (up to 1,000) rolled up in a common prefix count as a single - // return when calculating the number of returns. A response can contain - // CommonPrefixes only if you specify a delimiter. CommonPrefixes contains all (if - // there are any) keys between Prefix and the next occurrence of the string - // specified by the delimiter. CommonPrefixes lists keys that act like - // subdirectories in the directory specified by Prefix . For example, if the prefix - // is notes/ and the delimiter is a slash ( / ), as in notes/summer/july , the - // common prefix is notes/summer/ . All of the keys that roll up into a common - // prefix count as a single return when calculating the number of returns. + // return when calculating the number of returns. + // + // A response can contain CommonPrefixes only if you specify a delimiter. + // + // CommonPrefixes contains all (if there are any) keys between Prefix and the next + // occurrence of the string specified by the delimiter. + // + // CommonPrefixes lists keys that act like subdirectories in the directory + // specified by Prefix . + // + // For example, if the prefix is notes/ and the delimiter is a slash ( / ), as in + // notes/summer/july , the common prefix is notes/summer/ . All of the keys that + // roll up into a common prefix count as a single return when calculating the + // number of returns. CommonPrefixes []types.CommonPrefix // Metadata about each object returned. @@ -130,19 +181,32 @@ type ListObjectsOutput struct { // MaxKeys value. Delimiter *string - // Encoding type used by Amazon S3 to encode object keys in the response. + // Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + // encoded only in UTF-8. An object key can contain any Unicode character. However, + // the XML 1.0 parser can't parse certain characters, such as characters with an + // ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + // can add this parameter to request that Amazon S3 encode the keys in the + // response. For more information about characters to avoid in object key names, + // see [Object key naming guidelines]. + // + // When using the URL encoding type, non-ASCII characters that are used in an + // object's key name will be percent-encoded according to UTF-8 code values. For + // example, the object test_file(3).png will appear as test_file%283%29.png . + // + // [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + // [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html EncodingType types.EncodingType // A flag that indicates whether Amazon S3 returned all of the results that // satisfied the search criteria. - IsTruncated bool + IsTruncated *bool // Indicates where in the bucket listing begins. Marker is included in the // response if it was sent with the request. Marker *string // The maximum number of keys returned in the response body. - MaxKeys int32 + MaxKeys *int32 // The bucket name. Name *string @@ -150,11 +214,12 @@ type ListObjectsOutput struct { // When the response is truncated (the IsTruncated element value in the response // is true ), you can use the key name in this field as the marker parameter in // the subsequent request to get the next set of objects. Amazon S3 lists objects - // in alphabetical order. This element is returned only if you have the delimiter - // request parameter specified. If the response does not include the NextMarker - // element and it is truncated, you can use the value of the last Key element in - // the response as the marker parameter in the subsequent request to get the next - // set of object keys. + // in alphabetical order. + // + // This element is returned only if you have the delimiter request parameter + // specified. If the response does not include the NextMarker element and it is + // truncated, you can use the value of the last Key element in the response as the + // marker parameter in the subsequent request to get the next set of object keys. NextMarker *string // Keys that begin with the indicated prefix. @@ -162,6 +227,8 @@ type ListObjectsOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -171,6 +238,9 @@ type ListObjectsOutput struct { } func (c *Client) addOperationListObjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListObjects{}, middleware.After) if err != nil { return err @@ -179,34 +249,38 @@ func (c *Client) addOperationListObjectsMiddlewares(stack *middleware.Stack, opt if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListObjects"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -218,10 +292,19 @@ func (c *Client) addOperationListObjectsMiddlewares(stack *middleware.Stack, opt if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListObjectsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListObjectsValidationMiddleware(stack); err != nil { @@ -233,7 +316,7 @@ func (c *Client) addOperationListObjectsMiddlewares(stack *middleware.Stack, opt if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListObjectsUpdateEndpoint(stack, options); err != nil { @@ -251,12 +334,24 @@ func (c *Client) addOperationListObjectsMiddlewares(stack *middleware.Stack, opt if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -271,7 +366,6 @@ func newServiceMetadataMiddleware_opListObjects(region string) *awsmiddleware.Re return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListObjects", } } @@ -301,139 +395,3 @@ func addListObjectsUpdateEndpoint(stack *middleware.Stack, options Options) erro DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListObjectsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListObjectsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListObjectsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListObjectsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListObjectsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListObjectsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectsV2.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectsV2.go index db25aadf..6ba1083d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectsV2.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectsV2.go @@ -4,16 +4,11 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -22,25 +17,78 @@ import ( // You can use the request parameters as selection criteria to return a subset of // the objects in a bucket. A 200 OK response can contain valid or invalid XML. // Make sure to design your application to parse the contents of the response and -// handle it appropriately. Objects are returned sorted in an ascending order of -// the respective key names in the list. For more information about listing -// objects, see Listing object keys programmatically (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html) -// in the Amazon S3 User Guide. To use this operation, you must have READ access to -// the bucket. To use this action in an Identity and Access Management (IAM) -// policy, you must have permission to perform the s3:ListBucket action. The -// bucket owner has this permission by default and can grant this permission to -// others. For more information about permissions, see Permissions Related to -// Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. This section describes the latest revision of this -// action. We recommend that you use this revised API operation for application -// development. For backward compatibility, Amazon S3 continues to support the -// prior version of this API operation, ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) -// . To get a list of your buckets, see ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) -// . The following operations are related to ListObjectsV2 : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) +// handle it appropriately. For more information about listing objects, see [Listing object keys programmatically]in the +// Amazon S3 User Guide. To get a list of your buckets, see [ListBuckets]. +// +// - General purpose bucket - For general purpose buckets, ListObjectsV2 doesn't +// return prefixes that are related only to in-progress multipart uploads. +// +// - Directory buckets - For directory buckets, ListObjectsV2 response includes +// the prefixes that are related only to in-progress multipart uploads. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// +// - General purpose bucket permissions - To use this operation, you must have +// READ access to the bucket. You must have permission to perform the +// s3:ListBucket action. The bucket owner has this permission by default and can +// grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] +// and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// Sorting order of returned objects +// +// - General purpose bucket - For general purpose buckets, ListObjectsV2 returns +// objects in lexicographical order based on their key names. +// +// - Directory bucket - For directory buckets, ListObjectsV2 does not return +// objects in lexicographical order. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// This section describes the latest revision of this action. We recommend that +// you use this revised API operation for application development. For backward +// compatibility, Amazon S3 continues to support the prior version of this API +// operation, [ListObjects]. +// +// The following operations are related to ListObjectsV2 : +// +// [GetObject] +// +// [PutObject] +// +// [CreateBucket] +// +// [ListObjects]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Listing object keys programmatically]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html +// [ListBuckets]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html func (c *Client) ListObjectsV2(ctx context.Context, params *ListObjectsV2Input, optFns ...func(*Options)) (*ListObjectsV2Output, error) { if params == nil { params = &ListObjectsV2Input{} @@ -58,85 +106,165 @@ func (c *Client) ListObjectsV2(ctx context.Context, params *ListObjectsV2Input, type ListObjectsV2Input struct { - // Bucket name to list. When using this action with an access point, you must - // direct requests to the access point hostname. The access point hostname takes - // the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When - // using this action with an access point through the Amazon Web Services SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form + // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + // action with an access point through the Amazon Web Services SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string // ContinuationToken indicates to Amazon S3 that the list is being continued on - // this bucket with a token. ContinuationToken is obfuscated and is not a real key. + // this bucket with a token. ContinuationToken is obfuscated and is not a real + // key. You can use this ContinuationToken for pagination of the list results. ContinuationToken *string // A delimiter is a character that you use to group keys. + // + // - Directory buckets - For directory buckets, / is the only supported delimiter. + // + // - Directory buckets - When you query ListObjectsV2 with a delimiter during + // in-progress multipart uploads, the CommonPrefixes response parameter contains + // the prefixes that are associated with the in-progress multipart uploads. For + // more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. + // + // [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html Delimiter *string - // Encoding type used by Amazon S3 to encode object keys in the response. + // Encoding type used by Amazon S3 to encode the [object keys] in the response. Responses are + // encoded only in UTF-8. An object key can contain any Unicode character. However, + // the XML 1.0 parser can't parse certain characters, such as characters with an + // ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you + // can add this parameter to request that Amazon S3 encode the keys in the + // response. For more information about characters to avoid in object key names, + // see [Object key naming guidelines]. + // + // When using the URL encoding type, non-ASCII characters that are used in an + // object's key name will be percent-encoded according to UTF-8 code values. For + // example, the object test_file(3).png will appear as test_file%283%29.png . + // + // [Object key naming guidelines]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines + // [object keys]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html EncodingType types.EncodingType - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The owner field is not present in ListObjectsV2 by default. If you want to // return the owner field with each key in the result, then set the FetchOwner // field to true . - FetchOwner bool + // + // Directory buckets - For directory buckets, the bucket owner is returned as the + // object owner for all objects. + FetchOwner *bool // Sets the maximum number of keys returned in the response. By default, the // action returns up to 1,000 key names. The response might contain fewer keys but // will never contain more. - MaxKeys int32 + MaxKeys *int32 // Specifies the optional fields that you want returned in the response. Fields // that you do not specify are not returned. + // + // This functionality is not supported for directory buckets. OptionalObjectAttributes []types.OptionalObjectAttributes // Limits the response to keys that begin with the specified prefix. + // + // Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. Prefix *string // Confirms that the requester knows that she or he will be charged for the list // objects request in V2 style. Bucket owners need not specify this parameter in // their requests. + // + // This functionality is not supported for directory buckets. RequestPayer types.RequestPayer // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts // listing after this specified key. StartAfter can be any key in the bucket. + // + // This functionality is not supported for directory buckets. StartAfter *string noSmithyDocumentSerde } +func (in *ListObjectsV2Input) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Prefix = in.Prefix + +} + type ListObjectsV2Output struct { - // All of the keys (up to 1,000) rolled up into a common prefix count as a single - // return when calculating the number of returns. A response can contain - // CommonPrefixes only if you specify a delimiter. CommonPrefixes contains all (if - // there are any) keys between Prefix and the next occurrence of the string - // specified by a delimiter. CommonPrefixes lists keys that act like - // subdirectories in the directory specified by Prefix . For example, if the prefix - // is notes/ and the delimiter is a slash ( / ) as in notes/summer/july , the - // common prefix is notes/summer/ . All of the keys that roll up into a common - // prefix count as a single return when calculating the number of returns. + // All of the keys (up to 1,000) that share the same prefix are grouped together. + // When counting the total numbers of returns by this API operation, this group of + // keys is considered as one item. + // + // A response can contain CommonPrefixes only if you specify a delimiter. + // + // CommonPrefixes contains all (if there are any) keys between Prefix and the next + // occurrence of the string specified by a delimiter. + // + // CommonPrefixes lists keys that act like subdirectories in the directory + // specified by Prefix . + // + // For example, if the prefix is notes/ and the delimiter is a slash ( / ) as in + // notes/summer/july , the common prefix is notes/summer/ . All of the keys that + // roll up into a common prefix count as a single return when calculating the + // number of returns. + // + // - Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. + // + // - Directory buckets - When you query ListObjectsV2 with a delimiter during + // in-progress multipart uploads, the CommonPrefixes response parameter contains + // the prefixes that are associated with the in-progress multipart uploads. For + // more information about multipart uploads, see [Multipart Upload Overview]in the Amazon S3 User Guide. + // + // [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html CommonPrefixes []types.CommonPrefix // Metadata about each object returned. Contents []types.Object - // If ContinuationToken was sent with the request, it is included in the response. + // If ContinuationToken was sent with the request, it is included in the + // response. You can use the returned ContinuationToken for pagination of the list + // response. You can use this ContinuationToken for pagination of the list + // results. ContinuationToken *string // Causes keys that contain the same string between the prefix and the first @@ -144,43 +272,35 @@ type ListObjectsV2Output struct { // CommonPrefixes collection. These rolled-up keys are not returned elsewhere in // the response. Each rolled-up result counts as only one return against the // MaxKeys value. + // + // Directory buckets - For directory buckets, / is the only supported delimiter. Delimiter *string // Encoding type used by Amazon S3 to encode object key names in the XML response. + // // If you specify the encoding-type request parameter, Amazon S3 includes this // element in the response, and returns encoded key name values in the following - // response elements: Delimiter, Prefix, Key, and StartAfter . + // response elements: + // + // Delimiter, Prefix, Key, and StartAfter . EncodingType types.EncodingType // Set to false if all of the results were returned. Set to true if more keys are // available to return. If the number of results exceeds that specified by MaxKeys // , all of the results might not be returned. - IsTruncated bool + IsTruncated *bool // KeyCount is the number of keys returned with this request. KeyCount will always // be less than or equal to the MaxKeys field. For example, if you ask for 50 // keys, your result will include 50 keys or fewer. - KeyCount int32 + KeyCount *int32 // Sets the maximum number of keys returned in the response. By default, the // action returns up to 1,000 key names. The response might contain fewer keys but // will never contain more. - MaxKeys int32 + MaxKeys *int32 - // The bucket name. When using this action with an access point, you must direct - // requests to the access point hostname. The access point hostname takes the form - // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - // action with an access point through the Amazon Web Services SDKs, you provide - // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you - // use this action with S3 on Outposts through the Amazon Web Services SDKs, you - // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // The bucket name. Name *string // NextContinuationToken is sent when isTruncated is true, which means there are @@ -190,13 +310,20 @@ type ListObjectsV2Output struct { NextContinuationToken *string // Keys that begin with the indicated prefix. + // + // Directory buckets - For directory buckets, only prefixes that end in a + // delimiter ( / ) are supported. Prefix *string // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If StartAfter was sent with the request, it is included in the response. + // + // This functionality is not supported for directory buckets. StartAfter *string // Metadata pertaining to the operation's result. @@ -206,6 +333,9 @@ type ListObjectsV2Output struct { } func (c *Client) addOperationListObjectsV2Middlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListObjectsV2{}, middleware.After) if err != nil { return err @@ -214,34 +344,38 @@ func (c *Client) addOperationListObjectsV2Middlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListObjectsV2"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -253,10 +387,19 @@ func (c *Client) addOperationListObjectsV2Middlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListObjectsV2ResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListObjectsV2ValidationMiddleware(stack); err != nil { @@ -268,7 +411,7 @@ func (c *Client) addOperationListObjectsV2Middlewares(stack *middleware.Stack, o if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListObjectsV2UpdateEndpoint(stack, options); err != nil { @@ -286,29 +429,27 @@ func (c *Client) addOperationListObjectsV2Middlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } - return nil -} - -func (v *ListObjectsV2Input) bucket() (string, bool) { - if v.Bucket == nil { - return "", false + if err = addSpanInitializeStart(stack); err != nil { + return err } - return *v.Bucket, true -} - -// ListObjectsV2APIClient is a client that implements the ListObjectsV2 operation. -type ListObjectsV2APIClient interface { - ListObjectsV2(context.Context, *ListObjectsV2Input, ...func(*Options)) (*ListObjectsV2Output, error) + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil } -var _ ListObjectsV2APIClient = (*Client)(nil) - // ListObjectsV2PaginatorOptions is the paginator options for ListObjectsV2 type ListObjectsV2PaginatorOptions struct { // Sets the maximum number of keys returned in the response. By default, the @@ -337,8 +478,8 @@ func NewListObjectsV2Paginator(client ListObjectsV2APIClient, params *ListObject } options := ListObjectsV2PaginatorOptions{} - if params.MaxKeys != 0 { - options.Limit = params.MaxKeys + if params.MaxKeys != nil { + options.Limit = *params.MaxKeys } for _, fn := range optFns { @@ -368,8 +509,15 @@ func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*O params := *p.params params.ContinuationToken = p.nextToken - params.MaxKeys = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxKeys = limit + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) result, err := p.client.ListObjectsV2(ctx, ¶ms, optFns...) if err != nil { return nil, err @@ -378,7 +526,7 @@ func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*O prevToken := p.nextToken p.nextToken = nil - if result.IsTruncated { + if result.IsTruncated != nil && *result.IsTruncated { p.nextToken = result.NextContinuationToken } @@ -392,11 +540,24 @@ func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*O return result, nil } +func (v *ListObjectsV2Input) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +// ListObjectsV2APIClient is a client that implements the ListObjectsV2 operation. +type ListObjectsV2APIClient interface { + ListObjectsV2(context.Context, *ListObjectsV2Input, ...func(*Options)) (*ListObjectsV2Output, error) +} + +var _ ListObjectsV2APIClient = (*Client)(nil) + func newServiceMetadataMiddleware_opListObjectsV2(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListObjectsV2", } } @@ -426,139 +587,3 @@ func addListObjectsV2UpdateEndpoint(stack *middleware.Stack, options Options) er DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListObjectsV2ResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListObjectsV2ResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListObjectsV2ResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListObjectsV2Input) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListObjectsV2ResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListObjectsV2ResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListParts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListParts.go index 14ef6f91..c4a8b617 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListParts.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListParts.go @@ -4,43 +4,91 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) -// Lists the parts that have been uploaded for a specific multipart upload. This -// operation must include the upload ID, which you obtain by sending the initiate -// multipart upload request (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// ). This request returns a maximum of 1,000 uploaded parts. The default number of -// parts returned is 1,000 parts. You can restrict the number of parts returned by -// specifying the max-parts request parameter. If your multipart upload consists -// of more than 1,000 parts, the response returns an IsTruncated field with the -// value of true, and a NextPartNumberMarker element. In subsequent ListParts -// requests you can include the part-number-marker query string parameter and set -// its value to the NextPartNumberMarker field value from the previous response. -// If the upload was created using a checksum algorithm, you will need to have -// permission to the kms:Decrypt action for the request to succeed. For more -// information on multipart uploads, see Uploading Objects Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// . For information on permissions required to use the multipart upload API, see -// Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// . The following operations are related to ListParts : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// Lists the parts that have been uploaded for a specific multipart upload. +// +// To use this operation, you must provide the upload ID in the request. You +// obtain this uploadID by sending the initiate multipart upload request through [CreateMultipartUpload]. +// +// The ListParts request returns a maximum of 1,000 uploaded parts. The limit of +// 1,000 parts is also the default value. You can restrict the number of parts in a +// response by specifying the max-parts request parameter. If your multipart +// upload consists of more than 1,000 parts, the response returns an IsTruncated +// field with the value of true , and a NextPartNumberMarker element. To list +// remaining uploaded parts, in subsequent ListParts requests, include the +// part-number-marker query string parameter and set its value to the +// NextPartNumberMarker field value from the previous response. +// +// For more information on multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// - General purpose bucket permissions - For information about permissions +// required to use the multipart upload API, see [Multipart Upload and Permissions]in the Amazon S3 User Guide. +// +// If the upload was created using server-side encryption with Key Management +// +// Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon +// Web Services KMS keys (DSSE-KMS), you must have permission to the kms:Decrypt +// action for the ListParts request to succeed. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// The following operations are related to ListParts : +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [AbortMultipartUpload] +// +// [GetObjectAttributes] +// +// [ListMultipartUploads] +// +// [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [GetObjectAttributes]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [Multipart Upload and Permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html func (c *Client) ListParts(ctx context.Context, params *ListPartsInput, optFns ...func(*Options)) (*ListPartsOutput, error) { if params == nil { params = &ListPartsInput{} @@ -58,21 +106,40 @@ func (c *Client) ListParts(ctx context.Context, params *ListPartsInput, optFns . type ListPartsInput struct { - // The name of the bucket to which the parts are being uploaded. When using this - // action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form + // The name of the bucket to which the parts are being uploaded. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -87,13 +154,13 @@ type ListPartsInput struct { // This member is required. UploadId *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Sets the maximum number of parts to return. - MaxParts int32 + MaxParts *int32 // Specifies the part after which listing should begin. Only parts with higher // part numbers will be listed. @@ -101,49 +168,74 @@ type ListPartsInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The server-side encryption (SSE) algorithm used to encrypt the object. This // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerAlgorithm *string // The server-side encryption (SSE) customer managed key. This parameter is needed // only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKey *string // The MD5 server-side encryption (SSE) customer managed key. This parameter is // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKeyMD5 *string noSmithyDocumentSerde } +func (in *ListPartsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type ListPartsOutput struct { // If the bucket has a lifecycle rule configured with an action to abort // incomplete multipart uploads and the prefix in the lifecycle rule matches the // object name in the request, then the response includes this header indicating // when the initiated multipart upload will become eligible for abort operation. - // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // . The response will also include the x-amz-abort-rule-id header that will - // provide the ID of the lifecycle configuration rule that defines this action. + // For more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]. + // + // The response will also include the x-amz-abort-rule-id header that will provide + // the ID of the lifecycle configuration rule that defines this action. + // + // This functionality is not supported for directory buckets. + // + // [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config AbortDate *time.Time // This header is returned along with the x-amz-abort-date header. It identifies // applicable lifecycle configuration rule that defines the action to abort // incomplete multipart uploads. + // + // This functionality is not supported for directory buckets. AbortRuleId *string // The name of the bucket to which the multipart upload was initiated. Does not @@ -159,16 +251,16 @@ type ListPartsOutput struct { // provides the user ARN and display name. Initiator *types.Initiator - // Indicates whether the returned list of parts is truncated. A true value + // Indicates whether the returned list of parts is truncated. A true value // indicates that the list was truncated. A list can be truncated if the number of // parts exceeds the limit returned in the MaxParts element. - IsTruncated bool + IsTruncated *bool // Object key for which the multipart upload was initiated. Key *string // Maximum number of parts that were allowed in the response. - MaxParts int32 + MaxParts *int32 // When a list is truncated, this element specifies the last part in the list, as // well as the value to use for the part-number-marker request parameter in a @@ -178,11 +270,13 @@ type ListPartsOutput struct { // Container element that identifies the object owner, after the object is // created. If multipart upload is initiated by an IAM user, this element provides // the parent account ID and display name. + // + // Directory buckets - The bucket owner is returned as the object owner for all + // the parts. Owner *types.Owner - // When a list is truncated, this element specifies the last part in the list, as - // well as the value to use for the part-number-marker request parameter in a - // subsequent request. + // Specifies the part after which listing should begin. Only parts with higher + // part numbers will be listed. PartNumberMarker *string // Container for elements related to a particular part. A response can contain @@ -191,10 +285,14 @@ type ListPartsOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged - // Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded - // object. + // The class of storage used to store the uploaded object. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. StorageClass types.StorageClass // Upload ID identifying the multipart upload whose parts are being listed. @@ -207,6 +305,9 @@ type ListPartsOutput struct { } func (c *Client) addOperationListPartsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpListParts{}, middleware.After) if err != nil { return err @@ -215,34 +316,38 @@ func (c *Client) addOperationListPartsMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListParts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -254,10 +359,19 @@ func (c *Client) addOperationListPartsMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addListPartsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpListPartsValidationMiddleware(stack); err != nil { @@ -269,7 +383,7 @@ func (c *Client) addOperationListPartsMiddlewares(stack *middleware.Stack, optio if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addListPartsUpdateEndpoint(stack, options); err != nil { @@ -287,29 +401,27 @@ func (c *Client) addOperationListPartsMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } - return nil -} - -func (v *ListPartsInput) bucket() (string, bool) { - if v.Bucket == nil { - return "", false + if err = addSpanInitializeStart(stack); err != nil { + return err } - return *v.Bucket, true -} - -// ListPartsAPIClient is a client that implements the ListParts operation. -type ListPartsAPIClient interface { - ListParts(context.Context, *ListPartsInput, ...func(*Options)) (*ListPartsOutput, error) + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil } -var _ ListPartsAPIClient = (*Client)(nil) - // ListPartsPaginatorOptions is the paginator options for ListParts type ListPartsPaginatorOptions struct { // Sets the maximum number of parts to return. @@ -336,8 +448,8 @@ func NewListPartsPaginator(client ListPartsAPIClient, params *ListPartsInput, op } options := ListPartsPaginatorOptions{} - if params.MaxParts != 0 { - options.Limit = params.MaxParts + if params.MaxParts != nil { + options.Limit = *params.MaxParts } for _, fn := range optFns { @@ -367,8 +479,15 @@ func (p *ListPartsPaginator) NextPage(ctx context.Context, optFns ...func(*Optio params := *p.params params.PartNumberMarker = p.nextToken - params.MaxParts = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxParts = limit + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) result, err := p.client.ListParts(ctx, ¶ms, optFns...) if err != nil { return nil, err @@ -377,7 +496,7 @@ func (p *ListPartsPaginator) NextPage(ctx context.Context, optFns ...func(*Optio prevToken := p.nextToken p.nextToken = nil - if result.IsTruncated { + if result.IsTruncated != nil && *result.IsTruncated { p.nextToken = result.NextPartNumberMarker } @@ -391,11 +510,24 @@ func (p *ListPartsPaginator) NextPage(ctx context.Context, optFns ...func(*Optio return result, nil } +func (v *ListPartsInput) bucket() (string, bool) { + if v.Bucket == nil { + return "", false + } + return *v.Bucket, true +} + +// ListPartsAPIClient is a client that implements the ListParts operation. +type ListPartsAPIClient interface { + ListParts(context.Context, *ListPartsInput, ...func(*Options)) (*ListPartsOutput, error) +} + +var _ ListPartsAPIClient = (*Client)(nil) + func newServiceMetadataMiddleware_opListParts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "ListParts", } } @@ -424,139 +556,3 @@ func addListPartsUpdateEndpoint(stack *middleware.Stack, options Options) error DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opListPartsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opListPartsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opListPartsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*ListPartsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addListPartsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opListPartsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAccelerateConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAccelerateConfiguration.go index 723273d9..737f8bfd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAccelerateConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAccelerateConfiguration.go @@ -4,44 +4,56 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer // Acceleration is a bucket-level feature that enables you to perform faster data -// transfers to Amazon S3. To use this operation, you must have permission to -// perform the s3:PutAccelerateConfiguration action. The bucket owner has this -// permission by default. The bucket owner can grant this permission to others. For -// more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . The Transfer Acceleration state of a bucket can be set to one of the following +// transfers to Amazon S3. +// +// To use this operation, you must have permission to perform the +// s3:PutAccelerateConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// The Transfer Acceleration state of a bucket can be set to one of the following // two values: +// // - Enabled – Enables accelerated data transfers to the bucket. +// // - Suspended – Disables accelerated data transfers to the bucket. // -// The GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) -// action returns the transfer acceleration state of a bucket. After setting the -// Transfer Acceleration state of a bucket to Enabled, it might take up to thirty -// minutes before the data transfer rates to the bucket increase. The name of the -// bucket used for Transfer Acceleration must be DNS-compliant and must not contain -// periods ("."). For more information about transfer acceleration, see Transfer -// Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// . The following operations are related to PutBucketAccelerateConfiguration : -// - GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) +// The [GetBucketAccelerateConfiguration] action returns the transfer acceleration state of a bucket. +// +// After setting the Transfer Acceleration state of a bucket to Enabled, it might +// take up to thirty minutes before the data transfer rates to the bucket increase. +// +// The name of the bucket used for Transfer Acceleration must be DNS-compliant and +// must not contain periods ("."). +// +// For more information about transfer acceleration, see [Transfer Acceleration]. +// +// The following operations are related to PutBucketAccelerateConfiguration : +// +// [GetBucketAccelerateConfiguration] +// +// [CreateBucket] +// +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html +// [GetBucketAccelerateConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html func (c *Client) PutBucketAccelerateConfiguration(ctx context.Context, params *PutBucketAccelerateConfigurationInput, optFns ...func(*Options)) (*PutBucketAccelerateConfigurationOutput, error) { if params == nil { params = &PutBucketAccelerateConfigurationInput{} @@ -69,24 +81,33 @@ type PutBucketAccelerateConfigurationInput struct { // This member is required. Bucket *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketAccelerateConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketAccelerateConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -95,6 +116,9 @@ type PutBucketAccelerateConfigurationOutput struct { } func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketAccelerateConfiguration{}, middleware.After) if err != nil { return err @@ -103,34 +127,38 @@ func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack * if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketAccelerateConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -142,10 +170,19 @@ func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack * if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketAccelerateConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketAccelerateConfigurationValidationMiddleware(stack); err != nil { @@ -157,7 +194,7 @@ func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack * if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketAccelerateConfigurationInputChecksumMiddlewares(stack, options); err != nil { @@ -178,12 +215,24 @@ func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack * if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -198,7 +247,6 @@ func newServiceMetadataMiddleware_opPutBucketAccelerateConfiguration(region stri return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketAccelerateConfiguration", } } @@ -248,139 +296,3 @@ func addPutBucketAccelerateConfigurationUpdateEndpoint(stack *middleware.Stack, DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketAccelerateConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketAccelerateConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketAccelerateConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketAccelerateConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketAccelerateConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketAccelerateConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAcl.go index bb706bbe..eeac549e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAcl.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAcl.go @@ -4,103 +4,170 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the permissions on an existing bucket using access control lists (ACL). -// For more information, see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) -// . To set the ACL of a bucket, you must have WRITE_ACP permission. You can use -// one of the following two ways to set a bucket's permissions: +// For more information, see [Using ACLs]. To set the ACL of a bucket, you must have the +// WRITE_ACP permission. +// +// You can use one of the following two ways to set a bucket's permissions: +// // - Specify the ACL in the request body +// // - Specify permissions using request headers // // You cannot specify access permission using both the body and the request -// headers. Depending on your application needs, you may choose to set the ACL on a -// bucket using either the request body or the headers. For example, if you have an +// headers. +// +// Depending on your application needs, you may choose to set the ACL on a bucket +// using either the request body or the headers. For example, if you have an // existing application that updates a bucket ACL using the request body, then you -// can continue to use that approach. If your bucket uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect -// permissions. You must use policies to grant access to your bucket and the -// objects in it. Requests to set ACLs or update ACLs fail and return the -// AccessControlListNotSupported error code. Requests to read ACLs are still -// supported. For more information, see Controlling object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. Permissions You can set access permissions by using -// one of the following methods: +// can continue to use that approach. +// +// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, +// ACLs are disabled and no longer affect permissions. You must use policies to +// grant access to your bucket and the objects in it. Requests to set ACLs or +// update ACLs fail and return the AccessControlListNotSupported error code. +// Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the +// Amazon S3 User Guide. +// +// Permissions You can set access permissions by using one of the following +// methods: +// // - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a // set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined // set of grantees and permissions. Specify the canned ACL name as the value of // x-amz-acl . If you use this header, you cannot use other access -// control-specific headers in your request. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) -// . +// control-specific headers in your request. For more information, see [Canned ACL]. +// // - Specify access permissions explicitly with the x-amz-grant-read , // x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control // headers. When using these headers, you specify explicit access permissions and // grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the // permission. If you use these ACL-specific headers, you cannot use the // x-amz-acl header to set a canned ACL. These parameters map to the set of -// permissions that Amazon S3 supports in an ACL. For more information, see -// Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// . You specify each grantee as a type=value pair, where the type is one of the -// following: -// - id – if the value specified is the canonical user ID of an Amazon Web -// Services account -// - uri – if you are granting permissions to a predefined group -// - emailAddress – if the value specified is the email address of an Amazon Web -// Services account Using email addresses to specify a grantee is only supported in -// the following Amazon Web Services Regions: -// - US East (N. Virginia) -// - US West (N. California) -// - US West (Oregon) -// - Asia Pacific (Singapore) -// - Asia Pacific (Sydney) -// - Asia Pacific (Tokyo) -// - Europe (Ireland) -// - South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-write header grants create, overwrite, and delete objects -// permission to LogDelivery group predefined by Amazon S3 and two Amazon Web -// Services accounts identified by their email addresses. x-amz-grant-write: -// uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333", -// id="555566667777" +// permissions that Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. +// +// You specify each grantee as a type=value pair, where the type is one of the +// +// following: +// +// - id – if the value specified is the canonical user ID of an Amazon Web +// Services account +// +// - uri – if you are granting permissions to a predefined group +// +// - emailAddress – if the value specified is the email address of an Amazon Web +// Services account +// +// Using email addresses to specify a grantee is only supported in the following +// +// Amazon Web Services Regions: +// +// - US East (N. Virginia) +// +// - US West (N. California) +// +// - US West (Oregon) +// +// - Asia Pacific (Singapore) +// +// - Asia Pacific (Sydney) +// +// - Asia Pacific (Tokyo) +// +// - Europe (Ireland) +// +// - South America (São Paulo) +// +// For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the +// +// Amazon Web Services General Reference. +// +// For example, the following x-amz-grant-write header grants create, overwrite, +// +// and delete objects permission to LogDelivery group predefined by Amazon S3 and +// two Amazon Web Services accounts identified by their email addresses. +// +// x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", +// +// id="111122223333", id="555566667777" // // You can use either a canned ACL or specify access permissions explicitly. You -// cannot do both. Grantee Values You can specify the person (grantee) to whom -// you're assigning access rights (using request elements) in the following ways: -// - By the person's ID: <>ID<><>GranteesEmail<> DisplayName is optional and -// ignored in the request -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> -// - By Email address: <>Grantees@email.com<>& The grantee is resolved to the -// CanonicalUser and, in a response to a GET Object acl request, appears as the -// CanonicalUser. Using email addresses to specify a grantee is only supported in -// the following Amazon Web Services Regions: -// - US East (N. Virginia) -// - US West (N. California) -// - US West (Oregon) -// - Asia Pacific (Singapore) -// - Asia Pacific (Sydney) -// - Asia Pacific (Tokyo) -// - Europe (Ireland) -// - South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. +// cannot do both. +// +// Grantee Values You can specify the person (grantee) to whom you're assigning +// access rights (using request elements) in the following ways: +// +// - By the person's ID: +// +// <>ID<><>GranteesEmail<> +// +// DisplayName is optional and ignored in the request +// +// - By URI: +// +// <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// +// - By Email address: +// +// <>Grantees@email.com<>& +// +// The grantee is resolved to the CanonicalUser and, in a response to a GET Object +// +// acl request, appears as the CanonicalUser. +// +// Using email addresses to specify a grantee is only supported in the following +// +// Amazon Web Services Regions: +// +// - US East (N. Virginia) +// +// - US West (N. California) +// +// - US West (Oregon) +// +// - Asia Pacific (Singapore) +// +// - Asia Pacific (Sydney) +// +// - Asia Pacific (Tokyo) +// +// - Europe (Ireland) +// +// - South America (São Paulo) +// +// For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the +// +// Amazon Web Services General Reference. // // The following operations are related to PutBucketAcl : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) +// +// [CreateBucket] +// +// [DeleteBucket] +// +// [GetObjectAcl] +// +// [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region +// [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html +// [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html +// [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html +// [Using ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html +// [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL +// [GetObjectAcl]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html func (c *Client) PutBucketAcl(ctx context.Context, params *PutBucketAclInput, optFns ...func(*Options)) (*PutBucketAclOutput, error) { if params == nil { params = &PutBucketAclInput{} @@ -129,26 +196,32 @@ type PutBucketAclInput struct { // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *types.AccessControlPolicy - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. This header must be used as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, go to RFC 1864. (http://www.ietf.org/rfc/rfc1864.txt) + // transit. For more information, go to [RFC 1864.] + // // For requests made using the Amazon Web Services Command Line Interface (CLI) or // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Allows grantee the read, write, read ACP, and write ACP permissions on the @@ -161,9 +234,10 @@ type PutBucketAclInput struct { // Allows grantee to read the bucket ACL. GrantReadACP *string - // Allows grantee to create new objects in the bucket. For the bucket and object - // owners of existing objects, also allows deletions and overwrites of those - // objects. + // Allows grantee to create new objects in the bucket. + // + // For the bucket and object owners of existing objects, also allows deletions and + // overwrites of those objects. GrantWrite *string // Allows grantee to write the ACL for the applicable bucket. @@ -172,6 +246,12 @@ type PutBucketAclInput struct { noSmithyDocumentSerde } +func (in *PutBucketAclInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketAclOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -180,6 +260,9 @@ type PutBucketAclOutput struct { } func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketAcl{}, middleware.After) if err != nil { return err @@ -188,34 +271,38 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketAcl"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -227,10 +314,19 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addPutBucketAclResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketAclValidationMiddleware(stack); err != nil { @@ -242,7 +338,7 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketAclInputChecksumMiddlewares(stack, options); err != nil { @@ -263,12 +359,27 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -283,7 +394,6 @@ func newServiceMetadataMiddleware_opPutBucketAcl(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketAcl", } } @@ -333,139 +443,3 @@ func addPutBucketAclUpdateEndpoint(stack *middleware.Stack, options Options) err DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketAclResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketAclResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketAclResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketAclResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketAclResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAnalyticsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAnalyticsConfiguration.go index 581c5ca4..ff457d60 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAnalyticsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketAnalyticsConfiguration.go @@ -4,22 +4,21 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets an analytics configuration for the bucket (specified by the analytics // configuration ID). You can have up to 1,000 analytics configurations per bucket. +// // You can choose to have storage class analysis export analysis reports sent to a // comma-separated values (CSV) flat file. See the DataExport request element. // Reports are updated daily and are based on the object filters that you @@ -27,36 +26,55 @@ import ( // optional destination prefix where the file is written. You can export the data // to a destination bucket in a different account. However, the destination bucket // must be in the same Region as the bucket that you are making the PUT analytics -// configuration to. For more information, see Amazon S3 Analytics – Storage Class -// Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// . You must create a bucket policy on the destination bucket where the exported +// configuration to. For more information, see [Amazon S3 Analytics – Storage Class Analysis]. +// +// You must create a bucket policy on the destination bucket where the exported // file is written to grant permissions to Amazon S3 to write objects to the -// bucket. For an example policy, see Granting Permissions for Amazon S3 Inventory -// and Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9) -// . To use this operation, you must have permissions to perform the +// bucket. For an example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. +// +// To use this operation, you must have permissions to perform the // s3:PutAnalyticsConfiguration action. The bucket owner has this permission by // default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . PutBucketAnalyticsConfiguration has the following special errors: +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// PutBucketAnalyticsConfiguration has the following special errors: +// // - HTTP Error: HTTP 400 Bad Request +// // - Code: InvalidArgument +// // - Cause: Invalid argument. +// // - HTTP Error: HTTP 400 Bad Request +// // - Code: TooManyConfigurations +// // - Cause: You are attempting to create a new configuration but have already // reached the 1,000-configuration limit. +// // - HTTP Error: HTTP 403 Forbidden +// // - Code: AccessDenied +// // - Cause: You are not the owner of the specified bucket, or you do not have // the s3:PutAnalyticsConfiguration bucket permission to set the configuration on // the bucket. // // The following operations are related to PutBucketAnalyticsConfiguration : -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) +// +// [GetBucketAnalyticsConfiguration] +// +// [DeleteBucketAnalyticsConfiguration] +// +// [ListBucketAnalyticsConfigurations] +// +// [Amazon S3 Analytics – Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html +// [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 +// [DeleteBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [GetBucketAnalyticsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html +// [ListBucketAnalyticsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) PutBucketAnalyticsConfiguration(ctx context.Context, params *PutBucketAnalyticsConfigurationInput, optFns ...func(*Options)) (*PutBucketAnalyticsConfigurationOutput, error) { if params == nil { params = &PutBucketAnalyticsConfigurationInput{} @@ -89,14 +107,20 @@ type PutBucketAnalyticsConfigurationInput struct { // This member is required. Id *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketAnalyticsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketAnalyticsConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -105,6 +129,9 @@ type PutBucketAnalyticsConfigurationOutput struct { } func (c *Client) addOperationPutBucketAnalyticsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketAnalyticsConfiguration{}, middleware.After) if err != nil { return err @@ -113,34 +140,38 @@ func (c *Client) addOperationPutBucketAnalyticsConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketAnalyticsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -152,10 +183,19 @@ func (c *Client) addOperationPutBucketAnalyticsConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addPutBucketAnalyticsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketAnalyticsConfigurationValidationMiddleware(stack); err != nil { @@ -167,7 +207,7 @@ func (c *Client) addOperationPutBucketAnalyticsConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketAnalyticsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -185,12 +225,24 @@ func (c *Client) addOperationPutBucketAnalyticsConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -205,7 +257,6 @@ func newServiceMetadataMiddleware_opPutBucketAnalyticsConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketAnalyticsConfiguration", } } @@ -235,139 +286,3 @@ func addPutBucketAnalyticsConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketAnalyticsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketAnalyticsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketAnalyticsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketAnalyticsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketAnalyticsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketAnalyticsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketCors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketCors.go index 7a1f49c3..9eaa35fe 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketCors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketCors.go @@ -4,49 +4,65 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the cors configuration for your bucket. If the configuration exists, -// Amazon S3 replaces it. To use this operation, you must be allowed to perform the -// s3:PutBucketCORS action. By default, the bucket owner has this permission and -// can grant it to others. You set this configuration on a bucket so that the -// bucket can service cross-origin requests. For example, you might want to enable -// a request whose origin is http://www.example.com to access your Amazon S3 -// bucket at my.example.bucket.com by using the browser's XMLHttpRequest -// capability. To enable cross-origin resource sharing (CORS) on a bucket, you add -// the cors subresource to the bucket. The cors subresource is an XML document in -// which you configure rules that identify origins and the HTTP methods that can be -// executed on your bucket. The document is limited to 64 KB in size. When Amazon -// S3 receives a cross-origin request (or a pre-flight OPTIONS request) against a -// bucket, it evaluates the cors configuration on the bucket and uses the first -// CORSRule rule that matches the incoming browser request to enable a cross-origin -// request. For a rule to match, the following conditions must be met: +// Amazon S3 replaces it. +// +// To use this operation, you must be allowed to perform the s3:PutBucketCORS +// action. By default, the bucket owner has this permission and can grant it to +// others. +// +// You set this configuration on a bucket so that the bucket can service +// cross-origin requests. For example, you might want to enable a request whose +// origin is http://www.example.com to access your Amazon S3 bucket at +// my.example.bucket.com by using the browser's XMLHttpRequest capability. +// +// To enable cross-origin resource sharing (CORS) on a bucket, you add the cors +// subresource to the bucket. The cors subresource is an XML document in which you +// configure rules that identify origins and the HTTP methods that can be executed +// on your bucket. The document is limited to 64 KB in size. +// +// When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS +// request) against a bucket, it evaluates the cors configuration on the bucket +// and uses the first CORSRule rule that matches the incoming browser request to +// enable a cross-origin request. For a rule to match, the following conditions +// must be met: +// // - The request's Origin header must match AllowedOrigin elements. +// // - The request method (for example, GET, PUT, HEAD, and so on) or the // Access-Control-Request-Method header in case of a pre-flight OPTIONS request // must be one of the AllowedMethod elements. +// // - Every header specified in the Access-Control-Request-Headers request header // of a pre-flight request must match an AllowedHeader element. // -// For more information about CORS, go to Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// in the Amazon S3 User Guide. The following operations are related to -// PutBucketCors : -// - GetBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) -// - DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) -// - RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) +// For more information about CORS, go to [Enabling Cross-Origin Resource Sharing] in the Amazon S3 User Guide. +// +// The following operations are related to PutBucketCors : +// +// [GetBucketCors] +// +// [DeleteBucketCors] +// +// [RESTOPTIONSobject] +// +// [GetBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html +// [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html +// [RESTOPTIONSobject]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html +// [DeleteBucketCors]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html func (c *Client) PutBucketCors(ctx context.Context, params *PutBucketCorsInput, optFns ...func(*Options)) (*PutBucketCorsOutput, error) { if params == nil { params = &PutBucketCorsInput{} @@ -70,37 +86,50 @@ type PutBucketCorsInput struct { Bucket *string // Describes the cross-origin access configuration for objects in an Amazon S3 - // bucket. For more information, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) - // in the Amazon S3 User Guide. + // bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. + // + // [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html // // This member is required. CORSConfiguration *types.CORSConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. This header must be used as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, go to RFC 1864. (http://www.ietf.org/rfc/rfc1864.txt) + // transit. For more information, go to [RFC 1864.] + // // For requests made using the Amazon Web Services Command Line Interface (CLI) or // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864.]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketCorsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketCorsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -109,6 +138,9 @@ type PutBucketCorsOutput struct { } func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketCors{}, middleware.After) if err != nil { return err @@ -117,34 +149,38 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketCors"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -156,10 +192,19 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketCorsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketCorsValidationMiddleware(stack); err != nil { @@ -171,7 +216,7 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketCorsInputChecksumMiddlewares(stack, options); err != nil { @@ -192,12 +237,27 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -212,7 +272,6 @@ func newServiceMetadataMiddleware_opPutBucketCors(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketCors", } } @@ -262,139 +321,3 @@ func addPutBucketCorsUpdateEndpoint(stack *middleware.Stack, options Options) er DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketCorsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketCorsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketCorsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketCorsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketCorsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketCorsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketEncryption.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketEncryption.go index ef109196..85841860 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketEncryption.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketEncryption.go @@ -4,44 +4,127 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This action uses the encryption subresource to configure default encryption and -// Amazon S3 Bucket Keys for an existing bucket. By default, all buckets have a -// default encryption configuration that uses server-side encryption with Amazon S3 -// managed keys (SSE-S3). You can optionally configure default encryption for a -// bucket by using server-side encryption with Key Management Service (KMS) keys -// (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys -// (DSSE-KMS). If you specify default encryption by using SSE-KMS, you can also -// configure Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// . If you use PutBucketEncryption to set your default bucket encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 does -// not validate the KMS key ID provided in PutBucketEncryption requests. This -// action requires Amazon Web Services Signature Version 4. For more information, -// see Authenticating Requests (Amazon Web Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) -// . To use this operation, you must have permission to perform the -// s3:PutEncryptionConfiguration action. The bucket owner has this permission by -// default. The bucket owner can grant this permission to others. For more -// information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. The following operations are related to -// PutBucketEncryption : -// - GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) -// - DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) +// This operation configures default encryption and Amazon S3 Bucket Keys for an +// existing bucket. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// By default, all buckets have a default encryption configuration that uses +// server-side encryption with Amazon S3 managed keys (SSE-S3). +// +// - General purpose buckets +// +// - You can optionally configure default encryption for a bucket by using +// server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or +// dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). +// If you specify default encryption by using SSE-KMS, you can also configure [Amazon S3 Bucket Keys]. +// For information about the bucket default encryption feature, see [Amazon S3 Bucket Default Encryption]in the +// Amazon S3 User Guide. +// +// - If you use PutBucketEncryption to set your [default bucket encryption]to SSE-KMS, you should verify +// that your KMS key ID is correct. Amazon S3 doesn't validate the KMS key ID +// provided in PutBucketEncryption requests. +// +// - Directory buckets - You can optionally configure default encryption for a +// bucket by using server-side encryption with Key Management Service (KMS) keys +// (SSE-KMS). +// +// - We recommend that the bucket's default encryption uses the desired +// encryption configuration and you don't override the bucket default encryption in +// your CreateSession requests or PUT object requests. Then, new objects are +// automatically encrypted with the desired encryption settings. For more +// information about the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads] +// . +// +// - Your SSE-KMS configuration can only support 1 [customer managed key]per directory bucket for the +// lifetime of the bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't supported. +// +// - S3 Bucket Keys are always enabled for GET and PUT operations in a directory +// bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy +// SSE-KMS encrypted objects from general purpose buckets to directory buckets, +// from directory buckets to general purpose buckets, or between directory buckets, +// through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a call to KMS every time a +// copy request is made for a KMS-encrypted object. +// +// - When you specify an [KMS customer managed key]for encryption in your directory bucket, only use the +// key ID or key ARN. The key alias format of the KMS key isn't supported. +// +// - For directory buckets, if you use PutBucketEncryption to set your [default bucket encryption]to +// SSE-KMS, Amazon S3 validates the KMS key ID provided in PutBucketEncryption +// requests. +// +// If you're specifying a customer managed KMS key, we recommend using a fully +// qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the +// key within the requester’s account. This behavior can result in data that's +// encrypted with a KMS key that belongs to the requester, and not the bucket +// owner. +// +// Also, this action requires Amazon Web Services Signature Version 4. For more +// information, see [Authenticating Requests (Amazon Web Services Signature Version 4)]. +// +// Permissions +// +// - General purpose bucket permissions - The s3:PutEncryptionConfiguration +// permission is required in a policy. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Operations]and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:PutEncryptionConfiguration permission in an IAM +// identity-based policy instead of a bucket policy. Cross-account access to this +// API operation isn't supported. This operation can only be performed by the +// Amazon Web Services account that owns the resource. For more information about +// directory bucket policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// To set a directory bucket default encryption with SSE-KMS, you must also have +// +// the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based +// policies and KMS key policies for the target KMS key. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following operations are related to PutBucketEncryption : +// +// [GetBucketEncryption] +// +// [DeleteBucketEncryption] +// +// [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html +// [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk +// [Amazon S3 Bucket Default Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Permissions Related to Bucket Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk +// [Authenticating Requests (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html +// [GetBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html +// [DeleteBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html +// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk +// [default bucket encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html +// [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job +// [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html func (c *Client) PutBucketEncryption(ctx context.Context, params *PutBucketEncryptionInput, optFns ...func(*Options)) (*PutBucketEncryptionOutput, error) { if params == nil { params = &PutBucketEncryptionInput{} @@ -60,13 +143,18 @@ func (c *Client) PutBucketEncryption(ctx context.Context, params *PutBucketEncry type PutBucketEncryptionInput struct { // Specifies default encryption for a bucket using server-side encryption with - // different key options. By default, all buckets have a default encryption - // configuration that uses server-side encryption with Amazon S3 managed keys - // (SSE-S3). You can optionally configure default encryption for a bucket by using - // server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a - // customer-provided key (SSE-C). For information about the bucket default - // encryption feature, see Amazon S3 Bucket Default Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) - // in the Amazon S3 User Guide. + // different key options. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html // // This member is required. Bucket *string @@ -76,30 +164,49 @@ type PutBucketEncryptionInput struct { // This member is required. ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + // default checksum algorithm that's used for performance. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the server-side encryption - // configuration. For requests made using the Amazon Web Services Command Line - // Interface (CLI) or Amazon Web Services SDKs, this field is calculated - // automatically. + // configuration. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // This functionality is not supported for directory buckets. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketEncryptionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketEncryptionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -108,6 +215,9 @@ type PutBucketEncryptionOutput struct { } func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketEncryption{}, middleware.After) if err != nil { return err @@ -116,34 +226,38 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketEncryption"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -155,10 +269,19 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketEncryptionResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketEncryptionValidationMiddleware(stack); err != nil { @@ -170,7 +293,7 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketEncryptionInputChecksumMiddlewares(stack, options); err != nil { @@ -191,12 +314,27 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -211,7 +349,6 @@ func newServiceMetadataMiddleware_opPutBucketEncryption(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketEncryption", } } @@ -261,139 +398,3 @@ func addPutBucketEncryptionUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketEncryptionResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketEncryptionResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketEncryptionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketEncryptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketEncryptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketEncryptionResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go index d6725e64..6a11a094 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go @@ -4,50 +4,68 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can -// have up to 1,000 S3 Intelligent-Tiering configurations per bucket. The S3 -// Intelligent-Tiering storage class is designed to optimize storage costs by -// automatically moving data to the most cost-effective storage access tier, +// have up to 1,000 S3 Intelligent-Tiering configurations per bucket. +// +// The S3 Intelligent-Tiering storage class is designed to optimize storage costs +// by automatically moving data to the most cost-effective storage access tier, // without performance impact or operational overhead. S3 Intelligent-Tiering // delivers automatic cost savings in three low latency and high throughput access // tiers. To get the lowest storage cost on data that can be accessed in minutes to -// hours, you can choose to activate additional archiving capabilities. The S3 -// Intelligent-Tiering storage class is the ideal storage class for data with -// unknown, changing, or unpredictable access patterns, independent of object size -// or retention period. If the size of an object is less than 128 KB, it is not -// monitored and not eligible for auto-tiering. Smaller objects can be stored, but -// they are always charged at the Frequent Access tier rates in the S3 -// Intelligent-Tiering storage class. For more information, see Storage class for -// automatically optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) -// . Operations related to PutBucketIntelligentTieringConfiguration include: -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) +// hours, you can choose to activate additional archiving capabilities. +// +// The S3 Intelligent-Tiering storage class is the ideal storage class for data +// with unknown, changing, or unpredictable access patterns, independent of object +// size or retention period. If the size of an object is less than 128 KB, it is +// not monitored and not eligible for auto-tiering. Smaller objects can be stored, +// but they are always charged at the Frequent Access tier rates in the S3 +// Intelligent-Tiering storage class. +// +// For more information, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. +// +// Operations related to PutBucketIntelligentTieringConfiguration include: +// +// [DeleteBucketIntelligentTieringConfiguration] +// +// [GetBucketIntelligentTieringConfiguration] +// +// [ListBucketIntelligentTieringConfigurations] // // You only need S3 Intelligent-Tiering enabled on a bucket if you want to // automatically move objects stored in the S3 Intelligent-Tiering storage class to // the Archive Access or Deep Archive Access tier. -// PutBucketIntelligentTieringConfiguration has the following special errors: HTTP -// 400 Bad Request Error Code: InvalidArgument Cause: Invalid Argument HTTP 400 Bad -// Request Error Code: TooManyConfigurations Cause: You are attempting to create a -// new configuration but have already reached the 1,000-configuration limit. HTTP -// 403 Forbidden Error Cause: You are not the owner of the specified bucket, or you -// do not have the s3:PutIntelligentTieringConfiguration bucket permission to set -// the configuration on the bucket. +// +// PutBucketIntelligentTieringConfiguration has the following special errors: +// +// HTTP 400 Bad Request Error Code: InvalidArgument +// +// Cause: Invalid Argument +// +// HTTP 400 Bad Request Error Code: TooManyConfigurations +// +// Cause: You are attempting to create a new configuration but have already +// reached the 1,000-configuration limit. +// +// HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, +// or you do not have the s3:PutIntelligentTieringConfiguration bucket permission +// to set the configuration on the bucket. +// +// [ListBucketIntelligentTieringConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html +// [GetBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html +// [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access +// [DeleteBucketIntelligentTieringConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html func (c *Client) PutBucketIntelligentTieringConfiguration(ctx context.Context, params *PutBucketIntelligentTieringConfigurationInput, optFns ...func(*Options)) (*PutBucketIntelligentTieringConfigurationOutput, error) { if params == nil { params = &PutBucketIntelligentTieringConfigurationInput{} @@ -84,6 +102,12 @@ type PutBucketIntelligentTieringConfigurationInput struct { noSmithyDocumentSerde } +func (in *PutBucketIntelligentTieringConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketIntelligentTieringConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -92,6 +116,9 @@ type PutBucketIntelligentTieringConfigurationOutput struct { } func (c *Client) addOperationPutBucketIntelligentTieringConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration{}, middleware.After) if err != nil { return err @@ -100,34 +127,38 @@ func (c *Client) addOperationPutBucketIntelligentTieringConfigurationMiddlewares if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketIntelligentTieringConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -139,10 +170,19 @@ func (c *Client) addOperationPutBucketIntelligentTieringConfigurationMiddlewares if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketIntelligentTieringConfigurationValidationMiddleware(stack); err != nil { @@ -154,7 +194,7 @@ func (c *Client) addOperationPutBucketIntelligentTieringConfigurationMiddlewares if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketIntelligentTieringConfigurationUpdateEndpoint(stack, options); err != nil { @@ -172,12 +212,24 @@ func (c *Client) addOperationPutBucketIntelligentTieringConfigurationMiddlewares if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -192,7 +244,6 @@ func newServiceMetadataMiddleware_opPutBucketIntelligentTieringConfiguration(reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketIntelligentTieringConfiguration", } } @@ -222,139 +273,3 @@ func addPutBucketIntelligentTieringConfigurationUpdateEndpoint(stack *middleware DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketIntelligentTieringConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketIntelligentTieringConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketInventoryConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketInventoryConfiguration.go index 8c7f195d..d4ea335a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketInventoryConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketInventoryConfiguration.go @@ -4,62 +4,86 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // This implementation of the PUT action adds an inventory configuration // (identified by the inventory ID) to the bucket. You can have up to 1,000 -// inventory configurations per bucket. Amazon S3 inventory generates inventories -// of the objects in the bucket on a daily or weekly basis, and the results are -// published to a flat file. The bucket that is inventoried is called the source -// bucket, and the bucket where the inventory flat file is stored is called the -// destination bucket. The destination bucket must be in the same Amazon Web -// Services Region as the source bucket. When you configure an inventory for a -// source bucket, you specify the destination bucket where you want the inventory -// to be stored, and whether to generate the inventory daily or weekly. You can -// also configure what object metadata to include and whether to inventory all -// object versions or only current versions. For more information, see Amazon S3 -// Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// in the Amazon S3 User Guide. You must create a bucket policy on the destination -// bucket to grant permissions to Amazon S3 to write objects to the bucket in the -// defined location. For an example policy, see Granting Permissions for Amazon S3 -// Inventory and Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9) -// . Permissions To use this operation, you must have permission to perform the +// inventory configurations per bucket. +// +// Amazon S3 inventory generates inventories of the objects in the bucket on a +// daily or weekly basis, and the results are published to a flat file. The bucket +// that is inventoried is called the source bucket, and the bucket where the +// inventory flat file is stored is called the destination bucket. The destination +// bucket must be in the same Amazon Web Services Region as the source bucket. +// +// When you configure an inventory for a source bucket, you specify the +// destination bucket where you want the inventory to be stored, and whether to +// generate the inventory daily or weekly. You can also configure what object +// metadata to include and whether to inventory all object versions or only current +// versions. For more information, see [Amazon S3 Inventory]in the Amazon S3 User Guide. +// +// You must create a bucket policy on the destination bucket to grant permissions +// to Amazon S3 to write objects to the bucket in the defined location. For an +// example policy, see [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]. +// +// Permissions To use this operation, you must have permission to perform the // s3:PutInventoryConfiguration action. The bucket owner has this permission by -// default and can grant this permission to others. The -// s3:PutInventoryConfiguration permission allows a user to create an S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html) -// report that includes all object metadata fields available and to specify the +// default and can grant this permission to others. +// +// The s3:PutInventoryConfiguration permission allows a user to create an [S3 Inventory] report +// that includes all object metadata fields available and to specify the // destination bucket to store the inventory. A user with read access to objects in // the destination bucket can also access all object metadata fields that are -// available in the inventory report. To restrict access to an inventory report, -// see Restricting access to an Amazon S3 Inventory report (https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-10) -// in the Amazon S3 User Guide. For more information about the metadata fields -// available in S3 Inventory, see Amazon S3 Inventory lists (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html#storage-inventory-contents) -// in the Amazon S3 User Guide. For more information about permissions, see -// Permissions related to bucket subresource operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Identity and access management in Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. PutBucketInventoryConfiguration has the following -// special errors: HTTP 400 Bad Request Error Code: InvalidArgument Cause: Invalid -// Argument HTTP 400 Bad Request Error Code: TooManyConfigurations Cause: You are -// attempting to create a new configuration but have already reached the -// 1,000-configuration limit. HTTP 403 Forbidden Error Cause: You are not the owner -// of the specified bucket, or you do not have the s3:PutInventoryConfiguration -// bucket permission to set the configuration on the bucket. The following -// operations are related to PutBucketInventoryConfiguration : -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) +// available in the inventory report. +// +// To restrict access to an inventory report, see [Restricting access to an Amazon S3 Inventory report] in the Amazon S3 User Guide. +// For more information about the metadata fields available in S3 Inventory, see [Amazon S3 Inventory lists] +// in the Amazon S3 User Guide. For more information about permissions, see [Permissions related to bucket subresource operations]and [Identity and access management in Amazon S3] +// in the Amazon S3 User Guide. +// +// PutBucketInventoryConfiguration has the following special errors: +// +// HTTP 400 Bad Request Error Code: InvalidArgument +// +// Cause: Invalid Argument +// +// HTTP 400 Bad Request Error Code: TooManyConfigurations +// +// Cause: You are attempting to create a new configuration but have already +// reached the 1,000-configuration limit. +// +// HTTP 403 Forbidden Error Cause: You are not the owner of the specified bucket, +// or you do not have the s3:PutInventoryConfiguration bucket permission to set +// the configuration on the bucket. +// +// The following operations are related to PutBucketInventoryConfiguration : +// +// [GetBucketInventoryConfiguration] +// +// [DeleteBucketInventoryConfiguration] +// +// [ListBucketInventoryConfigurations] +// +// [Granting Permissions for Amazon S3 Inventory and Storage Class Analysis]: https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9 +// [Amazon S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html +// [ListBucketInventoryConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html +// [S3 Inventory]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html +// [Permissions related to bucket subresource operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [DeleteBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html +// [Identity and access management in Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Restricting access to an Amazon S3 Inventory report]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-10 +// [Amazon S3 Inventory lists]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-inventory.html#storage-inventory-contents +// [GetBucketInventoryConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html func (c *Client) PutBucketInventoryConfiguration(ctx context.Context, params *PutBucketInventoryConfigurationInput, optFns ...func(*Options)) (*PutBucketInventoryConfigurationOutput, error) { if params == nil { params = &PutBucketInventoryConfigurationInput{} @@ -92,14 +116,20 @@ type PutBucketInventoryConfigurationInput struct { // This member is required. InventoryConfiguration *types.InventoryConfiguration - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketInventoryConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketInventoryConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -108,6 +138,9 @@ type PutBucketInventoryConfigurationOutput struct { } func (c *Client) addOperationPutBucketInventoryConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketInventoryConfiguration{}, middleware.After) if err != nil { return err @@ -116,34 +149,38 @@ func (c *Client) addOperationPutBucketInventoryConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketInventoryConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -155,10 +192,19 @@ func (c *Client) addOperationPutBucketInventoryConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketInventoryConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketInventoryConfigurationValidationMiddleware(stack); err != nil { @@ -170,7 +216,7 @@ func (c *Client) addOperationPutBucketInventoryConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketInventoryConfigurationUpdateEndpoint(stack, options); err != nil { @@ -188,12 +234,24 @@ func (c *Client) addOperationPutBucketInventoryConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -208,7 +266,6 @@ func newServiceMetadataMiddleware_opPutBucketInventoryConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketInventoryConfiguration", } } @@ -238,139 +295,3 @@ func addPutBucketInventoryConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketInventoryConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketInventoryConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketInventoryConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketInventoryConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketInventoryConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketInventoryConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLifecycleConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLifecycleConfiguration.go index 1cebaee5..24e7f2fa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLifecycleConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLifecycleConfiguration.go @@ -4,18 +4,14 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -23,20 +19,36 @@ import ( // lifecycle configuration. Keep in mind that this will overwrite an existing // lifecycle configuration, so if you want to retain any configuration details, // they must be included in the new lifecycle configuration. For information about -// lifecycle configuration, see Managing your storage lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) -// . Bucket lifecycle configuration now supports specifying a lifecycle rule using -// an object key name prefix, one or more object tags, or a combination of both. -// Accordingly, this section describes the latest API. The previous version of the -// API supported filtering based only on an object key name prefix, which is -// supported for backward compatibility. For the related API description, see -// PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) -// . Rules You specify the lifecycle configuration in your request body. The -// lifecycle configuration is specified as XML consisting of one or more rules. An -// Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not -// adjustable. Each rule consists of the following: +// lifecycle configuration, see [Managing your storage lifecycle]. +// +// Bucket lifecycle configuration now supports specifying a lifecycle rule using +// an object key name prefix, one or more object tags, object size, or any +// combination of these. Accordingly, this section describes the latest API. The +// previous version of the API supported filtering based only on an object key name +// prefix, which is supported for backward compatibility. For the related API +// description, see [PutBucketLifecycle]. +// +// Rules Permissions HTTP Host header syntax You specify the lifecycle +// configuration in your request body. The lifecycle configuration is specified as +// XML consisting of one or more rules. An Amazon S3 Lifecycle configuration can +// have up to 1,000 rules. This limit is not adjustable. +// +// Bucket lifecycle configuration supports specifying a lifecycle rule using an +// object key name prefix, one or more object tags, object size, or any combination +// of these. Accordingly, this section describes the latest API. The previous +// version of the API supported filtering based only on an object key name prefix, +// which is supported for backward compatibility for general purpose buckets. For +// the related API description, see [PutBucketLifecycle]. +// +// Lifecyle configurations for directory buckets only support expiring objects and +// cancelling multipart uploads. Expiring of versioned objects,transitions and tag +// filters are not supported. +// +// A lifecycle rule consists of the following: // // - A filter identifying a subset of objects to which the rule applies. The -// filter can be based on a key name prefix, object tags, or a combination of both. +// filter can be based on a key name prefix, object tags, object size, or any +// combination of these. // // - A status indicating whether the rule is in effect. // @@ -47,28 +59,69 @@ import ( // versions). Amazon S3 provides predefined actions that you can specify for // current and noncurrent object versions. // -// For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// and Lifecycle Configuration Elements (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html) -// . Permissions By default, all Amazon S3 resources are private, including -// buckets, objects, and related subresources (for example, lifecycle configuration -// and website configuration). Only the resource owner (that is, the Amazon Web -// Services account that created it) can access the resource. The resource owner -// can optionally grant access permissions to others by writing an access policy. -// For this operation, a user must get the s3:PutLifecycleConfiguration -// permission. You can also explicitly deny permissions. An explicit deny also -// supersedes any other permissions. If you want to block users or accounts from -// removing or deleting objects from your bucket, you must deny them permissions -// for the following actions: -// - s3:DeleteObject -// - s3:DeleteObjectVersion -// - s3:PutLifecycleConfiguration +// For more information, see [Object Lifecycle Management] and [Lifecycle Configuration Elements]. +// +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:PutLifecycleConfiguration permission. +// +// You can also explicitly deny permissions. An explicit deny also supersedes any +// +// other permissions. If you want to block users or accounts from removing or +// deleting objects from your bucket, you must deny them permissions for the +// following actions: +// +// - s3:DeleteObject +// +// - s3:DeleteObjectVersion +// +// - s3:PutLifecycleConfiguration +// +// For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. // -// For more information about permissions, see Managing Access Permissions to Your -// Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . The following operations are related to PutBucketLifecycleConfiguration : -// - Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html) -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// - DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) +// - Directory bucket permissions - You must have the +// s3express:PutLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. +// +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . +// +// The following operations are related to PutBucketLifecycleConfiguration : +// +// [GetBucketLifecycleConfiguration] +// +// [DeleteBucketLifecycle] +// +// [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html +// [Lifecycle Configuration Elements]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html +// [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html +// [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html +// +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html func (c *Client) PutBucketLifecycleConfiguration(ctx context.Context, params *PutBucketLifecycleConfigurationInput, optFns ...func(*Options)) (*PutBucketLifecycleConfigurationOutput, error) { if params == nil { params = &PutBucketLifecycleConfigurationInput{} @@ -91,28 +144,79 @@ type PutBucketLifecycleConfigurationInput struct { // This member is required. Bucket *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string // Container for lifecycle rules. You can add as many as 1,000 rules. LifecycleConfiguration *types.BucketLifecycleConfiguration + // Indicates which default minimum object size behavior is applied to the + // lifecycle configuration. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // + // - all_storage_classes_128K - Objects smaller than 128 KB will not transition + // to any storage class by default. + // + // - varies_by_storage_class - Objects smaller than 128 KB will transition to + // Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + // all other storage classes will prevent transitions smaller than 128 KB. + // + // To customize the minimum object size for any transition you can add a filter + // that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + // of your transition rule. Custom filters always take precedence over the default + // transition behavior. + TransitionDefaultMinimumObjectSize types.TransitionDefaultMinimumObjectSize + noSmithyDocumentSerde } +func (in *PutBucketLifecycleConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketLifecycleConfigurationOutput struct { + + // Indicates which default minimum object size behavior is applied to the + // lifecycle configuration. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // + // - all_storage_classes_128K - Objects smaller than 128 KB will not transition + // to any storage class by default. + // + // - varies_by_storage_class - Objects smaller than 128 KB will transition to + // Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, + // all other storage classes will prevent transitions smaller than 128 KB. + // + // To customize the minimum object size for any transition you can add a filter + // that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body + // of your transition rule. Custom filters always take precedence over the default + // transition behavior. + TransitionDefaultMinimumObjectSize types.TransitionDefaultMinimumObjectSize + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -120,6 +224,9 @@ type PutBucketLifecycleConfigurationOutput struct { } func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketLifecycleConfiguration{}, middleware.After) if err != nil { return err @@ -128,34 +235,38 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketLifecycleConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -167,10 +278,19 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addPutBucketLifecycleConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketLifecycleConfigurationValidationMiddleware(stack); err != nil { @@ -182,7 +302,7 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketLifecycleConfigurationInputChecksumMiddlewares(stack, options); err != nil { @@ -203,12 +323,27 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -223,7 +358,6 @@ func newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(region strin return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketLifecycleConfiguration", } } @@ -273,139 +407,3 @@ func addPutBucketLifecycleConfigurationUpdateEndpoint(stack *middleware.Stack, o DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketLifecycleConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketLifecycleConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketLifecycleConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketLifecycleConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketLifecycleConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLogging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLogging.go index 45628824..01380c4b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLogging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketLogging.go @@ -4,54 +4,79 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Set the logging parameters for a bucket and to specify permissions for who can // view and modify the logging parameters. All logs are saved to buckets in the // same Amazon Web Services Region as the source bucket. To set the logging status -// of a bucket, you must be the bucket owner. The bucket owner is automatically -// granted FULL_CONTROL to all logs. You use the Grantee request element to grant -// access to other people. The Permissions request element specifies the kind of -// access the grantee has to the logs. If the target bucket for log delivery uses -// the bucket owner enforced setting for S3 Object Ownership, you can't use the -// Grantee request element to grant access to others. Permissions can only be -// granted using policies. For more information, see Permissions for server access -// log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) -// in the Amazon S3 User Guide. Grantee Values You can specify the person (grantee) -// to whom you're assigning access rights (by using request elements) in the -// following ways: -// - By the person's ID: <>ID<><>GranteesEmail<> DisplayName is optional and -// ignored in the request. -// - By Email address: <>Grantees@email.com<> The grantee is resolved to the -// CanonicalUser and, in a response to a GETObjectAcl request, appears as the -// CanonicalUser. -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// of a bucket, you must be the bucket owner. +// +// The bucket owner is automatically granted FULL_CONTROL to all logs. You use the +// Grantee request element to grant access to other people. The Permissions +// request element specifies the kind of access the grantee has to the logs. +// +// If the target bucket for log delivery uses the bucket owner enforced setting +// for S3 Object Ownership, you can't use the Grantee request element to grant +// access to others. Permissions can only be granted using policies. For more +// information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. +// +// Grantee Values You can specify the person (grantee) to whom you're assigning +// access rights (by using request elements) in the following ways: +// +// - By the person's ID: +// +// <>ID<><>GranteesEmail<> +// +// DisplayName is optional and ignored in the request. +// +// - By Email address: +// +// <>Grantees@email.com<> +// +// The grantee is resolved to the CanonicalUser and, in a response to a +// +// GETObjectAcl request, appears as the CanonicalUser. +// +// - By URI: +// +// <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> // // To enable logging, you use LoggingEnabled and its children request elements. To -// disable logging, you use an empty BucketLoggingStatus request element: For -// more information about server access logging, see Server Access Logging (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html) -// in the Amazon S3 User Guide. For more information about creating a bucket, see -// CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// . For more information about returning the logging status of a bucket, see -// GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) -// . The following operations are related to PutBucketLogging : -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) +// disable logging, you use an empty BucketLoggingStatus request element: +// +// For more information about server access logging, see [Server Access Logging] in the Amazon S3 User +// Guide. +// +// For more information about creating a bucket, see [CreateBucket]. For more information about +// returning the logging status of a bucket, see [GetBucketLogging]. +// +// The following operations are related to PutBucketLogging : +// +// [PutObject] +// +// [DeleteBucket] +// +// [CreateBucket] +// +// [GetBucketLogging] +// +// [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general +// [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html +// [GetBucketLogging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Server Access Logging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html func (c *Client) PutBucketLogging(ctx context.Context, params *PutBucketLoggingInput, optFns ...func(*Options)) (*PutBucketLoggingOutput, error) { if params == nil { params = &PutBucketLoggingInput{} @@ -79,29 +104,39 @@ type PutBucketLoggingInput struct { // This member is required. BucketLoggingStatus *types.BucketLoggingStatus - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash of the PutBucketLogging request body. For requests made using the - // Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, - // this field is calculated automatically. + // The MD5 hash of the PutBucketLogging request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketLoggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketLoggingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -110,6 +145,9 @@ type PutBucketLoggingOutput struct { } func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketLogging{}, middleware.After) if err != nil { return err @@ -118,34 +156,38 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketLogging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -157,10 +199,19 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketLoggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketLoggingValidationMiddleware(stack); err != nil { @@ -172,7 +223,7 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketLoggingInputChecksumMiddlewares(stack, options); err != nil { @@ -193,12 +244,27 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -213,7 +279,6 @@ func newServiceMetadataMiddleware_opPutBucketLogging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketLogging", } } @@ -263,139 +328,3 @@ func addPutBucketLoggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketLoggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketLoggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketLoggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketLoggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketLoggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketLoggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketMetricsConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketMetricsConfiguration.go index 785a1f83..0cd04f45 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketMetricsConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketMetricsConfiguration.go @@ -4,42 +4,54 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets a metrics configuration (specified by the metrics configuration ID) for // the bucket. You can have up to 1,000 metrics configurations per bucket. If // you're updating an existing metrics configuration, note that this is a full // replacement of the existing metrics configuration. If you don't include the -// elements you want to keep, they are erased. To use this operation, you must have -// permissions to perform the s3:PutMetricsConfiguration action. The bucket owner -// has this permission by default. The bucket owner can grant this permission to -// others. For more information about permissions, see Permissions Related to -// Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . For information about CloudWatch request metrics for Amazon S3, see -// Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// . The following operations are related to PutBucketMetricsConfiguration : -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) +// elements you want to keep, they are erased. +// +// To use this operation, you must have permissions to perform the +// s3:PutMetricsConfiguration action. The bucket owner has this permission by +// default. The bucket owner can grant this permission to others. For more +// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// For information about CloudWatch request metrics for Amazon S3, see [Monitoring Metrics with Amazon CloudWatch]. +// +// The following operations are related to PutBucketMetricsConfiguration : +// +// [DeleteBucketMetricsConfiguration] +// +// [GetBucketMetricsConfiguration] +// +// [ListBucketMetricsConfigurations] // // PutBucketMetricsConfiguration has the following special error: +// // - Error code: TooManyConfigurations +// // - Description: You are attempting to create a new configuration but have // already reached the 1,000-configuration limit. +// // - HTTP Status Code: HTTP 400 Bad Request +// +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Monitoring Metrics with Amazon CloudWatch]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html +// [GetBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html +// [ListBucketMetricsConfigurations]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html +// [DeleteBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) PutBucketMetricsConfiguration(ctx context.Context, params *PutBucketMetricsConfigurationInput, optFns ...func(*Options)) (*PutBucketMetricsConfigurationOutput, error) { if params == nil { params = &PutBucketMetricsConfigurationInput{} @@ -73,14 +85,20 @@ type PutBucketMetricsConfigurationInput struct { // This member is required. MetricsConfiguration *types.MetricsConfiguration - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketMetricsConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketMetricsConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -89,6 +107,9 @@ type PutBucketMetricsConfigurationOutput struct { } func (c *Client) addOperationPutBucketMetricsConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketMetricsConfiguration{}, middleware.After) if err != nil { return err @@ -97,34 +118,38 @@ func (c *Client) addOperationPutBucketMetricsConfigurationMiddlewares(stack *mid if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketMetricsConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -136,10 +161,19 @@ func (c *Client) addOperationPutBucketMetricsConfigurationMiddlewares(stack *mid if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketMetricsConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketMetricsConfigurationValidationMiddleware(stack); err != nil { @@ -151,7 +185,7 @@ func (c *Client) addOperationPutBucketMetricsConfigurationMiddlewares(stack *mid if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketMetricsConfigurationUpdateEndpoint(stack, options); err != nil { @@ -169,12 +203,24 @@ func (c *Client) addOperationPutBucketMetricsConfigurationMiddlewares(stack *mid if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -189,7 +235,6 @@ func newServiceMetadataMiddleware_opPutBucketMetricsConfiguration(region string) return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketMetricsConfiguration", } } @@ -219,139 +264,3 @@ func addPutBucketMetricsConfigurationUpdateEndpoint(stack *middleware.Stack, opt DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketMetricsConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketMetricsConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketMetricsConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketMetricsConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketMetricsConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketMetricsConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketNotificationConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketNotificationConfiguration.go index 098445cf..cbc39609 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketNotificationConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketNotificationConfiguration.go @@ -4,54 +4,69 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Enables notifications of specified events for a bucket. For more information -// about event notifications, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// . Using this API, you can replace an existing notification configuration. The +// about event notifications, see [Configuring Event Notifications]. +// +// Using this API, you can replace an existing notification configuration. The // configuration is an XML file that defines the event types that you want Amazon // S3 to publish and the destination where you want Amazon S3 to publish an event -// notification when it detects an event of the specified type. By default, your -// bucket has no event notifications configured. That is, the notification -// configuration will be an empty NotificationConfiguration . This action -// replaces the existing notification configuration with the configuration you -// include in the request body. After Amazon S3 receives this request, it first -// verifies that any Amazon Simple Notification Service (Amazon SNS) or Amazon -// Simple Queue Service (Amazon SQS) destination exists, and that the bucket owner -// has permission to publish to it by sending a test notification. In the case of -// Lambda destinations, Amazon S3 verifies that the Lambda function permissions -// grant Amazon S3 permission to invoke the function from the Amazon S3 bucket. For -// more information, see Configuring Notifications for Amazon S3 Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// . You can disable notifications by adding the empty NotificationConfiguration -// element. For more information about the number of event notification -// configurations that you can create per bucket, see Amazon S3 service quotas (https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3) -// in Amazon Web Services General Reference. By default, only the bucket owner can -// configure notifications on a bucket. However, bucket owners can use a bucket -// policy to grant permission to other users to set this configuration with the -// required s3:PutBucketNotification permission. The PUT notification is an atomic -// operation. For example, suppose your notification configuration includes SNS -// topic, SQS queue, and Lambda function configurations. When you send a PUT -// request with this configuration, Amazon S3 sends test messages to your SNS -// topic. If the message fails, the entire PUT action will fail, and Amazon S3 will -// not add the configuration to your bucket. If the configuration in the request -// body includes only one TopicConfiguration specifying only the -// s3:ReducedRedundancyLostObject event type, the response will also include the -// x-amz-sns-test-message-id header containing the message ID of the test -// notification sent to the topic. The following action is related to -// PutBucketNotificationConfiguration : -// - GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) +// notification when it detects an event of the specified type. +// +// By default, your bucket has no event notifications configured. That is, the +// notification configuration will be an empty NotificationConfiguration . +// +// This action replaces the existing notification configuration with the +// configuration you include in the request body. +// +// After Amazon S3 receives this request, it first verifies that any Amazon Simple +// Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon SQS) +// destination exists, and that the bucket owner has permission to publish to it by +// sending a test notification. In the case of Lambda destinations, Amazon S3 +// verifies that the Lambda function permissions grant Amazon S3 permission to +// invoke the function from the Amazon S3 bucket. For more information, see [Configuring Notifications for Amazon S3 Events]. +// +// You can disable notifications by adding the empty NotificationConfiguration +// element. +// +// For more information about the number of event notification configurations that +// you can create per bucket, see [Amazon S3 service quotas]in Amazon Web Services General Reference. +// +// By default, only the bucket owner can configure notifications on a bucket. +// However, bucket owners can use a bucket policy to grant permission to other +// users to set this configuration with the required s3:PutBucketNotification +// permission. +// +// The PUT notification is an atomic operation. For example, suppose your +// notification configuration includes SNS topic, SQS queue, and Lambda function +// configurations. When you send a PUT request with this configuration, Amazon S3 +// sends test messages to your SNS topic. If the message fails, the entire PUT +// action will fail, and Amazon S3 will not add the configuration to your bucket. +// +// If the configuration in the request body includes only one TopicConfiguration +// specifying only the s3:ReducedRedundancyLostObject event type, the response +// will also include the x-amz-sns-test-message-id header containing the message +// ID of the test notification sent to the topic. +// +// The following action is related to PutBucketNotificationConfiguration : +// +// [GetBucketNotificationConfiguration] +// +// [Configuring Notifications for Amazon S3 Events]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html +// [Amazon S3 service quotas]: https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3 +// [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html +// [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html func (c *Client) PutBucketNotificationConfiguration(ctx context.Context, params *PutBucketNotificationConfigurationInput, optFns ...func(*Options)) (*PutBucketNotificationConfigurationOutput, error) { if params == nil { params = &PutBucketNotificationConfigurationInput{} @@ -80,18 +95,24 @@ type PutBucketNotificationConfigurationInput struct { // This member is required. NotificationConfiguration *types.NotificationConfiguration - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or // false value. - SkipDestinationValidation bool + SkipDestinationValidation *bool noSmithyDocumentSerde } +func (in *PutBucketNotificationConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketNotificationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -100,6 +121,9 @@ type PutBucketNotificationConfigurationOutput struct { } func (c *Client) addOperationPutBucketNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketNotificationConfiguration{}, middleware.After) if err != nil { return err @@ -108,34 +132,38 @@ func (c *Client) addOperationPutBucketNotificationConfigurationMiddlewares(stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -147,10 +175,19 @@ func (c *Client) addOperationPutBucketNotificationConfigurationMiddlewares(stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketNotificationConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketNotificationConfigurationValidationMiddleware(stack); err != nil { @@ -162,7 +199,7 @@ func (c *Client) addOperationPutBucketNotificationConfigurationMiddlewares(stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketNotificationConfigurationUpdateEndpoint(stack, options); err != nil { @@ -180,12 +217,24 @@ func (c *Client) addOperationPutBucketNotificationConfigurationMiddlewares(stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -200,7 +249,6 @@ func newServiceMetadataMiddleware_opPutBucketNotificationConfiguration(region st return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketNotificationConfiguration", } } @@ -230,139 +278,3 @@ func addPutBucketNotificationConfigurationUpdateEndpoint(stack *middleware.Stack DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketNotificationConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketNotificationConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketNotificationConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketNotificationConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketNotificationConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketNotificationConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketOwnershipControls.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketOwnershipControls.go index 6944f1b8..7eeb45da 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketOwnershipControls.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketOwnershipControls.go @@ -4,28 +4,33 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this // operation, you must have the s3:PutBucketOwnershipControls permission. For more -// information about Amazon S3 permissions, see Specifying permissions in a policy (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html) -// . For information about Amazon S3 Object Ownership, see Using object ownership (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html) -// . The following operations are related to PutBucketOwnershipControls : -// - GetBucketOwnershipControls -// - DeleteBucketOwnershipControls +// information about Amazon S3 permissions, see [Specifying permissions in a policy]. +// +// For information about Amazon S3 Object Ownership, see [Using object ownership]. +// +// The following operations are related to PutBucketOwnershipControls : +// +// # GetBucketOwnershipControls +// +// # DeleteBucketOwnershipControls +// +// [Specifying permissions in a policy]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html +// [Using object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html func (c *Client) PutBucketOwnershipControls(ctx context.Context, params *PutBucketOwnershipControlsInput, optFns ...func(*Options)) (*PutBucketOwnershipControlsOutput, error) { if params == nil { params = &PutBucketOwnershipControlsInput{} @@ -54,19 +59,26 @@ type PutBucketOwnershipControlsInput struct { // This member is required. OwnershipControls *types.OwnershipControls - // The MD5 hash of the OwnershipControls request body. For requests made using the - // Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, - // this field is calculated automatically. + // The MD5 hash of the OwnershipControls request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketOwnershipControlsInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketOwnershipControlsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -75,6 +87,9 @@ type PutBucketOwnershipControlsOutput struct { } func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketOwnershipControls{}, middleware.After) if err != nil { return err @@ -83,34 +98,38 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketOwnershipControls"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -122,10 +141,19 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketOwnershipControlsResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketOwnershipControlsValidationMiddleware(stack); err != nil { @@ -137,7 +165,7 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketOwnershipControlsInputChecksumMiddlewares(stack, options); err != nil { @@ -158,12 +186,27 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -178,7 +221,6 @@ func newServiceMetadataMiddleware_opPutBucketOwnershipControls(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketOwnershipControls", } } @@ -218,139 +260,3 @@ func addPutBucketOwnershipControlsUpdateEndpoint(stack *middleware.Stack, option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketOwnershipControlsResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketOwnershipControlsResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketOwnershipControlsResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketOwnershipControlsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketOwnershipControlsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketOwnershipControlsResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketPolicy.go index 999c38a7..4c0c875a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketPolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketPolicy.go @@ -4,39 +4,77 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using an -// identity other than the root user of the Amazon Web Services account that owns -// the bucket, the calling identity must have the PutBucketPolicy permissions on -// the specified bucket and belong to the bucket owner's account in order to use -// this operation. If you don't have PutBucketPolicy permissions, Amazon S3 -// returns a 403 Access Denied error. If you have the correct permissions, but -// you're not using an identity that belongs to the bucket owner's account, Amazon -// S3 returns a 405 Method Not Allowed error. To ensure that bucket owners don't -// inadvertently lock themselves out of their own buckets, the root principal in a -// bucket owner's Amazon Web Services account can perform the GetBucketPolicy , -// PutBucketPolicy , and DeleteBucketPolicy API actions, even if their bucket -// policy explicitly denies the root principal's access. Bucket owner root -// principals can only be blocked from performing these API actions by VPC endpoint -// policies and Amazon Web Services Organizations policies. For more information, -// see Bucket policy examples (https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html) -// . The following operations are related to PutBucketPolicy : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) +// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region-code.amazonaws.com/bucket-name . +// Virtual-hosted-style requests aren't supported. For more information about +// endpoints in Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more +// information about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions If you are using an identity other than the root user of the Amazon +// Web Services account that owns the bucket, the calling identity must both have +// the PutBucketPolicy permissions on the specified bucket and belong to the +// bucket owner's account in order to use this operation. +// +// If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403 Access +// Denied error. If you have the correct permissions, but you're not using an +// identity that belongs to the bucket owner's account, Amazon S3 returns a 405 +// Method Not Allowed error. +// +// To ensure that bucket owners don't inadvertently lock themselves out of their +// own buckets, the root principal in a bucket owner's Amazon Web Services account +// can perform the GetBucketPolicy , PutBucketPolicy , and DeleteBucketPolicy API +// actions, even if their bucket policy explicitly denies the root principal's +// access. Bucket owner root principals can only be blocked from performing these +// API actions by VPC endpoint policies and Amazon Web Services Organizations +// policies. +// +// - General purpose bucket permissions - The s3:PutBucketPolicy permission is +// required in a policy. For more information about general purpose buckets bucket +// policies, see [Using Bucket Policies and User Policies]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation, you +// must have the s3express:PutBucketPolicy permission in an IAM identity-based +// policy instead of a bucket policy. Cross-account access to this API operation +// isn't supported. This operation can only be performed by the Amazon Web Services +// account that owns the resource. For more information about directory bucket +// policies and permissions, see [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]in the Amazon S3 User Guide. +// +// Example bucket policies General purpose buckets example bucket policies - See [Bucket policy examples] +// in the Amazon S3 User Guide. +// +// Directory bucket example bucket policies - See [Example bucket policies for S3 Express One Zone] in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region-code.amazonaws.com . +// +// The following operations are related to PutBucketPolicy : +// +// [CreateBucket] +// +// [DeleteBucket] +// +// [Bucket policy examples]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html +// [Using Bucket Policies and User Policies]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html func (c *Client) PutBucketPolicy(ctx context.Context, params *PutBucketPolicyInput, optFns ...func(*Options)) (*PutBucketPolicyOutput, error) { if params == nil { params = &PutBucketPolicyInput{} @@ -56,41 +94,91 @@ type PutBucketPolicyInput struct { // The name of the bucket. // + // Directory buckets - When you use this operation with a directory bucket, you + // must use path-style requests in the format + // https://s3express-control.region-code.amazonaws.com/bucket-name . + // Virtual-hosted-style requests aren't supported. Directory bucket names must be + // unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must + // also follow the format bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // // This member is required. Bucket *string // The bucket policy as a JSON document. // + // For directory buckets, the only IAM action supported in the bucket policy is + // s3express:CreateSession . + // // This member is required. Policy *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + // fails the request with the HTTP status code 400 Bad Request . + // + // For the x-amz-checksum-algorithm header, replace algorithm with the + // supported algorithm from the following list: + // + // - CRC32 + // + // - CRC32C + // + // - SHA1 + // + // - SHA256 + // + // For more information, see [Checking object integrity] in the Amazon S3 User Guide. + // + // If the individual checksum value you provide through x-amz-checksum-algorithm + // doesn't match the checksum algorithm you set through + // x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + // parameter and uses the checksum algorithm that matches the provided value in + // x-amz-checksum-algorithm . + // + // For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + // default checksum algorithm that's used for performance. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // Set this parameter to true to confirm that you want to remove your permissions // to change this bucket policy in the future. - ConfirmRemoveSelfBucketAccess bool + // + // This functionality is not supported for directory buckets. + ConfirmRemoveSelfBucketAccess *bool - // The MD5 hash of the request body. For requests made using the Amazon Web - // Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is - // calculated automatically. + // The MD5 hash of the request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // This functionality is not supported for directory buckets. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). + // + // For directory buckets, this header is not supported in this API operation. If + // you specify this header, the request fails with the HTTP status code 501 Not + // Implemented . ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketPolicyInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketPolicyOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -99,6 +187,9 @@ type PutBucketPolicyOutput struct { } func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketPolicy{}, middleware.After) if err != nil { return err @@ -107,34 +198,38 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -146,10 +241,19 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketPolicyResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketPolicyValidationMiddleware(stack); err != nil { @@ -161,7 +265,7 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketPolicyInputChecksumMiddlewares(stack, options); err != nil { @@ -182,12 +286,27 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -202,7 +321,6 @@ func newServiceMetadataMiddleware_opPutBucketPolicy(region string) *awsmiddlewar return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketPolicy", } } @@ -252,139 +370,3 @@ func addPutBucketPolicyUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketPolicyResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketPolicyResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketPolicyResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketPolicyResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketReplication.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketReplication.go index d44e96bc..2655ff24 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketReplication.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketReplication.go @@ -4,62 +4,82 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Creates a replication configuration or replaces an existing one. For more -// information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. Specify the replication configuration in the -// request body. In the replication configuration, you provide the name of the -// destination bucket or buckets where you want Amazon S3 to replicate objects, the -// IAM role that Amazon S3 can assume to replicate objects on your behalf, and -// other relevant information. You can invoke this request for a specific Amazon -// Web Services Region by using the aws:RequestedRegion (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion) -// condition key. A replication configuration must include at least one rule, and -// can contain a maximum of 1,000. Each rule identifies a subset of objects to -// replicate by filtering the objects in the source bucket. To choose additional -// subsets of objects to replicate, add a rule for each subset. To specify a subset -// of the objects in the source bucket to apply a replication rule to, add the -// Filter element as a child of the Rule element. You can filter objects based on -// an object key prefix, one or more object tags, or both. When you add the Filter -// element in the configuration, you must also add the following elements: -// DeleteMarkerReplication , Status , and Priority . If you are using an earlier -// version of the replication configuration, Amazon S3 handles replication of -// delete markers differently. For more information, see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations) -// . For information about enabling versioning on a bucket, see Using Versioning (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html) -// . Handling Replication of Encrypted Objects By default, Amazon S3 doesn't +// information, see [Replication]in the Amazon S3 User Guide. +// +// Specify the replication configuration in the request body. In the replication +// configuration, you provide the name of the destination bucket or buckets where +// you want Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume +// to replicate objects on your behalf, and other relevant information. You can +// invoke this request for a specific Amazon Web Services Region by using the [aws:RequestedRegion] +// aws:RequestedRegion condition key. +// +// A replication configuration must include at least one rule, and can contain a +// maximum of 1,000. Each rule identifies a subset of objects to replicate by +// filtering the objects in the source bucket. To choose additional subsets of +// objects to replicate, add a rule for each subset. +// +// To specify a subset of the objects in the source bucket to apply a replication +// rule to, add the Filter element as a child of the Rule element. You can filter +// objects based on an object key prefix, one or more object tags, or both. When +// you add the Filter element in the configuration, you must also add the following +// elements: DeleteMarkerReplication , Status , and Priority . +// +// If you are using an earlier version of the replication configuration, Amazon S3 +// handles replication of delete markers differently. For more information, see [Backward Compatibility]. +// +// For information about enabling versioning on a bucket, see [Using Versioning]. +// +// Handling Replication of Encrypted Objects By default, Amazon S3 doesn't // replicate objects that are stored at rest using server-side encryption with KMS // keys. To replicate Amazon Web Services KMS-encrypted objects, add the following: // SourceSelectionCriteria , SseKmsEncryptedObjects , Status , // EncryptionConfiguration , and ReplicaKmsKeyID . For information about -// replication configuration, see Replicating Objects Created with SSE Using KMS -// keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html) -// . For information on PutBucketReplication errors, see List of -// replication-related error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) +// replication configuration, see [Replicating Objects Created with SSE Using KMS keys]. +// +// For information on PutBucketReplication errors, see [List of replication-related error codes] +// // Permissions To create a PutBucketReplication request, you must have -// s3:PutReplicationConfiguration permissions for the bucket. By default, a -// resource owner, in this case the Amazon Web Services account that created the -// bucket, can perform this operation. The resource owner can also grant others -// permissions to perform the operation. For more information about permissions, -// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . To perform this operation, the user or role performing the action must have -// the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) -// permission. The following operations are related to PutBucketReplication : -// - GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) -// - DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) +// s3:PutReplicationConfiguration permissions for the bucket. +// +// By default, a resource owner, in this case the Amazon Web Services account that +// created the bucket, can perform this operation. The resource owner can also +// grant others permissions to perform the operation. For more information about +// permissions, see [Specifying Permissions in a Policy]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// To perform this operation, the user or role performing the action must have the [iam:PassRole] +// permission. +// +// The following operations are related to PutBucketReplication : +// +// [GetBucketReplication] +// +// [DeleteBucketReplication] +// +// [iam:PassRole]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html +// [GetBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html +// [aws:RequestedRegion]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requestedregion +// [Replicating Objects Created with SSE Using KMS keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html +// [Using Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html +// [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html +// [List of replication-related error codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList +// [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations +// [DeleteBucketReplication]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html func (c *Client) PutBucketReplication(ctx context.Context, params *PutBucketReplicationInput, optFns ...func(*Options)) (*PutBucketReplicationOutput, error) { if params == nil { params = &PutBucketReplicationInput{} @@ -88,26 +108,32 @@ type PutBucketReplicationInput struct { // This member is required. ReplicationConfiguration *types.ReplicationConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. You must use this header as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, see RFC 1864 (http://www.ietf.org/rfc/rfc1864.txt) - // . For requests made using the Amazon Web Services Command Line Interface (CLI) - // or Amazon Web Services SDKs, this field is calculated automatically. + // transit. For more information, see [RFC 1864]. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // A token to allow Object Lock to be enabled for an existing bucket. @@ -116,6 +142,12 @@ type PutBucketReplicationInput struct { noSmithyDocumentSerde } +func (in *PutBucketReplicationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketReplicationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -124,6 +156,9 @@ type PutBucketReplicationOutput struct { } func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketReplication{}, middleware.After) if err != nil { return err @@ -132,34 +167,38 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketReplication"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -171,10 +210,19 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketReplicationResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketReplicationValidationMiddleware(stack); err != nil { @@ -186,7 +234,7 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketReplicationInputChecksumMiddlewares(stack, options); err != nil { @@ -207,12 +255,27 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -227,7 +290,6 @@ func newServiceMetadataMiddleware_opPutBucketReplication(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketReplication", } } @@ -277,139 +339,3 @@ func addPutBucketReplicationUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketReplicationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketReplicationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketReplicationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketReplicationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketReplicationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketReplicationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketRequestPayment.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketRequestPayment.go index 427b7b10..14b2a5b6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketRequestPayment.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketRequestPayment.go @@ -4,28 +4,33 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the request payment configuration for a bucket. By default, the bucket // owner pays for downloads from the bucket. This configuration parameter enables // the bucket owner (only) to specify that the person requesting the download will -// be charged for the download. For more information, see Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html) -// . The following operations are related to PutBucketRequestPayment : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - GetBucketRequestPayment (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) +// be charged for the download. For more information, see [Requester Pays Buckets]. +// +// The following operations are related to PutBucketRequestPayment : +// +// [CreateBucket] +// +// [GetBucketRequestPayment] +// +// [GetBucketRequestPayment]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html +// [Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html func (c *Client) PutBucketRequestPayment(ctx context.Context, params *PutBucketRequestPaymentInput, optFns ...func(*Options)) (*PutBucketRequestPaymentOutput, error) { if params == nil { params = &PutBucketRequestPaymentInput{} @@ -53,31 +58,43 @@ type PutBucketRequestPaymentInput struct { // This member is required. RequestPaymentConfiguration *types.RequestPaymentConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. You must use this header as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, see RFC 1864 (http://www.ietf.org/rfc/rfc1864.txt) - // . For requests made using the Amazon Web Services Command Line Interface (CLI) - // or Amazon Web Services SDKs, this field is calculated automatically. + // transit. For more information, see [RFC 1864]. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketRequestPaymentInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketRequestPaymentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -86,6 +103,9 @@ type PutBucketRequestPaymentOutput struct { } func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketRequestPayment{}, middleware.After) if err != nil { return err @@ -94,34 +114,38 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketRequestPayment"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -133,10 +157,19 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketRequestPaymentResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketRequestPaymentValidationMiddleware(stack); err != nil { @@ -148,7 +181,7 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketRequestPaymentInputChecksumMiddlewares(stack, options); err != nil { @@ -169,12 +202,27 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -189,7 +237,6 @@ func newServiceMetadataMiddleware_opPutBucketRequestPayment(region string) *awsm return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketRequestPayment", } } @@ -239,139 +286,3 @@ func addPutBucketRequestPaymentUpdateEndpoint(stack *middleware.Stack, options O DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketRequestPaymentResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketRequestPaymentResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketRequestPaymentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketRequestPaymentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketRequestPaymentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketRequestPaymentResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketTagging.go index 9792ad38..5d9761c0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketTagging.go @@ -4,53 +4,65 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Sets the tags for a bucket. Use tags to organize your Amazon Web Services bill -// to reflect your own cost structure. To do this, sign up to get your Amazon Web -// Services account bill with tag key values included. Then, to see the cost of -// combined resources, organize your billing information according to resources -// with the same tag key values. For example, you can tag several resources with a -// specific application name, and then organize your billing information to see the -// total cost of that application across several services. For more information, -// see Cost Allocation and Tagging (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// and Using Cost Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html) -// . When this operation sets the tags for a bucket, it will overwrite any current +// This operation is not supported for directory buckets. +// +// Sets the tags for a bucket. +// +// Use tags to organize your Amazon Web Services bill to reflect your own cost +// structure. To do this, sign up to get your Amazon Web Services account bill with +// tag key values included. Then, to see the cost of combined resources, organize +// your billing information according to resources with the same tag key values. +// For example, you can tag several resources with a specific application name, and +// then organize your billing information to see the total cost of that application +// across several services. For more information, see [Cost Allocation and Tagging]and [Using Cost Allocation in Amazon S3 Bucket Tags]. +// +// When this operation sets the tags for a bucket, it will overwrite any current // tags the bucket already has. You cannot use this operation to add tags to an -// existing list of tags. To use this operation, you must have permissions to -// perform the s3:PutBucketTagging action. The bucket owner has this permission by -// default and can grant this permission to others. For more information about -// permissions, see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// . PutBucketTagging has the following special errors. For more Amazon S3 errors -// see, Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) -// . +// existing list of tags. +// +// To use this operation, you must have permissions to perform the +// s3:PutBucketTagging action. The bucket owner has this permission by default and +// can grant this permission to others. For more information about permissions, see +// [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// +// PutBucketTagging has the following special errors. For more Amazon S3 errors +// see, [Error Responses]. +// // - InvalidTag - The tag provided was not a valid tag. This error can occur if -// the tag did not pass input validation. For more information, see Using Cost -// Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html) -// . +// the tag did not pass input validation. For more information, see [Using Cost Allocation in Amazon S3 Bucket Tags]. +// // - MalformedXML - The XML provided does not match the schema. +// // - OperationAborted - A conflicting conditional action is currently in progress // against this resource. Please try again. +// // - InternalError - The service was unable to apply the provided tag to the // bucket. // // The following operations are related to PutBucketTagging : -// - GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) -// - DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) +// +// [GetBucketTagging] +// +// [DeleteBucketTagging] +// +// [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html +// [GetBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html +// [Cost Allocation and Tagging]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [DeleteBucketTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html +// [Using Cost Allocation in Amazon S3 Bucket Tags]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html func (c *Client) PutBucketTagging(ctx context.Context, params *PutBucketTaggingInput, optFns ...func(*Options)) (*PutBucketTaggingOutput, error) { if params == nil { params = &PutBucketTaggingInput{} @@ -78,31 +90,43 @@ type PutBucketTaggingInput struct { // This member is required. Tagging *types.Tagging - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. You must use this header as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, see RFC 1864 (http://www.ietf.org/rfc/rfc1864.txt) - // . For requests made using the Amazon Web Services Command Line Interface (CLI) - // or Amazon Web Services SDKs, this field is calculated automatically. + // transit. For more information, see [RFC 1864]. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketTaggingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -111,6 +135,9 @@ type PutBucketTaggingOutput struct { } func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketTagging{}, middleware.After) if err != nil { return err @@ -119,34 +146,38 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -158,10 +189,19 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketTaggingValidationMiddleware(stack); err != nil { @@ -173,7 +213,7 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketTaggingInputChecksumMiddlewares(stack, options); err != nil { @@ -194,12 +234,27 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -214,7 +269,6 @@ func newServiceMetadataMiddleware_opPutBucketTagging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketTagging", } } @@ -264,139 +318,3 @@ func addPutBucketTaggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketVersioning.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketVersioning.go index 9e3ddf76..fdff8fce 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketVersioning.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketVersioning.go @@ -4,42 +4,65 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Sets the versioning state of an existing bucket. You can set the versioning -// state with one of the following values: Enabled—Enables versioning for the -// objects in the bucket. All objects added to the bucket receive a unique version -// ID. Suspended—Disables versioning for the objects in the bucket. All objects -// added to the bucket receive the version ID null. If the versioning state has -// never been set on a bucket, it has no versioning state; a GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) -// request does not return a versioning state value. In order to enable MFA Delete, -// you must be the bucket owner. If you are the bucket owner and want to enable MFA -// Delete in the bucket versioning configuration, you must include the x-amz-mfa -// request header and the Status and the MfaDelete request elements in a request -// to set the versioning state of the bucket. If you have an object expiration -// lifecycle configuration in your non-versioned bucket and you want to maintain -// the same permanent delete behavior when you enable versioning, you must add a -// noncurrent expiration policy. The noncurrent expiration lifecycle configuration -// will manage the deletes of the noncurrent object versions in the version-enabled -// bucket. (A version-enabled bucket maintains one current and zero or more -// noncurrent object versions.) For more information, see Lifecycle and Versioning (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config) -// . The following operations are related to PutBucketVersioning : -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// - GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) +// This operation is not supported for directory buckets. +// +// When you enable versioning on a bucket for the first time, it might take a +// short amount of time for the change to be fully propagated. While this change is +// propagating, you may encounter intermittent HTTP 404 NoSuchKey errors for +// requests to objects created or updated after enabling versioning. We recommend +// that you wait for 15 minutes after enabling versioning before issuing write +// operations ( PUT or DELETE ) on objects in the bucket. +// +// Sets the versioning state of an existing bucket. +// +// You can set the versioning state with one of the following values: +// +// Enabled—Enables versioning for the objects in the bucket. All objects added to +// the bucket receive a unique version ID. +// +// Suspended—Disables versioning for the objects in the bucket. All objects added +// to the bucket receive the version ID null. +// +// If the versioning state has never been set on a bucket, it has no versioning +// state; a [GetBucketVersioning]request does not return a versioning state value. +// +// In order to enable MFA Delete, you must be the bucket owner. If you are the +// bucket owner and want to enable MFA Delete in the bucket versioning +// configuration, you must include the x-amz-mfa request header and the Status and +// the MfaDelete request elements in a request to set the versioning state of the +// bucket. +// +// If you have an object expiration lifecycle configuration in your non-versioned +// bucket and you want to maintain the same permanent delete behavior when you +// enable versioning, you must add a noncurrent expiration policy. The noncurrent +// expiration lifecycle configuration will manage the deletes of the noncurrent +// object versions in the version-enabled bucket. (A version-enabled bucket +// maintains one current and zero or more noncurrent object versions.) For more +// information, see [Lifecycle and Versioning]. +// +// The following operations are related to PutBucketVersioning : +// +// [CreateBucket] +// +// [DeleteBucket] +// +// [GetBucketVersioning] +// +// [DeleteBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html +// [CreateBucket]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html +// [Lifecycle and Versioning]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config +// [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html func (c *Client) PutBucketVersioning(ctx context.Context, params *PutBucketVersioningInput, optFns ...func(*Options)) (*PutBucketVersioningOutput, error) { if params == nil { params = &PutBucketVersioningInput{} @@ -67,26 +90,32 @@ type PutBucketVersioningInput struct { // This member is required. VersioningConfiguration *types.VersioningConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // >The base64-encoded 128-bit MD5 digest of the data. You must use this header as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, see RFC 1864 (http://www.ietf.org/rfc/rfc1864.txt) - // . For requests made using the Amazon Web Services Command Line Interface (CLI) - // or Amazon Web Services SDKs, this field is calculated automatically. + // transit. For more information, see [RFC 1864]. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The concatenation of the authentication device's serial number, a space, and @@ -96,6 +125,12 @@ type PutBucketVersioningInput struct { noSmithyDocumentSerde } +func (in *PutBucketVersioningInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketVersioningOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -104,6 +139,9 @@ type PutBucketVersioningOutput struct { } func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketVersioning{}, middleware.After) if err != nil { return err @@ -112,34 +150,38 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketVersioning"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -151,10 +193,19 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutBucketVersioningResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketVersioningValidationMiddleware(stack); err != nil { @@ -166,7 +217,7 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketVersioningInputChecksumMiddlewares(stack, options); err != nil { @@ -187,12 +238,27 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -207,7 +273,6 @@ func newServiceMetadataMiddleware_opPutBucketVersioning(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketVersioning", } } @@ -257,139 +322,3 @@ func addPutBucketVersioningUpdateEndpoint(stack *middleware.Stack, options Optio DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketVersioningResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketVersioningResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketVersioningResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketVersioningInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketVersioningResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketVersioningResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketWebsite.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketWebsite.go index e21b4c17..be78f71a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketWebsite.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutBucketWebsite.go @@ -4,36 +4,40 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the configuration of the website that is specified in the website // subresource. To configure a bucket as a website, you can add this subresource on // the bucket with website configuration information such as the file name of the -// index document and any redirect rules. For more information, see Hosting -// Websites on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) -// . This PUT action requires the S3:PutBucketWebsite permission. By default, only +// index document and any redirect rules. For more information, see [Hosting Websites on Amazon S3]. +// +// This PUT action requires the S3:PutBucketWebsite permission. By default, only // the bucket owner can configure the website attached to a bucket; however, bucket // owners can allow other users to set the website configuration by writing a -// bucket policy that grants them the S3:PutBucketWebsite permission. To redirect -// all website requests sent to the bucket's website endpoint, you add a website -// configuration with the following elements. Because all requests are sent to -// another website, you don't need to provide index document name for the bucket. +// bucket policy that grants them the S3:PutBucketWebsite permission. +// +// To redirect all website requests sent to the bucket's website endpoint, you add +// a website configuration with the following elements. Because all requests are +// sent to another website, you don't need to provide index document name for the +// bucket. +// // - WebsiteConfiguration +// // - RedirectAllRequestsTo +// // - HostName +// // - Protocol // // If you want granular control over redirects, you can use the following elements @@ -41,27 +45,47 @@ import ( // information about the redirect destination. In this case, the website // configuration must provide an index document for the bucket, because some // requests might not be redirected. +// // - WebsiteConfiguration +// // - IndexDocument +// // - Suffix +// // - ErrorDocument +// // - Key +// // - RoutingRules +// // - RoutingRule +// // - Condition +// // - HttpErrorCodeReturnedEquals +// // - KeyPrefixEquals +// // - Redirect +// // - Protocol +// // - HostName +// // - ReplaceKeyPrefixWith +// // - ReplaceKeyWith +// // - HttpRedirectCode // // Amazon S3 has a limitation of 50 routing rules per website configuration. If // you require more than 50 routing rules, you can use object redirect. For more -// information, see Configuring an Object Redirect (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html) -// in the Amazon S3 User Guide. The maximum request length is limited to 128 KB. +// information, see [Configuring an Object Redirect]in the Amazon S3 User Guide. +// +// The maximum request length is limited to 128 KB. +// +// [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html +// [Configuring an Object Redirect]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html func (c *Client) PutBucketWebsite(ctx context.Context, params *PutBucketWebsiteInput, optFns ...func(*Options)) (*PutBucketWebsiteOutput, error) { if params == nil { params = &PutBucketWebsiteInput{} @@ -89,31 +113,43 @@ type PutBucketWebsiteInput struct { // This member is required. WebsiteConfiguration *types.WebsiteConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. You must use this header as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, see RFC 1864 (http://www.ietf.org/rfc/rfc1864.txt) - // . For requests made using the Amazon Web Services Command Line Interface (CLI) - // or Amazon Web Services SDKs, this field is calculated automatically. + // transit. For more information, see [RFC 1864]. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutBucketWebsiteInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutBucketWebsiteOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -122,6 +158,9 @@ type PutBucketWebsiteOutput struct { } func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutBucketWebsite{}, middleware.After) if err != nil { return err @@ -130,34 +169,38 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutBucketWebsite"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -169,10 +212,19 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutBucketWebsiteResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutBucketWebsiteValidationMiddleware(stack); err != nil { @@ -184,7 +236,7 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutBucketWebsiteInputChecksumMiddlewares(stack, options); err != nil { @@ -205,12 +257,27 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -225,7 +292,6 @@ func newServiceMetadataMiddleware_opPutBucketWebsite(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutBucketWebsite", } } @@ -275,139 +341,3 @@ func addPutBucketWebsiteUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutBucketWebsiteResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutBucketWebsiteResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutBucketWebsiteResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutBucketWebsiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutBucketWebsiteResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutBucketWebsiteResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go index 51c2f1fd..37ea1434 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go @@ -4,91 +4,118 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "time" ) -// Adds an object to a bucket. You must have WRITE permissions on a bucket to add -// an object to it. Amazon S3 never adds partial objects; if you receive a success -// response, Amazon S3 added the entire object to the bucket. You cannot use -// PutObject to only update a single piece of metadata for an existing object. You -// must put the entire object with updated metadata if you want to update some -// values. Amazon S3 is a distributed system. If it receives multiple write -// requests for the same object simultaneously, it overwrites all but the last -// object written. To prevent objects from being deleted or overwritten, you can -// use Amazon S3 Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) -// . To ensure that data is not corrupted traversing the network, use the -// Content-MD5 header. When you use this header, Amazon S3 checks the object -// against the provided MD5 value and, if they do not match, returns an error. -// Additionally, you can calculate the MD5 while putting an object to Amazon S3 and -// compare the returned ETag to the calculated MD5 value. -// - To successfully complete the PutObject request, you must have the -// s3:PutObject in your IAM permissions. -// - To successfully change the objects acl of your PutObject request, you must -// have the s3:PutObjectAcl in your IAM permissions. -// - To successfully set the tag-set with your PutObject request, you must have -// the s3:PutObjectTagging in your IAM permissions. -// - The Content-MD5 header is required for any request to upload an object with -// a retention period configured using Amazon S3 Object Lock. For more information -// about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html) -// in the Amazon S3 User Guide. +// Adds an object to a bucket. // -// You have four mutually exclusive options to protect data using server-side -// encryption in Amazon S3, depending on how you choose to manage the encryption -// keys. Specifically, the encryption key options are Amazon S3 managed keys -// (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and -// customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side -// encryption by using Amazon S3 managed keys (SSE-S3) by default. You can -// optionally tell Amazon S3 to encrypt data at rest by using server-side -// encryption with other key options. For more information, see Using Server-Side -// Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) -// . When adding a new object, you can use headers to grant ACL-based permissions -// to individual Amazon Web Services accounts or to predefined groups defined by -// Amazon S3. These permissions are then added to the ACL on the object. By -// default, all objects are private. Only the owner has full access control. For -// more information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// and Managing ACLs Using the REST API (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html) -// . If the bucket that you're uploading objects to uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect -// permissions. Buckets that use this setting only accept PUT requests that don't -// specify an ACL or PUT requests that specify bucket owner full control ACLs, such -// as the bucket-owner-full-control canned ACL or an equivalent form of this ACL -// expressed in the XML format. PUT requests that contain other ACLs (for example, -// custom grants to certain Amazon Web Services accounts) fail and return a 400 -// error with the error code AccessControlListNotSupported . For more information, -// see Controlling ownership of objects and disabling ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. If your bucket uses the bucket owner enforced -// setting for Object Ownership, all objects written to the bucket by any account -// will be owned by the bucket owner. By default, Amazon S3 uses the STANDARD -// Storage Class to store newly created objects. The STANDARD storage class -// provides high durability and high availability. Depending on performance needs, -// you can specify a different Storage Class. Amazon S3 on Outposts only uses the -// OUTPOSTS Storage Class. For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -// in the Amazon S3 User Guide. If you enable versioning for a bucket, Amazon S3 -// automatically generates a unique version ID for the object being stored. Amazon -// S3 returns this ID in the response. When you enable versioning for a bucket, if -// Amazon S3 receives multiple write requests for the same object simultaneously, -// it stores all of the objects. For more information about versioning, see Adding -// Objects to Versioning-Enabled Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html) -// . For information about returning the versioning state of a bucket, see -// GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) -// . For more information about related Amazon S3 APIs, see the following: -// - CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) +// - Amazon S3 never adds partial objects; if you receive a success response, +// Amazon S3 added the entire object to the bucket. You cannot use PutObject to +// only update a single piece of metadata for an existing object. You must put the +// entire object with updated metadata if you want to update some values. +// +// - If your bucket uses the bucket owner enforced setting for Object Ownership, +// ACLs are disabled and no longer affect permissions. All objects written to the +// bucket by any account will be owned by the bucket owner. +// +// - Directory buckets - For directory buckets, you must make requests for this +// API operation to the Zonal endpoint. These endpoints support +// virtual-hosted-style requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information +// about endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Amazon S3 is a distributed system. If it receives multiple write requests for +// the same object simultaneously, it overwrites all but the last object written. +// However, Amazon S3 provides features that can modify this behavior: +// +// - S3 Object Lock - To prevent objects from being deleted or overwritten, you +// can use [Amazon S3 Object Lock]in the Amazon S3 User Guide. +// +// This functionality is not supported for directory buckets. +// +// - S3 Versioning - When you enable versioning for a bucket, if Amazon S3 +// receives multiple write requests for the same object simultaneously, it stores +// all versions of the objects. For each write request that is made to the same +// object, Amazon S3 automatically generates a unique version ID of that object +// being stored in Amazon S3. You can retrieve, replace, or delete any version of +// the object. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User +// Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning] +// . +// +// This functionality is not supported for directory buckets. +// +// Permissions +// +// - General purpose bucket permissions - The following permissions are required +// in your policies when your PutObject request includes specific headers. +// +// - s3:PutObject - To successfully complete the PutObject request, you must +// always have the s3:PutObject permission on a bucket to add an object to it. +// +// - s3:PutObjectAcl - To successfully change the objects ACL of your PutObject +// request, you must have the s3:PutObjectAcl . +// +// - s3:PutObjectTagging - To successfully set the tag-set with your PutObject +// request, you must have the s3:PutObjectTagging . +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// Data integrity with Content-MD5 +// +// - General purpose bucket - To ensure that data is not corrupted traversing +// the network, use the Content-MD5 header. When you use this header, Amazon S3 +// checks the object against the provided MD5 value and, if they do not match, +// Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 +// digest, you can calculate the MD5 while putting the object to Amazon S3 and +// compare the returned ETag to the calculated MD5 value. +// +// - Directory bucket - This functionality is not supported for directory +// buckets. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// +// For more information about related Amazon S3 APIs, see the following: +// +// [CopyObject] +// +// [DeleteObject] +// +// [Amazon S3 Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html +// [DeleteObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html +// [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html func (c *Client) PutObject(ctx context.Context, params *PutObjectInput, optFns ...func(*Options)) (*PutObjectOutput, error) { if params == nil { params = &PutObjectInput{} @@ -106,21 +133,40 @@ func (c *Client) PutObject(ctx context.Context, params *PutObjectInput, optFns . type PutObjectInput struct { - // The bucket name to which the PUT action was initiated. When using this action - // with an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The bucket name to which the PUT action was initiated. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -130,8 +176,33 @@ type PutObjectInput struct { // This member is required. Key *string - // The canned ACL to apply to the object. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) - // . This action is not supported by Amazon S3 on Outposts. + // The canned ACL to apply to the object. For more information, see [Canned ACL] in the Amazon + // S3 User Guide. + // + // When adding a new object, you can use headers to grant ACL-based permissions to + // individual Amazon Web Services accounts or to predefined groups defined by + // Amazon S3. These permissions are then added to the ACL on the object. By + // default, all objects are private. Only the owner has full access control. For + // more information, see [Access Control List (ACL) Overview]and [Managing ACLs Using the REST API] in the Amazon S3 User Guide. + // + // If the bucket that you're uploading objects to uses the bucket owner enforced + // setting for S3 Object Ownership, ACLs are disabled and no longer affect + // permissions. Buckets that use this setting only accept PUT requests that don't + // specify an ACL or PUT requests that specify bucket owner full control ACLs, such + // as the bucket-owner-full-control canned ACL or an equivalent form of this ACL + // expressed in the XML format. PUT requests that contain other ACLs (for example, + // custom grants to certain Amazon Web Services accounts) fail and return a 400 + // error with the error code AccessControlListNotSupported . For more information, + // see [Controlling ownership of objects and disabling ACLs]in the Amazon S3 User Guide. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. + // + // [Managing ACLs Using the REST API]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html + // [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html + // [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL + // [Controlling ownership of objects and disabling ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html ACL types.ObjectCannedACL // Object data. @@ -139,141 +210,250 @@ type PutObjectInput struct { // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption // with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). - // Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object - // encryption with SSE-KMS. Specifying this header with a PUT action doesn’t affect - // bucket-level settings for S3 Bucket Key. - BucketKeyEnabled bool + // + // General purpose buckets - Setting this header to true causes Amazon S3 to use + // an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this + // header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. + // + // Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + // operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + // supported, when you copy SSE-KMS encrypted objects from general purpose buckets + // to directory buckets, from directory buckets to general purpose buckets, or + // between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + // call to KMS every time a copy request is made for a KMS-encrypted object. + // + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + // [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + BucketKeyEnabled *bool // Can be used to specify caching behavior along the request/reply chain. For more - // information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) - // . + // information, see [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]. + // + // [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 CacheControl *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum-algorithm or x-amz-trailer header sent. Otherwise, Amazon S3 + // fails the request with the HTTP status code 400 Bad Request . + // + // For the x-amz-checksum-algorithm header, replace algorithm with the + // supported algorithm from the following list: + // + // - CRC32 + // + // - CRC32C + // + // - SHA1 + // + // - SHA256 + // + // For more information, see [Checking object integrity] in the Amazon S3 User Guide. + // + // If the individual checksum value you provide through x-amz-checksum-algorithm + // doesn't match the checksum algorithm you set through + // x-amz-sdk-checksum-algorithm , Amazon S3 ignores any provided ChecksumAlgorithm + // parameter and uses the checksum algorithm that matches the provided value in + // x-amz-checksum-algorithm . + // + // The Content-MD5 or x-amz-sdk-checksum-algorithm header is required for any + // request to upload an object with a retention period configured using Amazon S3 + // Object Lock. For more information, see [Uploading objects to an Object Lock enabled bucket]in the Amazon S3 User Guide. + // + // For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the + // default checksum algorithm that's used for performance. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html + // [Uploading objects to an Object Lock enabled bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object ChecksumAlgorithm types.ChecksumAlgorithm // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32 checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32C checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + // [Checking object integrity]in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string - // Specifies presentational information for the object. For more information, see - // https://www.rfc-editor.org/rfc/rfc6266#section-4 (https://www.rfc-editor.org/rfc/rfc6266#section-4) - // . + // Specifies presentational information for the object. For more information, see [https://www.rfc-editor.org/rfc/rfc6266#section-4]. + // + // [https://www.rfc-editor.org/rfc/rfc6266#section-4]: https://www.rfc-editor.org/rfc/rfc6266#section-4 ContentDisposition *string // Specifies what content encodings have been applied to the object and thus what // decoding mechanisms must be applied to obtain the media-type referenced by the - // Content-Type header field. For more information, see - // https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding (https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding) - // . + // Content-Type header field. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]. + // + // [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding ContentEncoding *string // The language the content is in. ContentLanguage *string // Size of the body in bytes. This parameter is useful when the size of the body - // cannot be determined automatically. For more information, see - // https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length (https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length) - // . - ContentLength int64 + // cannot be determined automatically. For more information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]. + // + // [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length + ContentLength *int64 // The base64-encoded 128-bit MD5 digest of the message (without the headers) // according to RFC 1864. This header can be used as a message integrity check to // verify that the data is the same data that was originally sent. Although it is // optional, we recommend using the Content-MD5 mechanism as an end-to-end - // integrity check. For more information about REST request authentication, see - // REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // . + // integrity check. For more information about REST request authentication, see [REST Authentication]. + // + // The Content-MD5 or x-amz-sdk-checksum-algorithm header is required for any + // request to upload an object with a retention period configured using Amazon S3 + // Object Lock. For more information, see [Uploading objects to an Object Lock enabled bucket]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + // [Uploading objects to an Object Lock enabled bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object ContentMD5 *string // A standard MIME type describing the format of the contents. For more - // information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type (https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type) - // . + // information, see [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]. + // + // [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type ContentType *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The date and time at which the object is no longer cacheable. For more - // information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3 (https://www.rfc-editor.org/rfc/rfc7234#section-5.3) - // . + // information, see [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]. + // + // [https://www.rfc-editor.org/rfc/rfc7234#section-5.3]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3 Expires *time.Time - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. This - // action is not supported by Amazon S3 on Outposts. + // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantFullControl *string - // Allows grantee to read the object data and its metadata. This action is not - // supported by Amazon S3 on Outposts. + // Allows grantee to read the object data and its metadata. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantRead *string - // Allows grantee to read the object ACL. This action is not supported by Amazon - // S3 on Outposts. + // Allows grantee to read the object ACL. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantReadACP *string - // Allows grantee to write the ACL for the applicable object. This action is not - // supported by Amazon S3 on Outposts. + // Allows grantee to write the ACL for the applicable object. + // + // - This functionality is not supported for directory buckets. + // + // - This functionality is not supported for Amazon S3 on Outposts. GrantWriteACP *string + // Uploads the object only if the ETag (entity tag) value provided during the + // WRITE operation matches the ETag of the object in S3. If the ETag values do not + // match, the operation returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should fetch the + // object's ETag and retry the upload. + // + // Expects the ETag value as a string. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfMatch *string + + // Uploads the object only if the object key name does not already exist in the + // bucket specified. Otherwise, Amazon S3 returns a 412 Precondition Failed error. + // + // If a conflicting operation occurs during the upload S3 returns a 409 + // ConditionalRequestConflict response. On a 409 failure you should retry the + // upload. + // + // Expects the '*' (asterisk) character. + // + // For more information about conditional requests, see [RFC 7232], or [Conditional requests] in the Amazon S3 + // User Guide. + // + // [Conditional requests]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html + // [RFC 7232]: https://tools.ietf.org/html/rfc7232 + IfNoneMatch *string + // A map of metadata to store with the object in S3. Metadata map[string]string // Specifies whether a legal hold will be applied to this object. For more - // information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) - // . + // information about S3 Object Lock, see [Object Lock]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus // The Object Lock mode that you want to apply to this object. + // + // This functionality is not supported for directory buckets. ObjectLockMode types.ObjectLockMode // The date and time when you want this object's Object Lock to expire. Must be // formatted as a timestamp parameter. + // + // This functionality is not supported for directory buckets. ObjectLockRetainUntilDate *time.Time // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Specifies the algorithm to use when encrypting the object (for example, AES256 ). + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -281,139 +461,303 @@ type PutObjectInput struct { // discarded; Amazon S3 does not store the encryption key. The key must be // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. + // + // This functionality is not supported for directory buckets. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. This value is stored as object - // metadata and automatically gets passed on to Amazon Web Services KMS for future - // GetObject or CopyObject operations on this object. + // Specifies the Amazon Web Services KMS Encryption Context as an additional + // encryption context to use for object encryption. The value of this header is a + // Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption + // context as key-value pairs. This value is stored as object metadata and + // automatically gets passed on to Amazon Web Services KMS for future GetObject + // operations on this object. + // + // General purpose buckets - This value must be explicitly added during CopyObject + // operations if you want an additional encryption context for your object. For + // more information, see [Encryption context]in the Amazon S3 User Guide. + // + // Directory buckets - You can optionally provide an explicit encryption context + // value. The value must match the default encryption context - the bucket Amazon + // Resource Name (ARN). An additional encryption context value is not supported. + // + // [Encryption context]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context SSEKMSEncryptionContext *string - // If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse , - // this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key - // Management Service (KMS) symmetric encryption customer managed key that was used - // for the object. If you specify x-amz-server-side-encryption:aws:kms or + // Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object + // encryption. If the KMS key doesn't exist in the same account that's issuing the + // command, you must use the full Key ARN not the Key ID. + // + // General purpose buckets - If you specify x-amz-server-side-encryption with + // aws:kms or aws:kms:dsse , this header specifies the ID (Key ID, Key ARN, or Key + // Alias) of the KMS key to use. If you specify + // x-amz-server-side-encryption:aws:kms or // x-amz-server-side-encryption:aws:kms:dsse , but do not provide // x-amz-server-side-encryption-aws-kms-key-id , Amazon S3 uses the Amazon Web - // Services managed key ( aws/s3 ) to protect the data. If the KMS key does not - // exist in the same account that's issuing the command, you must use the full ARN - // and not just the ID. + // Services managed key ( aws/s3 ) to protect the data. + // + // Directory buckets - If you specify x-amz-server-side-encryption with aws:kms , + // the x-amz-server-side-encryption-aws-kms-key-id header is implicitly assigned + // the ID of the KMS symmetric encryption customer managed key that's configured + // for your directory bucket's default encryption setting. If you want to specify + // the x-amz-server-side-encryption-aws-kms-key-id header explicitly, you can only + // specify it with the ID (Key ID or Key ARN) of the KMS customer managed key + // that's configured for your directory bucket's default encryption setting. + // Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key + // ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS + // configuration can only support 1 [customer managed key]per directory bucket for the lifetime of the + // bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't supported. + // + // [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm that was used when you store this object + // in Amazon S3 (for example, AES256 , aws:kms , aws:kms:dsse ). + // + // - General purpose buckets - You have four mutually exclusive options to + // protect data using server-side encryption in Amazon S3, depending on how you + // choose to manage the encryption keys. Specifically, the encryption key options + // are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or + // DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with + // server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You + // can optionally tell Amazon S3 to encrypt data at rest by using server-side + // encryption with other key options. For more information, see [Using Server-Side Encryption]in the Amazon S3 + // User Guide. + // + // - Directory buckets - For directory buckets, there are only two supported + // options for server-side encryption: server-side encryption with Amazon S3 + // managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys + // (SSE-KMS) ( aws:kms ). We recommend that the bucket's default encryption uses + // the desired encryption configuration and you don't override the bucket default + // encryption in your CreateSession requests or PUT object requests. Then, new + // objects are automatically encrypted with the desired encryption settings. For + // more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. For more information about + // the encryption overriding behaviors in directory buckets, see [Specifying server-side encryption with KMS for new object uploads]. + // + // In the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]) using the REST API, the + // encryption request headers must match the encryption settings that are specified + // in the CreateSession request. You can't override the values of the encryption + // settings ( x-amz-server-side-encryption , + // x-amz-server-side-encryption-aws-kms-key-id , + // x-amz-server-side-encryption-context , and + // x-amz-server-side-encryption-bucket-key-enabled ) that are specified in the + // CreateSession request. You don't need to explicitly specify these encryption + // settings values in Zonal endpoint API calls, and Amazon S3 will use the + // encryption settings values from the CreateSession request to protect new + // objects in the directory bucket. + // + // When you use the CLI or the Amazon Web Services SDKs, for CreateSession , the + // session token refreshes automatically to avoid service interruptions when a + // session expires. The CLI or the Amazon Web Services SDKs use the bucket's + // default encryption configuration for the CreateSession request. It's not + // supported to override the encryption settings values in the CreateSession + // request. So in the Zonal endpoint API calls (except [CopyObject]and [UploadPartCopy]), the encryption + // request headers must match the default encryption configuration of the directory + // bucket. + // + // [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html + // [Specifying server-side encryption with KMS for new object uploads]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html + // [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html ServerSideEncryption types.ServerSideEncryption // By default, Amazon S3 uses the STANDARD Storage Class to store newly created // objects. The STANDARD storage class provides high durability and high // availability. Depending on performance needs, you can specify a different - // Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For - // more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. + // Storage Class. For more information, see [Storage Classes]in the Amazon S3 User Guide. + // + // - For directory buckets, only the S3 Express One Zone storage class is + // supported to store newly created objects. + // + // - Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html StorageClass types.StorageClass // The tag-set for the object. The tag-set must be encoded as URL Query // parameters. (For example, "Key1=Value1") + // + // This functionality is not supported for directory buckets. Tagging *string // If the bucket is configured as a website, redirects requests for this object to // another object in the same bucket or to an external URL. Amazon S3 stores the // value of this header in the object metadata. For information about object - // metadata, see Object Key and Metadata (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html) - // . In the following example, the request header sets the redirect to an object - // (anotherPage.html) in the same bucket: x-amz-website-redirect-location: - // /anotherPage.html In the following example, the request header sets the object - // redirect to another website: x-amz-website-redirect-location: - // http://www.example.com/ For more information about website hosting in Amazon S3, - // see Hosting Websites on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) - // and How to Configure Website Page Redirects (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html) - // . + // metadata, see [Object Key and Metadata]in the Amazon S3 User Guide. + // + // In the following example, the request header sets the redirect to an object + // (anotherPage.html) in the same bucket: + // + // x-amz-website-redirect-location: /anotherPage.html + // + // In the following example, the request header sets the object redirect to + // another website: + // + // x-amz-website-redirect-location: http://www.example.com/ + // + // For more information about website hosting in Amazon S3, see [Hosting Websites on Amazon S3] and [How to Configure Website Page Redirects] in the + // Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. + // + // [How to Configure Website Page Redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html + // [Hosting Websites on Amazon S3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html + // [Object Key and Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html WebsiteRedirectLocation *string + // Specifies the offset for appending data to existing objects in bytes. The + // offset must be equal to the size of the existing object being appended to. If no + // object exists, setting this header to 0 will create a new object. + // + // This functionality is only supported for objects in the Amazon S3 Express One + // Zone storage class in directory buckets. + WriteOffsetBytes *int64 + noSmithyDocumentSerde } +func (in *PutObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type PutObjectOutput struct { // Indicates whether the uploaded object uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + BucketKeyEnabled *bool + + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Entity tag for the uploaded object. + // + // General purpose buckets - To ensure that data is not corrupted traversing the + // network, for objects where the ETag is the MD5 digest of the object, you can + // calculate the MD5 while putting an object to Amazon S3 and compare the returned + // ETag to the calculated MD5 value. + // + // Directory buckets - The ETag for the object in a directory bucket isn't the MD5 + // digest of the object. ETag *string - // If the expiration is configured for the object (see - // PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) - // ), the response includes this header. It includes the expiry-date and rule-id - // key-value pairs that provide information about object expiration. The value of - // the rule-id is URL-encoded. + // If the expiration is configured for the object (see [PutBucketLifecycleConfiguration]) in the Amazon S3 User + // Guide, the response includes this header. It includes the expiry-date and + // rule-id key-value pairs that provide information about object expiration. The + // value of the rule-id is URL-encoded. + // + // Object expiration information is not returned in directory buckets and this + // header returns the value " NotImplemented " in all responses for directory + // buckets. + // + // [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html Expiration *string // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the Amazon Web Services KMS Encryption Context to use for - // object encryption. The value of this header is a base64-encoded UTF-8 string - // holding JSON with the encryption context key-value pairs. This value is stored - // as object metadata and automatically gets passed on to Amazon Web Services KMS - // for future GetObject or CopyObject operations on this object. + // If present, indicates the Amazon Web Services KMS Encryption Context to use for + // object encryption. The value of this header is a Base64-encoded string of a + // UTF-8 encoded JSON, which contains the encryption context as key-value pairs. + // This value is stored as object metadata and automatically gets passed on to + // Amazon Web Services KMS for future GetObject operations on this object. SSEKMSEncryptionContext *string - // If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse , - // this header specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms , aws:kms:dsse ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3. ServerSideEncryption types.ServerSideEncryption - // Version of the object. + // The size of the object in bytes. This will only be present if you append to an + // object. + // + // This functionality is only supported for objects in the Amazon S3 Express One + // Zone storage class in directory buckets. + Size *int64 + + // Version ID of the object. + // + // If you enable versioning for a bucket, Amazon S3 automatically generates a + // unique version ID for the object being stored. Amazon S3 returns this ID in the + // response. When you enable versioning for a bucket, if Amazon S3 receives + // multiple write requests for the same object simultaneously, it stores all of the + // objects. For more information about versioning, see [Adding Objects to Versioning-Enabled Buckets]in the Amazon S3 User + // Guide. For information about returning the versioning state of a bucket, see [GetBucketVersioning]. + // + // This functionality is not supported for directory buckets. + // + // [Adding Objects to Versioning-Enabled Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html + // [GetBucketVersioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html VersionId *string // Metadata pertaining to the operation's result. @@ -423,6 +767,9 @@ type PutObjectOutput struct { } func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObject{}, middleware.After) if err != nil { return err @@ -431,34 +778,38 @@ func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, optio if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -470,10 +821,19 @@ func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, optio if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addPutObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectValidationMiddleware(stack); err != nil { @@ -488,7 +848,7 @@ func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, optio if err = add100Continue(stack, options); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectInputChecksumMiddlewares(stack, options); err != nil { @@ -512,12 +872,24 @@ func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, optio if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -532,7 +904,6 @@ func newServiceMetadataMiddleware_opPutObject(region string) *awsmiddleware.Regi return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObject", } } @@ -615,139 +986,3 @@ func addPutObjectPayloadAsUnsigned(stack *middleware.Stack, options Options) err v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opPutObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectAcl.go index 22a0dcc2..6c13ee83 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectAcl.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectAcl.go @@ -4,102 +4,162 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Uses the acl subresource to set the access control list (ACL) permissions for a -// new or existing object in an S3 bucket. You must have WRITE_ACP permission to -// set the ACL of an object. For more information, see What permissions can I -// grant? (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions) -// in the Amazon S3 User Guide. This action is not supported by Amazon S3 on -// Outposts. Depending on your application needs, you can choose to set the ACL on -// an object using either the request body or the headers. For example, if you have -// an existing application that updates a bucket ACL using the request body, you -// can continue to use that approach. For more information, see Access Control -// List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// in the Amazon S3 User Guide. If your bucket uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect -// permissions. You must use policies to grant access to your bucket and the -// objects in it. Requests to set ACLs or update ACLs fail and return the -// AccessControlListNotSupported error code. Requests to read ACLs are still -// supported. For more information, see Controlling object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. Permissions You can set access permissions using -// one of the following methods: +// new or existing object in an S3 bucket. You must have the WRITE_ACP permission +// to set the ACL of an object. For more information, see [What permissions can I grant?]in the Amazon S3 User +// Guide. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// Depending on your application needs, you can choose to set the ACL on an object +// using either the request body or the headers. For example, if you have an +// existing application that updates a bucket ACL using the request body, you can +// continue to use that approach. For more information, see [Access Control List (ACL) Overview]in the Amazon S3 User +// Guide. +// +// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, +// ACLs are disabled and no longer affect permissions. You must use policies to +// grant access to your bucket and the objects in it. Requests to set ACLs or +// update ACLs fail and return the AccessControlListNotSupported error code. +// Requests to read ACLs are still supported. For more information, see [Controlling object ownership]in the +// Amazon S3 User Guide. +// +// Permissions You can set access permissions using one of the following methods: +// // - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports a // set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined // set of grantees and permissions. Specify the canned ACL name as the value of // x-amz-ac l. If you use this header, you cannot use other access -// control-specific headers in your request. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) -// . +// control-specific headers in your request. For more information, see [Canned ACL]. +// // - Specify access permissions explicitly with the x-amz-grant-read , // x-amz-grant-read-acp , x-amz-grant-write-acp , and x-amz-grant-full-control // headers. When using these headers, you specify explicit access permissions and // grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the // permission. If you use these ACL-specific headers, you cannot use x-amz-acl // header to set a canned ACL. These parameters map to the set of permissions that -// Amazon S3 supports in an ACL. For more information, see Access Control List -// (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// . You specify each grantee as a type=value pair, where the type is one of the -// following: -// - id – if the value specified is the canonical user ID of an Amazon Web -// Services account -// - uri – if you are granting permissions to a predefined group -// - emailAddress – if the value specified is the email address of an Amazon Web -// Services account Using email addresses to specify a grantee is only supported in -// the following Amazon Web Services Regions: -// - US East (N. Virginia) -// - US West (N. California) -// - US West (Oregon) -// - Asia Pacific (Singapore) -// - Asia Pacific (Sydney) -// - Asia Pacific (Tokyo) -// - Europe (Ireland) -// - South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-read header grants list objects permission to the two Amazon Web -// Services accounts identified by their email addresses. x-amz-grant-read: -// emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// Amazon S3 supports in an ACL. For more information, see [Access Control List (ACL) Overview]. +// +// You specify each grantee as a type=value pair, where the type is one of the +// +// following: +// +// - id – if the value specified is the canonical user ID of an Amazon Web +// Services account +// +// - uri – if you are granting permissions to a predefined group +// +// - emailAddress – if the value specified is the email address of an Amazon Web +// Services account +// +// Using email addresses to specify a grantee is only supported in the following +// +// Amazon Web Services Regions: +// +// - US East (N. Virginia) +// +// - US West (N. California) +// +// - US West (Oregon) +// +// - Asia Pacific (Singapore) +// +// - Asia Pacific (Sydney) +// +// - Asia Pacific (Tokyo) +// +// - Europe (Ireland) +// +// - South America (São Paulo) +// +// For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the +// +// Amazon Web Services General Reference. +// +// For example, the following x-amz-grant-read header grants list objects +// +// permission to the two Amazon Web Services accounts identified by their email +// addresses. +// +// x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" // // You can use either a canned ACL or specify access permissions explicitly. You -// cannot do both. Grantee Values You can specify the person (grantee) to whom -// you're assigning access rights (using request elements) in the following ways: -// - By the person's ID: <>ID<><>GranteesEmail<> DisplayName is optional and -// ignored in the request. -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> -// - By Email address: <>Grantees@email.com<>lt;/Grantee> The grantee is resolved -// to the CanonicalUser and, in a response to a GET Object acl request, appears as -// the CanonicalUser. Using email addresses to specify a grantee is only supported -// in the following Amazon Web Services Regions: -// - US East (N. Virginia) -// - US West (N. California) -// - US West (Oregon) -// - Asia Pacific (Singapore) -// - Asia Pacific (Sydney) -// - Asia Pacific (Tokyo) -// - Europe (Ireland) -// - South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. +// cannot do both. +// +// Grantee Values You can specify the person (grantee) to whom you're assigning +// access rights (using request elements) in the following ways: +// +// - By the person's ID: +// +// <>ID<><>GranteesEmail<> +// +// DisplayName is optional and ignored in the request. +// +// - By URI: +// +// <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// +// - By Email address: +// +// <>Grantees@email.com<>lt;/Grantee> +// +// The grantee is resolved to the CanonicalUser and, in a response to a GET Object +// +// acl request, appears as the CanonicalUser. +// +// Using email addresses to specify a grantee is only supported in the following +// +// Amazon Web Services Regions: +// +// - US East (N. Virginia) +// +// - US West (N. California) +// +// - US West (Oregon) +// +// - Asia Pacific (Singapore) +// +// - Asia Pacific (Sydney) +// +// - Asia Pacific (Tokyo) +// +// - Europe (Ireland) +// +// - South America (São Paulo) +// +// For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints]in the +// +// Amazon Web Services General Reference. // // Versioning The ACL of an object is set at the object version level. By default, // PUT sets the ACL of the current version of an object. To set the ACL of a -// different version, use the versionId subresource. The following operations are -// related to PutObjectAcl : -// - CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) +// different version, use the versionId subresource. +// +// The following operations are related to PutObjectAcl : +// +// [CopyObject] +// +// [GetObject] +// +// [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region +// [Access Control List (ACL) Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html +// [Controlling object ownership]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html +// [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [What permissions can I grant?]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html func (c *Client) PutObjectAcl(ctx context.Context, params *PutObjectAclInput, optFns ...func(*Options)) (*PutObjectAclOutput, error) { if params == nil { params = &PutObjectAclInput{} @@ -118,105 +178,131 @@ func (c *Client) PutObjectAcl(ctx context.Context, params *PutObjectAclInput, op type PutObjectAclInput struct { // The bucket name that contains the object to which you want to attach the ACL. - // When using this action with an access point, you must direct requests to the + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. // - // This member is required. - Bucket *string - - // Key for which the PUT action was initiated. When using this action with an - // access point, you must direct requests to the access point hostname. The access - // point hostname takes the form - // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this - // action with an access point through the Amazon Web Services SDKs, you provide - // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html + // + // This member is required. + Bucket *string + + // Key for which the PUT action was initiated. // // This member is required. Key *string - // The canned ACL to apply to the object. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL) - // . + // The canned ACL to apply to the object. For more information, see [Canned ACL]. + // + // [Canned ACL]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL ACL types.ObjectCannedACL // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *types.AccessControlPolicy - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // The base64-encoded 128-bit MD5 digest of the data. This header must be used as // a message integrity check to verify that the request body was not corrupted in - // transit. For more information, go to RFC 1864.> (http://www.ietf.org/rfc/rfc1864.txt) + // transit. For more information, go to [RFC 1864.>] + // // For requests made using the Amazon Web Services Command Line Interface (CLI) or // Amazon Web Services SDKs, this field is calculated automatically. + // + // [RFC 1864.>]: http://www.ietf.org/rfc/rfc1864.txt ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. This action is not supported by Amazon S3 on Outposts. + // bucket. + // + // This functionality is not supported for Amazon S3 on Outposts. GrantFullControl *string - // Allows grantee to list the objects in the bucket. This action is not supported - // by Amazon S3 on Outposts. + // Allows grantee to list the objects in the bucket. + // + // This functionality is not supported for Amazon S3 on Outposts. GrantRead *string - // Allows grantee to read the bucket ACL. This action is not supported by Amazon - // S3 on Outposts. + // Allows grantee to read the bucket ACL. + // + // This functionality is not supported for Amazon S3 on Outposts. GrantReadACP *string - // Allows grantee to create new objects in the bucket. For the bucket and object - // owners of existing objects, also allows deletions and overwrites of those - // objects. + // Allows grantee to create new objects in the bucket. + // + // For the bucket and object owners of existing objects, also allows deletions and + // overwrites of those objects. GrantWrite *string - // Allows grantee to write the ACL for the applicable bucket. This action is not - // supported by Amazon S3 on Outposts. + // Allows grantee to write the ACL for the applicable bucket. + // + // This functionality is not supported for Amazon S3 on Outposts. GrantWriteACP *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // VersionId used to reference a specific version of the object. + // Version ID used to reference a specific version of the object. + // + // This functionality is not supported for directory buckets. VersionId *string noSmithyDocumentSerde } +func (in *PutObjectAclInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type PutObjectAclOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -226,6 +312,9 @@ type PutObjectAclOutput struct { } func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObjectAcl{}, middleware.After) if err != nil { return err @@ -234,34 +323,38 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObjectAcl"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -273,10 +366,19 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addPutObjectAclResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectAclValidationMiddleware(stack); err != nil { @@ -288,7 +390,7 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectAclInputChecksumMiddlewares(stack, options); err != nil { @@ -309,12 +411,27 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -329,7 +446,6 @@ func newServiceMetadataMiddleware_opPutObjectAcl(region string) *awsmiddleware.R return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObjectAcl", } } @@ -379,139 +495,3 @@ func addPutObjectAclUpdateEndpoint(stack *middleware.Stack, options Options) err DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutObjectAclResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectAclResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectAclResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectAclInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectAclResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectAclResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLegalHold.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLegalHold.go index d4d371df..be713b88 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLegalHold.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLegalHold.go @@ -4,24 +4,24 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Applies a legal hold configuration to the specified object. For more -// information, see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// . This action is not supported by Amazon S3 on Outposts. +// information, see [Locking Objects]. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) PutObjectLegalHold(ctx context.Context, params *PutObjectLegalHoldInput, optFns ...func(*Options)) (*PutObjectLegalHoldOutput, error) { if params == nil { params = &PutObjectLegalHoldInput{} @@ -40,13 +40,17 @@ func (c *Client) PutObjectLegalHold(ctx context.Context, params *PutObjectLegalH type PutObjectLegalHoldInput struct { // The bucket name containing the object that you want to place a legal hold on. - // When using this action with an access point, you must direct requests to the + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -56,24 +60,28 @@ type PutObjectLegalHoldInput struct { // This member is required. Key *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash for the request body. For requests made using the Amazon Web - // Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is - // calculated automatically. + // The MD5 hash for the request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Container element for the legal hold configuration you want to apply to the @@ -82,11 +90,14 @@ type PutObjectLegalHoldInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The version ID of the object that you want to place a legal hold on. @@ -95,10 +106,18 @@ type PutObjectLegalHoldInput struct { noSmithyDocumentSerde } +func (in *PutObjectLegalHoldInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type PutObjectLegalHoldOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -108,6 +127,9 @@ type PutObjectLegalHoldOutput struct { } func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObjectLegalHold{}, middleware.After) if err != nil { return err @@ -116,34 +138,38 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObjectLegalHold"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -155,10 +181,19 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutObjectLegalHoldResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectLegalHoldValidationMiddleware(stack); err != nil { @@ -170,7 +205,7 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectLegalHoldInputChecksumMiddlewares(stack, options); err != nil { @@ -191,12 +226,27 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -211,7 +261,6 @@ func newServiceMetadataMiddleware_opPutObjectLegalHold(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObjectLegalHold", } } @@ -261,139 +310,3 @@ func addPutObjectLegalHoldUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutObjectLegalHoldResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectLegalHoldResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectLegalHoldResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectLegalHoldInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectLegalHoldResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectLegalHoldResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLockConfiguration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLockConfiguration.go index 5b4a897e..e1f7930f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLockConfiguration.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectLockConfiguration.go @@ -4,30 +4,32 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Places an Object Lock configuration on the specified bucket. The rule specified // in the Object Lock configuration will be applied by default to every new object -// placed in the specified bucket. For more information, see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// . +// placed in the specified bucket. For more information, see [Locking Objects]. +// // - The DefaultRetention settings require both a mode and a period. +// // - The DefaultRetention period can be either Days or Years but you must select // one. You cannot specify Days and Years at the same time. -// - You can only enable Object Lock for new buckets. If you want to turn on -// Object Lock for an existing bucket, contact Amazon Web Services Support. +// +// - You can enable Object Lock for new or existing buckets. For more +// information, see [Configuring Object Lock]. +// +// [Configuring Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-configure.html +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) PutObjectLockConfiguration(ctx context.Context, params *PutObjectLockConfigurationInput, optFns ...func(*Options)) (*PutObjectLockConfigurationOutput, error) { if params == nil { params = &PutObjectLockConfigurationInput{} @@ -50,24 +52,28 @@ type PutObjectLockConfigurationInput struct { // This member is required. Bucket *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash for the request body. For requests made using the Amazon Web - // Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is - // calculated automatically. + // The MD5 hash for the request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // The Object Lock configuration that you want to apply to the specified bucket. @@ -75,11 +81,14 @@ type PutObjectLockConfigurationInput struct { // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // A token to allow Object Lock to be enabled for an existing bucket. @@ -88,10 +97,18 @@ type PutObjectLockConfigurationInput struct { noSmithyDocumentSerde } +func (in *PutObjectLockConfigurationInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type PutObjectLockConfigurationOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -101,6 +118,9 @@ type PutObjectLockConfigurationOutput struct { } func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObjectLockConfiguration{}, middleware.After) if err != nil { return err @@ -109,34 +129,38 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObjectLockConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -148,10 +172,19 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addPutObjectLockConfigurationResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectLockConfigurationValidationMiddleware(stack); err != nil { @@ -163,7 +196,7 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectLockConfigurationInputChecksumMiddlewares(stack, options); err != nil { @@ -184,12 +217,27 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -204,7 +252,6 @@ func newServiceMetadataMiddleware_opPutObjectLockConfiguration(region string) *a return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObjectLockConfiguration", } } @@ -254,139 +301,3 @@ func addPutObjectLockConfigurationUpdateEndpoint(stack *middleware.Stack, option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutObjectLockConfigurationResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectLockConfigurationResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectLockConfigurationResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectLockConfigurationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectLockConfigurationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectLockConfigurationResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go index 95176ea6..7c5a611a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go @@ -4,27 +4,26 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Places an Object Retention configuration on an object. For more information, -// see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// . Users or accounts require the s3:PutObjectRetention permission in order to -// place an Object Retention configuration on objects. Bypassing a Governance +// see [Locking Objects]. Users or accounts require the s3:PutObjectRetention permission in order +// to place an Object Retention configuration on objects. Bypassing a Governance // Retention configuration requires the s3:BypassGovernanceRetention permission. -// This action is not supported by Amazon S3 on Outposts. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// [Locking Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html func (c *Client) PutObjectRetention(ctx context.Context, params *PutObjectRetentionInput, optFns ...func(*Options)) (*PutObjectRetentionOutput, error) { if params == nil { params = &PutObjectRetentionInput{} @@ -43,13 +42,18 @@ func (c *Client) PutObjectRetention(ctx context.Context, params *PutObjectRetent type PutObjectRetentionInput struct { // The bucket name that contains the object you want to apply this Object - // Retention configuration to. When using this action with an access point, you - // must direct requests to the access point hostname. The access point hostname - // takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. + // Retention configuration to. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form + // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this + // action with an access point through the Amazon Web Services SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -61,35 +65,42 @@ type PutObjectRetentionInput struct { Key *string // Indicates whether this action should bypass Governance-mode restrictions. - BypassGovernanceRetention bool + BypassGovernanceRetention *bool - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash for the request body. For requests made using the Amazon Web - // Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is - // calculated automatically. + // The MD5 hash for the request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The container element for the Object Retention configuration. @@ -102,10 +113,18 @@ type PutObjectRetentionInput struct { noSmithyDocumentSerde } +func (in *PutObjectRetentionInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type PutObjectRetentionOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Metadata pertaining to the operation's result. @@ -115,6 +134,9 @@ type PutObjectRetentionOutput struct { } func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObjectRetention{}, middleware.After) if err != nil { return err @@ -123,34 +145,38 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObjectRetention"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -162,10 +188,19 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutObjectRetentionResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectRetentionValidationMiddleware(stack); err != nil { @@ -177,7 +212,7 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectRetentionInputChecksumMiddlewares(stack, options); err != nil { @@ -198,12 +233,27 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -218,7 +268,6 @@ func newServiceMetadataMiddleware_opPutObjectRetention(region string) *awsmiddle return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObjectRetention", } } @@ -268,139 +317,3 @@ func addPutObjectRetentionUpdateEndpoint(stack *middleware.Stack, options Option DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutObjectRetentionResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectRetentionResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectRetentionResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectRetentionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectRetentionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectRetentionResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go index e9785b93..2703eef4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go @@ -4,49 +4,60 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Sets the supplied tag-set to an object that already exists in a bucket. A tag -// is a key-value pair. For more information, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) -// . You can associate tags with an object by sending a PUT request against the +// is a key-value pair. For more information, see [Object Tagging]. +// +// You can associate tags with an object by sending a PUT request against the // tagging subresource that is associated with the object. You can retrieve tags by -// sending a GET request. For more information, see GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// . For tagging-related restrictions related to characters and encodings, see Tag -// Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) -// . Note that Amazon S3 limits the maximum number of tags to 10 tags per object. +// sending a GET request. For more information, see [GetObjectTagging]. +// +// For tagging-related restrictions related to characters and encodings, see [Tag Restrictions]. +// Note that Amazon S3 limits the maximum number of tags to 10 tags per object. +// // To use this operation, you must have permission to perform the // s3:PutObjectTagging action. By default, the bucket owner has this permission and -// can grant this permission to others. To put tags of any other version, use the -// versionId query parameter. You also need permission for the -// s3:PutObjectVersionTagging action. PutObjectTagging has the following special -// errors. For more Amazon S3 errors see, Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) -// . +// can grant this permission to others. +// +// To put tags of any other version, use the versionId query parameter. You also +// need permission for the s3:PutObjectVersionTagging action. +// +// PutObjectTagging has the following special errors. For more Amazon S3 errors +// see, [Error Responses]. +// // - InvalidTag - The tag provided was not a valid tag. This error can occur if -// the tag did not pass input validation. For more information, see Object -// Tagging (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html) -// . +// the tag did not pass input validation. For more information, see [Object Tagging]. +// // - MalformedXML - The XML provided does not match the schema. +// // - OperationAborted - A conflicting conditional action is currently in progress // against this resource. Please try again. +// // - InternalError - The service was unable to apply the provided tag to the // object. // // The following operations are related to PutObjectTagging : -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// - DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) +// +// [GetObjectTagging] +// +// [DeleteObjectTagging] +// +// [Error Responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html +// [DeleteObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html +// [Object Tagging]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html +// [Tag Restrictions]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html +// [GetObjectTagging]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html func (c *Client) PutObjectTagging(ctx context.Context, params *PutObjectTaggingInput, optFns ...func(*Options)) (*PutObjectTaggingOutput, error) { if params == nil { params = &PutObjectTaggingInput{} @@ -64,21 +75,27 @@ func (c *Client) PutObjectTagging(ctx context.Context, params *PutObjectTaggingI type PutObjectTaggingInput struct { - // The bucket name containing the object. When using this action with an access - // point, you must direct requests to the access point hostname. The access point - // hostname takes the form + // The bucket name containing the object. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -93,33 +110,40 @@ type PutObjectTaggingInput struct { // This member is required. Tagging *types.Tagging - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash for the request body. For requests made using the Amazon Web - // Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is - // calculated automatically. + // The MD5 hash for the request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // The versionId of the object that the tag-set will be added to. @@ -128,6 +152,12 @@ type PutObjectTaggingInput struct { noSmithyDocumentSerde } +func (in *PutObjectTaggingInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type PutObjectTaggingOutput struct { // The versionId of the object the tag-set was added to. @@ -140,6 +170,9 @@ type PutObjectTaggingOutput struct { } func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutObjectTagging{}, middleware.After) if err != nil { return err @@ -148,34 +181,38 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutObjectTagging"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -187,10 +224,19 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { return err } - if err = addPutObjectTaggingResolveEndpointMiddleware(stack, options); err != nil { + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutObjectTaggingValidationMiddleware(stack); err != nil { @@ -202,7 +248,7 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutObjectTaggingInputChecksumMiddlewares(stack, options); err != nil { @@ -223,12 +269,27 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -243,7 +304,6 @@ func newServiceMetadataMiddleware_opPutObjectTagging(region string) *awsmiddlewa return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutObjectTagging", } } @@ -293,139 +353,3 @@ func addPutObjectTaggingUpdateEndpoint(stack *middleware.Stack, options Options) DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutObjectTaggingResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutObjectTaggingResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutObjectTaggingResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutObjectTaggingInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutObjectTaggingResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutObjectTaggingResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutPublicAccessBlock.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutPublicAccessBlock.go index 8aa349c7..d1d05a6f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutPublicAccessBlock.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutPublicAccessBlock.go @@ -4,37 +4,49 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This operation is not supported for directory buckets. +// // Creates or modifies the PublicAccessBlock configuration for an Amazon S3 // bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock -// permission. For more information about Amazon S3 permissions, see Specifying -// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// . When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or -// an object, it checks the PublicAccessBlock configuration for both the bucket -// (or the bucket that contains the object) and the bucket owner's account. If the +// permission. For more information about Amazon S3 permissions, see [Specifying Permissions in a Policy]. +// +// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket or an +// object, it checks the PublicAccessBlock configuration for both the bucket (or +// the bucket that contains the object) and the bucket owner's account. If the // PublicAccessBlock configurations are different between the bucket and the -// account, S3 uses the most restrictive combination of the bucket-level and -// account-level settings. For more information about when Amazon S3 considers a -// bucket or an object public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// . The following operations are related to PutPublicAccessBlock : -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) -// - GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) +// account, Amazon S3 uses the most restrictive combination of the bucket-level and +// account-level settings. +// +// For more information about when Amazon S3 considers a bucket or an object +// public, see [The Meaning of "Public"]. +// +// The following operations are related to PutPublicAccessBlock : +// +// [GetPublicAccessBlock] +// +// [DeletePublicAccessBlock] +// +// [GetBucketPolicyStatus] +// +// [Using Amazon S3 Block Public Access] +// +// [GetPublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html +// [DeletePublicAccessBlock]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html +// [Using Amazon S3 Block Public Access]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html +// [GetBucketPolicyStatus]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status func (c *Client) PutPublicAccessBlock(ctx context.Context, params *PutPublicAccessBlockInput, optFns ...func(*Options)) (*PutPublicAccessBlockOutput, error) { if params == nil { params = &PutPublicAccessBlockInput{} @@ -60,36 +72,47 @@ type PutPublicAccessBlockInput struct { // The PublicAccessBlock configuration that you want to apply to this Amazon S3 // bucket. You can enable the configuration options in any combination. For more - // information about when Amazon S3 considers a bucket or object public, see The - // Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) - // in the Amazon S3 User Guide. + // information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in + // the Amazon S3 User Guide. + // + // [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status // // This member is required. PublicAccessBlockConfiguration *types.PublicAccessBlockConfiguration - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The MD5 hash of the PutPublicAccessBlock request body. For requests made using - // the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services - // SDKs, this field is calculated automatically. + // The MD5 hash of the PutPublicAccessBlock request body. + // + // For requests made using the Amazon Web Services Command Line Interface (CLI) or + // Amazon Web Services SDKs, this field is calculated automatically. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string noSmithyDocumentSerde } +func (in *PutPublicAccessBlockInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.UseS3ExpressControlEndpoint = ptr.Bool(true) +} + type PutPublicAccessBlockOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -98,6 +121,9 @@ type PutPublicAccessBlockOutput struct { } func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpPutPublicAccessBlock{}, middleware.After) if err != nil { return err @@ -106,34 +132,38 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutPublicAccessBlock"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -145,10 +175,19 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { return err } - if err = addPutPublicAccessBlockResolveEndpointMiddleware(stack, options); err != nil { + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpPutPublicAccessBlockValidationMiddleware(stack); err != nil { @@ -160,7 +199,7 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addPutPublicAccessBlockInputChecksumMiddlewares(stack, options); err != nil { @@ -181,12 +220,27 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = s3cust.AddExpressDefaultChecksumMiddleware(stack); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -201,7 +255,6 @@ func newServiceMetadataMiddleware_opPutPublicAccessBlock(region string) *awsmidd return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "PutPublicAccessBlock", } } @@ -251,139 +304,3 @@ func addPutPublicAccessBlockUpdateEndpoint(stack *middleware.Stack, options Opti DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opPutPublicAccessBlockResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opPutPublicAccessBlockResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opPutPublicAccessBlockResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*PutPublicAccessBlockInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addPutPublicAccessBlockResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opPutPublicAccessBlockResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_RestoreObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_RestoreObject.go index 0ccf96b3..022dad38 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_RestoreObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_RestoreObject.go @@ -4,86 +4,61 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Restores an archived copy of an object back into Amazon S3 This action is not -// supported by Amazon S3 on Outposts. This action performs the following types of -// requests: -// - select - Perform a select query on an archived object +// This operation is not supported for directory buckets. +// +// # Restores an archived copy of an object back into Amazon S3 +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// This action performs the following types of requests: +// // - restore an archive - Restore an archived object // // For more information about the S3 structure in the request body, see the // following: -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// - Managing Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) -// in the Amazon S3 User Guide -// - Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon S3 User Guide -// -// Define the SQL expression for the SELECT type of restoration for your query in -// the request body's SelectParameters structure. You can use expressions like the -// following examples. -// - The following expression returns all records from the specified object. -// SELECT * FROM Object -// - Assuming that you are not using any headers for data stored in the object, -// you can specify columns with positional headers. SELECT s._1, s._2 FROM -// Object s WHERE s._3 > 100 -// - If you have headers and you set the fileHeaderInfo in the CSV structure in -// the request body to USE , you can specify headers in the query. (If you set -// the fileHeaderInfo field to IGNORE , the first row is skipped for the query.) -// You cannot mix ordinal positions with header column names. SELECT s.Id, -// s.FirstName, s.SSN FROM S3Object s -// -// When making a select request, you can also do the following: -// - To expedite your queries, specify the Expedited tier. For more information -// about tiers, see "Restoring Archives," later in this topic. -// - Specify details about the data serialization format of both the input -// object that is being queried and the serialization of the CSV-encoded query -// results. -// -// The following are additional important facts about the select feature: -// - The output results are new Amazon S3 objects. Unlike archive retrievals, -// they are stored until explicitly deleted-manually or through a lifecycle -// configuration. -// - You can issue more than one select request on the same Amazon S3 object. -// Amazon S3 doesn't duplicate requests, so avoid issuing duplicate requests. -// - Amazon S3 accepts a select request even if the object has already been -// restored. A select request doesn’t return error response 409 . +// +// [PutObject] +// +// [Managing Access with ACLs] +// - in the Amazon S3 User Guide +// +// [Protecting Data Using Server-Side Encryption] +// - in the Amazon S3 User Guide // // Permissions To use this operation, you must have permissions to perform the // s3:RestoreObject action. The bucket owner has this permission by default and can -// grant this permission to others. For more information about permissions, see -// Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. Restoring objects Objects that you archive to the -// S3 Glacier Flexible Retrieval Flexible Retrieval or S3 Glacier Deep Archive -// storage class, and S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep -// Archive tiers, are not accessible in real time. For objects in the S3 Glacier -// Flexible Retrieval Flexible Retrieval or S3 Glacier Deep Archive storage -// classes, you must first initiate a restore request, and then wait until a -// temporary copy of the object is available. If you want a permanent copy of the -// object, create a copy of it in the Amazon S3 Standard storage class in your S3 -// bucket. To access an archived object, you must restore the object for the -// duration (number of days) that you specify. For objects in the Archive Access or -// Deep Archive Access tiers of S3 Intelligent-Tiering, you must first initiate a -// restore request, and then wait until the object is moved into the Frequent -// Access tier. To restore a specific object version, you can provide a version ID. -// If you don't provide a version ID, Amazon S3 restores the current version. When -// restoring an archived object, you can specify one of the following data access -// tier options in the Tier element of the request body: +// grant this permission to others. For more information about permissions, see [Permissions Related to Bucket Subresource Operations] +// and [Managing Access Permissions to Your Amazon S3 Resources]in the Amazon S3 User Guide. +// +// Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval +// Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 +// Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are +// not accessible in real time. For objects in the S3 Glacier Flexible Retrieval +// Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first +// initiate a restore request, and then wait until a temporary copy of the object +// is available. If you want a permanent copy of the object, create a copy of it in +// the Amazon S3 Standard storage class in your S3 bucket. To access an archived +// object, you must restore the object for the duration (number of days) that you +// specify. For objects in the Archive Access or Deep Archive Access tiers of S3 +// Intelligent-Tiering, you must first initiate a restore request, and then wait +// until the object is moved into the Frequent Access tier. +// +// To restore a specific object version, you can provide a version ID. If you +// don't provide a version ID, Amazon S3 restores the current version. +// +// When restoring an archived object, you can specify one of the following data +// access tier options in the Tier element of the request body: +// // - Expedited - Expedited retrievals allow you to quickly access your data // stored in the S3 Glacier Flexible Retrieval Flexible Retrieval storage class or // S3 Intelligent-Tiering Archive tier when occasional urgent requests for @@ -93,6 +68,7 @@ import ( // Expedited retrievals is available when you need it. Expedited retrievals and // provisioned capacity are not available for objects stored in the S3 Glacier Deep // Archive storage class or S3 Intelligent-Tiering Deep Archive tier. +// // - Standard - Standard retrievals allow you to access any of your archived // objects within several hours. This is the default option for retrieval requests // that do not specify the retrieval option. Standard retrievals typically finish @@ -101,6 +77,7 @@ import ( // typically finish within 12 hours for objects stored in the S3 Glacier Deep // Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard // retrievals are free for objects stored in S3 Intelligent-Tiering. +// // - Bulk - Bulk retrievals free for objects stored in the S3 Glacier Flexible // Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve // large amounts, even petabytes, of data at no cost. Bulk retrievals typically @@ -112,29 +89,33 @@ import ( // Deep Archive tier. // // For more information about archive retrieval options and provisioned capacity -// for Expedited data access, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) -// in the Amazon S3 User Guide. You can use Amazon S3 restore speed upgrade to -// change the restore speed to a faster speed while it is in progress. For more -// information, see Upgrading the speed of an in-progress restore (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html) -// in the Amazon S3 User Guide. To get the status of object restoration, you can -// send a HEAD request. Operations return the x-amz-restore header, which provides -// information about the restoration status, in the response. You can use Amazon S3 -// event notifications to notify you when a restore is initiated or completed. For -// more information, see Configuring Amazon S3 Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// in the Amazon S3 User Guide. After restoring an archived object, you can update -// the restoration period by reissuing the request with a new period. Amazon S3 -// updates the restoration period relative to the current time and charges only for -// the request-there are no data transfer charges. You cannot update the -// restoration period when Amazon S3 is actively processing your current restore -// request for the object. If your bucket has a lifecycle configuration with a rule -// that includes an expiration action, the object expiration overrides the life -// span that you specify in a restore request. For example, if you restore an -// object copy for 10 days, but the object is scheduled to expire in 3 days, Amazon -// S3 deletes the object in 3 days. For more information about lifecycle -// configuration, see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in Amazon S3 User Guide. Responses A successful action returns either the 200 OK -// or 202 Accepted status code. +// for Expedited data access, see [Restoring Archived Objects] in the Amazon S3 User Guide. +// +// You can use Amazon S3 restore speed upgrade to change the restore speed to a +// faster speed while it is in progress. For more information, see [Upgrading the speed of an in-progress restore]in the Amazon +// S3 User Guide. +// +// To get the status of object restoration, you can send a HEAD request. +// Operations return the x-amz-restore header, which provides information about +// the restoration status, in the response. You can use Amazon S3 event +// notifications to notify you when a restore is initiated or completed. For more +// information, see [Configuring Amazon S3 Event Notifications]in the Amazon S3 User Guide. +// +// After restoring an archived object, you can update the restoration period by +// reissuing the request with a new period. Amazon S3 updates the restoration +// period relative to the current time and charges only for the request-there are +// no data transfer charges. You cannot update the restoration period when Amazon +// S3 is actively processing your current restore request for the object. +// +// If your bucket has a lifecycle configuration with a rule that includes an +// expiration action, the object expiration overrides the life span that you +// specify in a restore request. For example, if you restore an object copy for 10 +// days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the +// object in 3 days. For more information about lifecycle configuration, see [PutBucketLifecycleConfiguration]and [Object Lifecycle Management] +// in Amazon S3 User Guide. +// +// Responses A successful action returns either the 200 OK or 202 Accepted status +// code. // // - If the object is not previously restored, then Amazon S3 returns 202 // Accepted in the response. @@ -146,8 +127,7 @@ import ( // // - Code: RestoreAlreadyInProgress // -// - Cause: Object restore is already in progress. (This error does not apply to -// SELECT type requests.) +// - Cause: Object restore is already in progress. // // - HTTP Status Code: 409 Conflict // @@ -165,8 +145,22 @@ import ( // - SOAP Fault Code Prefix: N/A // // The following operations are related to RestoreObject : -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// - GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) +// +// [PutBucketLifecycleConfiguration] +// +// [GetBucketNotificationConfiguration] +// +// [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html +// [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html +// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Configuring Amazon S3 Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html +// [Managing Access with ACLs]: https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html +// [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html +// [GetBucketNotificationConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html +// [PutObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html +// [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// [Upgrading the speed of an in-progress restore]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html func (c *Client) RestoreObject(ctx context.Context, params *RestoreObjectInput, optFns ...func(*Options)) (*RestoreObjectOutput, error) { if params == nil { params = &RestoreObjectInput{} @@ -184,21 +178,27 @@ func (c *Client) RestoreObject(ctx context.Context, params *RestoreObjectInput, type RestoreObjectInput struct { - // The bucket name containing the object to restore. When using this action with - // an access point, you must direct requests to the access point hostname. The - // access point hostname takes the form + // The bucket name containing the object to restore. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -208,28 +208,34 @@ type RestoreObjectInput struct { // This member is required. Key *string - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer // Container for restore job parameters. @@ -241,10 +247,18 @@ type RestoreObjectInput struct { noSmithyDocumentSerde } +func (in *RestoreObjectInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type RestoreObjectOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Indicates the path in the provided S3 output location where Select results will @@ -258,6 +272,9 @@ type RestoreObjectOutput struct { } func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpRestoreObject{}, middleware.After) if err != nil { return err @@ -266,34 +283,38 @@ func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, o if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "RestoreObject"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -305,10 +326,19 @@ func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, o if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addRestoreObjectResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpRestoreObjectValidationMiddleware(stack); err != nil { @@ -320,7 +350,7 @@ func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, o if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addRestoreObjectInputChecksumMiddlewares(stack, options); err != nil { @@ -341,12 +371,24 @@ func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, o if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -361,7 +403,6 @@ func newServiceMetadataMiddleware_opRestoreObject(region string) *awsmiddleware. return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "RestoreObject", } } @@ -411,139 +452,3 @@ func addRestoreObjectUpdateEndpoint(stack *middleware.Stack, options Options) er DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opRestoreObjectResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opRestoreObjectResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opRestoreObjectResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*RestoreObjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addRestoreObjectResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opRestoreObjectResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_SelectObjectContent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_SelectObjectContent.go index d6c2ff63..b22b0dd0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_SelectObjectContent.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_SelectObjectContent.go @@ -4,81 +4,104 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithysync "github.com/aws/smithy-go/sync" - smithyhttp "github.com/aws/smithy-go/transport/http" "sync" ) +// This operation is not supported for directory buckets. +// // This action filters the contents of an Amazon S3 object based on a simple // structured query language (SQL) statement. In the request, along with the SQL // expression, you must also specify a data serialization format (JSON, CSV, or // Apache Parquet) of the object. Amazon S3 uses this format to parse object data // into records, and returns only records that match the specified SQL expression. -// You must also specify the data serialization format for the response. This -// action is not supported by Amazon S3 on Outposts. For more information about -// Amazon S3 Select, see Selecting Content from Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html) -// and SELECT Command (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html) -// in the Amazon S3 User Guide. Permissions You must have s3:GetObject permission -// for this operation. Amazon S3 Select does not support anonymous access. For more -// information about permissions, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// in the Amazon S3 User Guide. Object Data Formats You can use Amazon S3 Select to -// query objects that have the following format properties: +// You must also specify the data serialization format for the response. +// +// This functionality is not supported for Amazon S3 on Outposts. +// +// For more information about Amazon S3 Select, see [Selecting Content from Objects] and [SELECT Command] in the Amazon S3 User +// Guide. +// +// Permissions You must have the s3:GetObject permission for this operation. +// Amazon S3 Select does not support anonymous access. For more information about +// permissions, see [Specifying Permissions in a Policy]in the Amazon S3 User Guide. +// +// Object Data Formats You can use Amazon S3 Select to query objects that have the +// following format properties: +// // - CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format. +// // - UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports. +// // - GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2. // GZIP and BZIP2 are the only compression formats that Amazon S3 Select supports // for CSV and JSON files. Amazon S3 Select supports columnar compression for // Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object // compression for Parquet objects. +// // - Server-side encryption - Amazon S3 Select supports querying objects that -// are protected with server-side encryption. For objects that are encrypted with -// customer-provided encryption keys (SSE-C), you must use HTTPS, and you must use -// the headers that are documented in the GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// . For more information about SSE-C, see Server-Side Encryption (Using -// Customer-Provided Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// in the Amazon S3 User Guide. For objects that are encrypted with Amazon S3 -// managed keys (SSE-S3) and Amazon Web Services KMS keys (SSE-KMS), server-side -// encryption is handled transparently, so you don't need to specify anything. For -// more information about server-side encryption, including SSE-S3 and SSE-KMS, see -// Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon S3 User Guide. +// are protected with server-side encryption. +// +// For objects that are encrypted with customer-provided encryption keys (SSE-C), +// +// you must use HTTPS, and you must use the headers that are documented in the [GetObject]. +// For more information about SSE-C, see [Server-Side Encryption (Using Customer-Provided Encryption Keys)]in the Amazon S3 User Guide. +// +// For objects that are encrypted with Amazon S3 managed keys (SSE-S3) and Amazon +// +// Web Services KMS keys (SSE-KMS), server-side encryption is handled +// transparently, so you don't need to specify anything. For more information about +// server-side encryption, including SSE-S3 and SSE-KMS, see [Protecting Data Using Server-Side Encryption]in the Amazon S3 +// User Guide. // // Working with the Response Body Given the response size is unknown, Amazon S3 // Select streams the response as a series of messages and includes a // Transfer-Encoding header with chunked as its value in the response. For more -// information, see Appendix: SelectObjectContent Response (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html) -// . GetObject Support The SelectObjectContent action does not support the -// following GetObject functionality. For more information, see GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// . +// information, see [Appendix: SelectObjectContent Response]. +// +// GetObject Support The SelectObjectContent action does not support the following +// GetObject functionality. For more information, see [GetObject]. +// // - Range : Although you can specify a scan range for an Amazon S3 Select -// request (see SelectObjectContentRequest - ScanRange (https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange) -// in the request parameters), you cannot specify the range of bytes of an object -// to return. +// request (see [SelectObjectContentRequest - ScanRange]in the request parameters), you cannot specify the range of +// bytes of an object to return. +// // - The GLACIER , DEEP_ARCHIVE , and REDUCED_REDUNDANCY storage classes, or the // ARCHIVE_ACCESS and DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING // storage class: You cannot query objects in the GLACIER , DEEP_ARCHIVE , or // REDUCED_REDUNDANCY storage classes, nor objects in the ARCHIVE_ACCESS or // DEEP_ARCHIVE_ACCESS access tiers of the INTELLIGENT_TIERING storage class. For -// more information about storage classes, see Using Amazon S3 storage classes (https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html) -// in the Amazon S3 User Guide. +// more information about storage classes, see [Using Amazon S3 storage classes]in the Amazon S3 User Guide. +// +// Special Errors For a list of special errors for this operation, see [List of SELECT Object Content Error Codes] // -// Special Errors For a list of special errors for this operation, see List of -// SELECT Object Content Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList) // The following operations are related to SelectObjectContent : -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) +// +// [GetObject] +// +// [GetBucketLifecycleConfiguration] +// +// [PutBucketLifecycleConfiguration] +// +// [Appendix: SelectObjectContent Response]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html +// [Selecting Content from Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html +// [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html +// [SelectObjectContentRequest - ScanRange]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange +// [List of SELECT Object Content Error Codes]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList +// [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html +// [Using Amazon S3 storage classes]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html +// [SELECT Command]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html +// [Specifying Permissions in a Policy]: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html +// +// [Server-Side Encryption (Using Customer-Provided Encryption Keys)]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html +// [Protecting Data Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html func (c *Client) SelectObjectContent(ctx context.Context, params *SelectObjectContentInput, optFns ...func(*Options)) (*SelectObjectContentOutput, error) { if params == nil { params = &SelectObjectContentInput{} @@ -94,14 +117,18 @@ func (c *Client) SelectObjectContent(ctx context.Context, params *SelectObjectCo return out, nil } +// Learn Amazon S3 Select is no longer available to new customers. Existing +// customers of Amazon S3 Select can continue to use the feature as usual. [Learn more] +// // Request to filter the contents of an Amazon S3 object based on a simple // Structured Query Language (SQL) statement. In the request, along with the SQL // expression, you must specify a data serialization format (JSON or CSV) of the // object. Amazon S3 uses this to parse object data into records. It returns only // records that match the specified SQL expression. You must also specify the data -// serialization format for the response. For more information, see S3Select API -// Documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html) -// . +// serialization format for the response. For more information, see [S3Select API Documentation]. +// +// [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ +// [S3Select API Documentation]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html type SelectObjectContentInput struct { // The S3 bucket. @@ -134,9 +161,9 @@ type SelectObjectContentInput struct { // This member is required. OutputSerialization *types.OutputSerialization - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Specifies if periodic request progress information should be enabled. @@ -144,36 +171,49 @@ type SelectObjectContentInput struct { // The server-side encryption (SSE) algorithm used to encrypt the object. This // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // For more information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerAlgorithm *string // The server-side encryption (SSE) customer managed key. This parameter is needed // only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKey *string // The MD5 server-side encryption (SSE) customer managed key. This parameter is // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. + // information, see [Protecting data using SSE-C keys]in the Amazon S3 User Guide. + // + // [Protecting data using SSE-C keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html SSECustomerKeyMD5 *string // Specifies the byte range of the object to get the records from. A record is // processed when its first byte is contained by the range. This parameter is // optional, but when specified, it must not be empty. See RFC 2616, Section - // 14.35.1 about how to specify the start and end of the range. ScanRange may be - // used in the following ways: + // 14.35.1 about how to specify the start and end of the range. + // + // ScanRange may be used in the following ways: + // // - 50100 - process only the records starting between the bytes 50 and 100 // (inclusive, counting from zero) + // // - 50 - process only the records starting after the byte 50 + // // - 50 - process only the records within the last 50 bytes of the file. ScanRange *types.ScanRange noSmithyDocumentSerde } +func (in *SelectObjectContentInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + +} + type SelectObjectContentOutput struct { eventStream *SelectObjectContentEventStream @@ -189,6 +229,9 @@ func (o *SelectObjectContentOutput) GetStream() *SelectObjectContentEventStream } func (c *Client) addOperationSelectObjectContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpSelectObjectContent{}, middleware.After) if err != nil { return err @@ -197,6 +240,10 @@ func (c *Client) addOperationSelectObjectContentMiddlewares(stack *middleware.St if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "SelectObjectContent"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } @@ -206,37 +253,46 @@ func (c *Client) addOperationSelectObjectContentMiddlewares(stack *middleware.St if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addSelectObjectContentResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpSelectObjectContentValidationMiddleware(stack); err != nil { @@ -248,7 +304,7 @@ func (c *Client) addOperationSelectObjectContentMiddlewares(stack *middleware.St if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addSelectObjectContentUpdateEndpoint(stack, options); err != nil { @@ -266,12 +322,24 @@ func (c *Client) addOperationSelectObjectContentMiddlewares(stack *middleware.St if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -286,7 +354,6 @@ func newServiceMetadataMiddleware_opSelectObjectContent(region string) *awsmiddl return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "SelectObjectContent", } } @@ -416,139 +483,3 @@ func (es *SelectObjectContentEventStream) waitStreamClose() { } } - -type opSelectObjectContentResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opSelectObjectContentResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opSelectObjectContentResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*SelectObjectContentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addSelectObjectContentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opSelectObjectContentResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPart.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPart.go index a3e1a7db..c4b4de29 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPart.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPart.go @@ -4,94 +4,176 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io" ) -// Uploads a part in a multipart upload. In this operation, you provide part data -// in your request. However, you have an option to specify your existing Amazon S3 -// object as a data source for the part you are uploading. To upload a part from an -// existing object, you use the UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) -// operation. You must initiate a multipart upload (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// ) before you can upload any part. In response to your initiate request, Amazon -// S3 returns an upload ID, a unique identifier, that you must include in your -// upload part request. Part numbers can be any number from 1 to 10,000, inclusive. -// A part number uniquely identifies a part and also defines its position within -// the object being created. If you upload a new part using the same part number -// that was used with a previous part, the previously uploaded part is overwritten. +// Uploads a part in a multipart upload. +// +// In this operation, you provide new data as a part of an object in your request. +// However, you have an option to specify your existing Amazon S3 object as a data +// source for the part you are uploading. To upload a part from an existing object, +// you use the [UploadPartCopy]operation. +// +// You must initiate a multipart upload (see [CreateMultipartUpload]) before you can upload any part. In +// response to your initiate request, Amazon S3 returns an upload ID, a unique +// identifier that you must include in your upload part request. +// +// Part numbers can be any number from 1 to 10,000, inclusive. A part number +// uniquely identifies a part and also defines its position within the object being +// created. If you upload a new part using the same part number that was used with +// a previous part, the previously uploaded part is overwritten. +// // For information about maximum and minimum part sizes and other multipart upload -// specifications, see Multipart upload limits (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) -// in the Amazon S3 User Guide. To ensure that data is not corrupted when +// specifications, see [Multipart upload limits]in the Amazon S3 User Guide. +// +// After you initiate multipart upload and upload one or more parts, you must +// either complete or abort multipart upload in order to stop getting charged for +// storage of the uploaded parts. Only after you either complete or abort multipart +// upload, Amazon S3 frees up the parts storage and stops charging you for the +// parts storage. +// +// For more information on multipart uploads, go to [Multipart Upload Overview] in the Amazon S3 User Guide . +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Permissions +// - General purpose bucket permissions - To perform a multipart upload with +// encryption using an Key Management Service key, the requester must have +// permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. The +// requester must also have permissions for the kms:GenerateDataKey action for +// the CreateMultipartUpload API. Then, the requester needs permissions for the +// kms:Decrypt action on the UploadPart and UploadPartCopy APIs. +// +// These permissions are required because Amazon S3 must decrypt and read data +// +// from the encrypted file parts before it completes the multipart upload. For more +// information about KMS permissions, see [Protecting data using server-side encryption with KMS]in the Amazon S3 User Guide. For +// information about the permissions required to use the multipart upload API, see [Multipart upload and permissions] +// and [Multipart upload API and permissions]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - To grant access to this API operation on a +// directory bucket, we recommend that you use the [CreateSession]CreateSession API operation +// for session-based authorization. Specifically, you grant the +// s3express:CreateSession permission to the directory bucket in a bucket policy +// or an IAM identity-based policy. Then, you make the CreateSession API call on +// the bucket to obtain a session token. With the session token in your request +// header, you can make API requests to this operation. After the session token +// expires, you make another CreateSession API call to generate a new session +// token for use. Amazon Web Services CLI or SDKs create session and refresh the +// session token automatically to avoid service interruptions when a session +// expires. For more information about authorization, see [CreateSession]CreateSession . +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// Data integrity General purpose bucket - To ensure that data is not corrupted // traversing the network, specify the Content-MD5 header in the upload part // request. Amazon S3 checks the part data against the provided MD5 value. If they // do not match, Amazon S3 returns an error. If the upload request is signed with // Signature Version 4, then Amazon Web Services S3 uses the x-amz-content-sha256 -// header as a checksum instead of Content-MD5 . For more information see -// Authenticating Requests: Using the Authorization Header (Amazon Web Services -// Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html) -// . Note: After you initiate multipart upload and upload one or more parts, you -// must either complete or abort multipart upload in order to stop getting charged -// for storage of the uploaded parts. Only after you either complete or abort -// multipart upload, Amazon S3 frees up the parts storage and stops charging you -// for the parts storage. For more information on multipart uploads, go to -// Multipart Upload Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html) -// in the Amazon S3 User Guide . For information on the permissions required to use -// the multipart upload API, go to Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon S3 User Guide. Server-side encryption is for data encryption at -// rest. Amazon S3 encrypts your data as it writes it to disks in its data centers -// and decrypts it when you access it. You have three mutually exclusive options to -// protect data using server-side encryption in Amazon S3, depending on how you -// choose to manage the encryption keys. Specifically, the encryption key options -// are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and -// Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side -// encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally -// tell Amazon S3 to encrypt data at rest using server-side encryption with other -// key options. The option you use depends on whether you want to use KMS keys -// (SSE-KMS) or provide your own encryption key (SSE-C). If you choose to provide -// your own encryption key, the request headers you provide in the request must -// match the headers you used in the request to initiate the upload by using -// CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// . For more information, go to Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) -// in the Amazon S3 User Guide. Server-side encryption is supported by the S3 -// Multipart Upload actions. Unless you are using a customer-provided encryption -// key (SSE-C), you don't need to specify the encryption parameters in each -// UploadPart request. Instead, you only need to specify the server-side encryption -// parameters in the initial Initiate Multipart request. For more information, see -// CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// . If you requested server-side encryption using a customer-provided encryption -// key (SSE-C) in your initiate multipart upload request, you must provide -// identical encryption information in each part upload using the following -// headers. -// - x-amz-server-side-encryption-customer-algorithm -// - x-amz-server-side-encryption-customer-key -// - x-amz-server-side-encryption-customer-key-MD5 -// -// UploadPart has the following special errors: -// - Code: NoSuchUpload -// - Cause: The specified multipart upload does not exist. The upload ID might -// be invalid, or the multipart upload might have been aborted or completed. +// header as a checksum instead of Content-MD5 . For more information see [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]. +// +// Directory buckets - MD5 is not supported by directory buckets. You can use +// checksum algorithms to check object integrity. +// +// Encryption +// - General purpose bucket - Server-side encryption is for data encryption at +// rest. Amazon S3 encrypts your data as it writes it to disks in its data centers +// and decrypts it when you access it. You have mutually exclusive options to +// protect data using server-side encryption in Amazon S3, depending on how you +// choose to manage the encryption keys. Specifically, the encryption key options +// are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and +// Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side +// encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally +// tell Amazon S3 to encrypt data at rest using server-side encryption with other +// key options. The option you use depends on whether you want to use KMS keys +// (SSE-KMS) or provide your own encryption key (SSE-C). +// +// Server-side encryption is supported by the S3 Multipart Upload operations. +// +// Unless you are using a customer-provided encryption key (SSE-C), you don't need +// to specify the encryption parameters in each UploadPart request. Instead, you +// only need to specify the server-side encryption parameters in the initial +// Initiate Multipart request. For more information, see [CreateMultipartUpload]. +// +// If you request server-side encryption using a customer-provided encryption key +// +// (SSE-C) in your initiate multipart upload request, you must provide identical +// encryption information in each part upload using the following request headers. +// +// - x-amz-server-side-encryption-customer-algorithm +// +// - x-amz-server-side-encryption-customer-key +// +// - x-amz-server-side-encryption-customer-key-MD5 +// +// For more information, see [Using Server-Side Encryption]in the Amazon S3 User Guide. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: server-side encryption with Amazon S3 +// managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys +// (SSE-KMS) ( aws:kms ). +// +// Special errors +// +// - Error Code: NoSuchUpload +// +// - Description: The specified multipart upload does not exist. The upload ID +// might be invalid, or the multipart upload might have been aborted or completed. +// // - HTTP Status Code: 404 Not Found +// // - SOAP Fault Code Prefix: Client // +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// // The following operations are related to UploadPart : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// +// [CreateMultipartUpload] +// +// [CompleteMultipartUpload] +// +// [AbortMultipartUpload] +// +// [ListParts] +// +// [ListMultipartUploads] +// +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4)]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [Using Server-Side Encryption]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html +// [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [Multipart Upload Overview]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// +// [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html +// [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [CreateSession]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html +// [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions func (c *Client) UploadPart(ctx context.Context, params *UploadPartInput, optFns ...func(*Options)) (*UploadPartOutput, error) { if params == nil { params = &UploadPartInput{} @@ -109,21 +191,40 @@ func (c *Client) UploadPart(ctx context.Context, params *UploadPartInput, optFns type UploadPartInput struct { - // The name of the bucket to which the multipart upload was initiated. When using - // this action with an access point, you must direct requests to the access point - // hostname. The access point hostname takes the form + // The name of the bucket to which the multipart upload was initiated. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string @@ -137,7 +238,7 @@ type UploadPartInput struct { // 10,000. // // This member is required. - PartNumber int32 + PartNumber *int32 // Upload ID identifying the multipart upload whose part is being uploaded. // @@ -147,71 +248,85 @@ type UploadPartInput struct { // Object data. Body io.Reader - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not using - // the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the - // HTTP status code 400 Bad Request . For more information, see Checking object - // integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 - // ignores any provided ChecksumAlgorithm parameter. This checksum algorithm must - // be the same for all parts and it match the checksum value supplied in the - // CreateMultipartUpload request. + // Indicates the algorithm used to create the checksum for the object when you use + // the SDK. This header will not provide any additional functionality if you don't + // use the SDK. When you send this header, there must be a corresponding + // x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the + // request with the HTTP status code 400 Bad Request . For more information, see [Checking object integrity] + // in the Amazon S3 User Guide. + // + // If you provide an individual checksum, Amazon S3 ignores any provided + // ChecksumAlgorithm parameter. + // + // This checksum algorithm must be the same for all parts and it match the + // checksum value supplied in the CreateMultipartUpload request. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumAlgorithm types.ChecksumAlgorithm // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32 checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32C checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. + // base64-encoded, 32-bit CRC-32C checksum of the object. For more information, see + // [Checking object integrity]in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 160-bit SHA-1 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string // Size of the body in bytes. This parameter is useful when the size of the body // cannot be determined automatically. - ContentLength int64 + ContentLength *int64 // The base64-encoded 128-bit MD5 digest of the part data. This parameter is // auto-populated when using the command from the CLI. This parameter is required // if object lock parameters are specified. + // + // This functionality is not supported for directory buckets. ContentMD5 *string - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). + // The account ID of the expected bucket owner. If the account ID that you provide + // does not match the actual owner of the bucket, the request fails with the HTTP + // status code 403 Forbidden (access denied). ExpectedBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Specifies the algorithm to use when encrypting the object (for example, AES256). + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -220,48 +335,75 @@ type UploadPartInput struct { // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header . This must be the same // encryption key specified in the initiate multipart upload request. + // + // This functionality is not supported for directory buckets. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string noSmithyDocumentSerde } +func (in *UploadPartInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.Key = in.Key + +} + type UploadPartOutput struct { // Indicates whether the multipart upload uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + BucketKeyEnabled *bool + + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Entity tag for the uploaded object. @@ -269,24 +411,29 @@ type UploadPartOutput struct { // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms ). ServerSideEncryption types.ServerSideEncryption // Metadata pertaining to the operation's result. @@ -296,6 +443,9 @@ type UploadPartOutput struct { } func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpUploadPart{}, middleware.After) if err != nil { return err @@ -304,34 +454,38 @@ func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, opti if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UploadPart"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -343,10 +497,19 @@ func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, opti if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { return err } - if err = addUploadPartResolveEndpointMiddleware(stack, options); err != nil { + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpUploadPartValidationMiddleware(stack); err != nil { @@ -361,7 +524,7 @@ func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, opti if err = add100Continue(stack, options); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addUploadPartInputChecksumMiddlewares(stack, options); err != nil { @@ -385,12 +548,24 @@ func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, opti if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -405,7 +580,6 @@ func newServiceMetadataMiddleware_opUploadPart(region string) *awsmiddleware.Reg return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "UploadPart", } } @@ -489,139 +663,3 @@ func addUploadPartPayloadAsUnsigned(stack *middleware.Stack, options Options) er v4.RemoveComputePayloadSHA256Middleware(stack) return v4.AddUnsignedPayloadMiddleware(stack) } - -type opUploadPartResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opUploadPartResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opUploadPartResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*UploadPartInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addUploadPartResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opUploadPartResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPartCopy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPartCopy.go index ce9a179a..10cc2e74 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPartCopy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_UploadPartCopy.go @@ -4,89 +4,180 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) -// Uploads a part by copying data from an existing object as data source. You -// specify the data source by adding the request header x-amz-copy-source in your -// request and a byte range by adding the request header x-amz-copy-source-range -// in your request. For information about maximum and minimum part sizes and other -// multipart upload specifications, see Multipart upload limits (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) -// in the Amazon S3 User Guide. Instead of using an existing object as part data, -// you might use the UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// action and provide data in your request. You must initiate a multipart upload -// before you can upload any part. In response to your initiate request. Amazon S3 -// returns a unique identifier, the upload ID, that you must include in your upload -// part request. For more information about using the UploadPartCopy operation, -// see the following: -// - For conceptual information about multipart uploads, see Uploading Objects -// Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// in the Amazon S3 User Guide. -// - For information about permissions required to use the multipart upload API, -// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon S3 User Guide. -// - For information about copying objects using a single atomic action vs. a -// multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) -// in the Amazon S3 User Guide. -// - For information about using server-side encryption with customer-provided -// encryption keys with the UploadPartCopy operation, see CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// and UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// . -// -// Note the following additional considerations about the request headers -// x-amz-copy-source-if-match , x-amz-copy-source-if-none-match , -// x-amz-copy-source-if-unmodified-since , and x-amz-copy-source-if-modified-since -// : -// - Consideration 1 - If both of the x-amz-copy-source-if-match and -// x-amz-copy-source-if-unmodified-since headers are present in the request as -// follows: x-amz-copy-source-if-match condition evaluates to true , and; -// x-amz-copy-source-if-unmodified-since condition evaluates to false ; Amazon S3 -// returns 200 OK and copies the data. -// - Consideration 2 - If both of the x-amz-copy-source-if-none-match and -// x-amz-copy-source-if-modified-since headers are present in the request as -// follows: x-amz-copy-source-if-none-match condition evaluates to false , and; -// x-amz-copy-source-if-modified-since condition evaluates to true ; Amazon S3 -// returns 412 Precondition Failed response code. -// -// Versioning If your bucket has versioning enabled, you could have multiple -// versions of the same object. By default, x-amz-copy-source identifies the -// current version of the object to copy. If the current version is a delete marker -// and you don't specify a versionId in the x-amz-copy-source , Amazon S3 returns a -// 404 error, because the object does not exist. If you specify versionId in the -// x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns an -// HTTP 400 error, because you are not allowed to specify a delete marker as a -// version for the x-amz-copy-source . You can optionally specify a specific -// version of the source object to copy by adding the versionId subresource as -// shown in the following example: x-amz-copy-source: -// /bucket/object?versionId=version id Special errors -// - Code: NoSuchUpload -// - Cause: The specified multipart upload does not exist. The upload ID might -// be invalid, or the multipart upload might have been aborted or completed. +// Uploads a part by copying data from an existing object as data source. To +// specify the data source, you add the request header x-amz-copy-source in your +// request. To specify a byte range, you add the request header +// x-amz-copy-source-range in your request. +// +// For information about maximum and minimum part sizes and other multipart upload +// specifications, see [Multipart upload limits]in the Amazon S3 User Guide. +// +// Instead of copying data from an existing object as part data, you might use the [UploadPart] +// action to upload new data as a part of an object in your request. +// +// You must initiate a multipart upload before you can upload any part. In +// response to your initiate request, Amazon S3 returns the upload ID, a unique +// identifier that you must include in your upload part request. +// +// For conceptual information about multipart uploads, see [Uploading Objects Using Multipart Upload] in the Amazon S3 User +// Guide. For information about copying objects using a single atomic action vs. a +// multipart upload, see [Operations on Objects]in the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// operation to the Zonal endpoint. These endpoints support virtual-hosted-style +// requests in the format +// https://bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name . +// Path-style requests are not supported. For more information about endpoints in +// Availability Zones, see [Regional and Zonal endpoints for directory buckets in Availability Zones]in the Amazon S3 User Guide. For more information about +// endpoints in Local Zones, see [Available Local Zone for directory buckets]in the Amazon S3 User Guide. +// +// Authentication and authorization All UploadPartCopy requests must be +// authenticated and signed by using IAM credentials (access key ID and secret +// access key for the IAM identities). All headers with the x-amz- prefix, +// including x-amz-copy-source , must be signed. For more information, see [REST Authentication]. +// +// Directory buckets - You must use IAM credentials to authenticate and authorize +// your access to the UploadPartCopy API operation, instead of using the temporary +// security credentials through the CreateSession API operation. +// +// Amazon Web Services CLI or SDKs handles authentication and authorization on +// your behalf. +// +// Permissions You must have READ access to the source object and WRITE access to +// the destination bucket. +// +// - General purpose bucket permissions - You must have the permissions in a +// policy based on the bucket types of your source bucket and destination bucket in +// an UploadPartCopy operation. +// +// - If the source object is in a general purpose bucket, you must have the +// s3:GetObject permission to read the source object that is being copied. +// +// - If the destination bucket is a general purpose bucket, you must have the +// s3:PutObject permission to write the object copy to the destination bucket. +// +// - To perform a multipart upload with encryption using an Key Management +// Service key, the requester must have permission to the kms:Decrypt and +// kms:GenerateDataKey actions on the key. The requester must also have +// permissions for the kms:GenerateDataKey action for the CreateMultipartUpload +// API. Then, the requester needs permissions for the kms:Decrypt action on the +// UploadPart and UploadPartCopy APIs. These permissions are required because +// Amazon S3 must decrypt and read data from the encrypted file parts before it +// completes the multipart upload. For more information about KMS permissions, see [Protecting data using server-side encryption with KMS] +// in the Amazon S3 User Guide. For information about the permissions required to +// use the multipart upload API, see [Multipart upload and permissions]and [Multipart upload API and permissions]in the Amazon S3 User Guide. +// +// - Directory bucket permissions - You must have permissions in a bucket policy +// or an IAM identity-based policy based on the source and destination bucket types +// in an UploadPartCopy operation. +// +// - If the source object that you want to copy is in a directory bucket, you +// must have the s3express:CreateSession permission in the Action element of a +// policy to read the object. By default, the session is in the ReadWrite mode. +// If you want to restrict the access, you can explicitly set the +// s3express:SessionMode condition key to ReadOnly on the copy source bucket. +// +// - If the copy destination is a directory bucket, you must have the +// s3express:CreateSession permission in the Action element of a policy to write +// the object to the destination. The s3express:SessionMode condition key cannot +// be set to ReadOnly on the copy destination. +// +// If the object is encrypted with SSE-KMS, you must also have the +// +// kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies +// and KMS key policies for the KMS key. +// +// For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. +// +// Encryption +// +// - General purpose buckets - For information about using server-side +// encryption with customer-provided encryption keys with the UploadPartCopy +// operation, see [CopyObject]and [UploadPart]. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: server-side encryption with Amazon S3 +// managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys +// (SSE-KMS) ( aws:kms ). For more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. +// +// For directory buckets, when you perform a CreateMultipartUpload operation and an +// +// UploadPartCopy operation, the request headers you provide in the +// CreateMultipartUpload request must match the default encryption configuration +// of the destination bucket. +// +// S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from +// +// general purpose buckets to directory buckets, from directory buckets to general +// purpose buckets, or between directory buckets, through [UploadPartCopy]. In this case, Amazon +// S3 makes a call to KMS every time a copy request is made for a KMS-encrypted +// object. +// +// Special errors +// +// - Error Code: NoSuchUpload +// +// - Description: The specified multipart upload does not exist. The upload ID +// might be invalid, or the multipart upload might have been aborted or completed. +// // - HTTP Status Code: 404 Not Found -// - Code: InvalidRequest -// - Cause: The specified copy source is not supported as a byte-range copy -// source. +// +// - Error Code: InvalidRequest +// +// - Description: The specified copy source is not supported as a byte-range +// copy source. +// // - HTTP Status Code: 400 Bad Request // +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// Bucket-name.s3express-zone-id.region-code.amazonaws.com . +// // The following operations are related to UploadPartCopy : -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) +// +// [CreateMultipartUpload] +// +// [UploadPart] +// +// [CompleteMultipartUpload] +// +// [AbortMultipartUpload] +// +// [ListParts] +// +// [ListMultipartUploads] +// +// [Uploading Objects Using Multipart Upload]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html +// [ListParts]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html +// [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html +// [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html +// [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html +// [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions +// [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html +// [Available Local Zone for directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html +// [CreateMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html +// [Multipart upload limits]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html +// [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html +// [AbortMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html +// [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html +// [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html +// [Operations on Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html +// [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html +// [Regional and Zonal endpoints for directory buckets in Availability Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html +// +// [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html func (c *Client) UploadPartCopy(ctx context.Context, params *UploadPartCopyInput, optFns ...func(*Options)) (*UploadPartCopyOutput, error) { if params == nil { params = &UploadPartCopyInput{} @@ -104,53 +195,100 @@ func (c *Client) UploadPartCopy(ctx context.Context, params *UploadPartCopyInput type UploadPartCopyInput struct { - // The bucket name. When using this action with an access point, you must direct - // requests to the access point hostname. The access point hostname takes the form + // The bucket name. + // + // Directory buckets - When you use this operation with a directory bucket, you + // must use virtual-hosted-style requests in the format + // Bucket-name.s3express-zone-id.region-code.amazonaws.com . Path-style requests + // are not supported. Directory bucket names must be unique in the chosen Zone + // (Availability Zone or Local Zone). Bucket names must follow the format + // bucket-base-name--zone-id--x-s3 (for example, + // DOC-EXAMPLE-BUCKET--usw2-az1--x-s3 ). For information about bucket naming + // restrictions, see [Directory bucket naming rules]in the Amazon S3 User Guide. + // + // Copying objects across different Amazon Web Services Regions isn't supported + // when the source or destination bucket is in Amazon Web Services Local Zones. The + // source and destination buckets must have the same parent Amazon Web Services + // Region. Otherwise, you get an HTTP 400 Bad Request error with the error code + // InvalidRequest . + // + // Access points - When you use this action with an access point, you must provide + // the alias of the access point in place of the bucket name or specify the access + // point ARN. When using the access point ARN, you must direct requests to the + // access point hostname. The access point hostname takes the form // AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this // action with an access point through the Amazon Web Services SDKs, you provide // the access point ARN in place of the bucket name. For more information about - // access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. When you use this action with Amazon S3 on - // Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on - // Outposts hostname takes the form + // access point ARNs, see [Using access points]in the Amazon S3 User Guide. + // + // Access points and Object Lambda access points are not supported by directory + // buckets. + // + // S3 on Outposts - When you use this action with Amazon S3 on Outposts, you must + // direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname + // takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com . When you // use this action with S3 on Outposts through the Amazon Web Services SDKs, you // provide the Outposts access point ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see What is S3 on Outposts? (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. + // information about S3 on Outposts ARNs, see [What is S3 on Outposts?]in the Amazon S3 User Guide. + // + // [Directory bucket naming rules]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html + // [What is S3 on Outposts?]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html + // [Using access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html // // This member is required. Bucket *string // Specifies the source object for the copy operation. You specify the value in // one of two formats, depending on whether you want to access the source object - // through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html) - // : + // through an [access point]: + // // - For objects not accessed through an access point, specify the name of the // source bucket and key of the source object, separated by a slash (/). For // example, to copy the object reports/january.pdf from the bucket // awsexamplebucket , use awsexamplebucket/reports/january.pdf . The value must // be URL-encoded. + // // - For objects accessed through access points, specify the Amazon Resource // Name (ARN) of the object as accessed through the access point, in the format // arn:aws:s3:::accesspoint//object/ . For example, to copy the object // reports/january.pdf through access point my-access-point owned by account // 123456789012 in Region us-west-2 , use the URL encoding of // arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf - // . The value must be URL encoded. Amazon S3 supports copy operations using access - // points only when the source and destination buckets are in the same Amazon Web - // Services Region. Alternatively, for objects accessed through Amazon S3 on - // Outposts, specify the ARN of the object as accessed in the format + // . The value must be URL encoded. + // + // - Amazon S3 supports copy operations using Access points only when the source + // and destination buckets are in the same Amazon Web Services Region. + // + // - Access points are not supported by directory buckets. + // + // Alternatively, for objects accessed through Amazon S3 on Outposts, specify the + // ARN of the object as accessed in the format // arn:aws:s3-outposts:::outpost//object/ . For example, to copy the object // reports/january.pdf through outpost my-outpost owned by account 123456789012 // in Region us-west-2 , use the URL encoding of // arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf // . The value must be URL-encoded. - // To copy a specific version of an object, append ?versionId= to the value (for - // example, - // awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 - // ). If you don't specify a version ID, Amazon S3 copies the latest version of the - // source object. + // + // If your bucket has versioning enabled, you could have multiple versions of the + // same object. By default, x-amz-copy-source identifies the current version of + // the source object to copy. To copy a specific version of the source object to + // copy, append ?versionId= to the x-amz-copy-source request header (for example, + // x-amz-copy-source: + // /awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893 + // ). + // + // If the current version is a delete marker and you don't specify a versionId in + // the x-amz-copy-source request header, Amazon S3 returns a 404 Not Found error, + // because the object does not exist. If you specify versionId in the + // x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns an + // HTTP 400 Bad Request error, because you are not allowed to specify a delete + // marker as a version for the x-amz-copy-source . + // + // Directory buckets - S3 Versioning isn't enabled and supported for directory + // buckets. + // + // [access point]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html // // This member is required. CopySource *string @@ -164,7 +302,7 @@ type UploadPartCopyInput struct { // 10,000. // // This member is required. - PartNumber int32 + PartNumber *int32 // Upload ID identifying the multipart upload whose part is being copied. // @@ -172,15 +310,55 @@ type UploadPartCopyInput struct { UploadId *string // Copies the object if its entity tag (ETag) matches the specified tag. + // + // If both of the x-amz-copy-source-if-match and + // x-amz-copy-source-if-unmodified-since headers are present in the request as + // follows: + // + // x-amz-copy-source-if-match condition evaluates to true , and; + // + // x-amz-copy-source-if-unmodified-since condition evaluates to false ; + // + // Amazon S3 returns 200 OK and copies the data. CopySourceIfMatch *string // Copies the object if it has been modified since the specified time. + // + // If both of the x-amz-copy-source-if-none-match and + // x-amz-copy-source-if-modified-since headers are present in the request as + // follows: + // + // x-amz-copy-source-if-none-match condition evaluates to false , and; + // + // x-amz-copy-source-if-modified-since condition evaluates to true ; + // + // Amazon S3 returns 412 Precondition Failed response code. CopySourceIfModifiedSince *time.Time // Copies the object if its entity tag (ETag) is different than the specified ETag. + // + // If both of the x-amz-copy-source-if-none-match and + // x-amz-copy-source-if-modified-since headers are present in the request as + // follows: + // + // x-amz-copy-source-if-none-match condition evaluates to false , and; + // + // x-amz-copy-source-if-modified-since condition evaluates to true ; + // + // Amazon S3 returns 412 Precondition Failed response code. CopySourceIfNoneMatch *string // Copies the object if it hasn't been modified since the specified time. + // + // If both of the x-amz-copy-source-if-match and + // x-amz-copy-source-if-unmodified-since headers are present in the request as + // follows: + // + // x-amz-copy-source-if-match condition evaluates to true , and; + // + // x-amz-copy-source-if-unmodified-since condition evaluates to false ; + // + // Amazon S3 returns 200 OK and copies the data. CopySourceIfUnmodifiedSince *time.Time // The range of bytes to copy from the source object. The range value must use the @@ -191,40 +369,54 @@ type UploadPartCopyInput struct { CopySourceRange *string // Specifies the algorithm to use when decrypting the source object (for example, - // AES256). + // AES256 ). + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt // the source object. The encryption key provided in this header must be one that // was used when the source object was created. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceSSECustomerKeyMD5 *string - // The account ID of the expected destination bucket owner. If the destination - // bucket is owned by a different account, the request fails with the HTTP status - // code 403 Forbidden (access denied). + // The account ID of the expected destination bucket owner. If the account ID that + // you provide does not match the actual owner of the destination bucket, the + // request fails with the HTTP status code 403 Forbidden (access denied). ExpectedBucketOwner *string - // The account ID of the expected source bucket owner. If the source bucket is - // owned by a different account, the request fails with the HTTP status code 403 - // Forbidden (access denied). + // The account ID of the expected source bucket owner. If the account ID that you + // provide does not match the actual owner of the source bucket, the request fails + // with the HTTP status code 403 Forbidden (access denied). ExpectedSourceBucketOwner *string // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the - // source or destination Amazon S3 bucket has Requester Pays enabled, the requester - // will pay for corresponding charges to copy the object. For information about - // downloading objects from Requester Pays buckets, see Downloading Objects in - // Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. + // source or destination S3 bucket has Requester Pays enabled, the requester will + // pay for corresponding charges to copy the object. For information about + // downloading objects from Requester Pays buckets, see [Downloading Objects in Requester Pays Buckets]in the Amazon S3 User + // Guide. + // + // This functionality is not supported for directory buckets. + // + // [Downloading Objects in Requester Pays Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer types.RequestPayer - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). + // Specifies the algorithm to use when encrypting the object (for example, AES256). + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerAlgorithm *string // Specifies the customer-provided encryption key for Amazon S3 to use in @@ -233,49 +425,69 @@ type UploadPartCopyInput struct { // appropriate for use with the algorithm specified in the // x-amz-server-side-encryption-customer-algorithm header. This must be the same // encryption key specified in the initiate multipart upload request. + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerKey *string // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. // Amazon S3 uses this header for a message integrity check to ensure that the // encryption key was transmitted without error. + // + // This functionality is not supported when the destination bucket is a directory + // bucket. SSECustomerKeyMD5 *string noSmithyDocumentSerde } +func (in *UploadPartCopyInput) bindEndpointParams(p *EndpointParameters) { + + p.Bucket = in.Bucket + p.DisableS3ExpressSessionAuth = ptr.Bool(true) +} + type UploadPartCopyOutput struct { // Indicates whether the multipart upload uses an S3 Bucket Key for server-side // encryption with Key Management Service (KMS) keys (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // Container for all response elements. CopyPartResult *types.CopyPartResult // The version of the source object that was copied, if you have enabled // versioning on the source bucket. + // + // This functionality is not supported when the source object is in a directory + // bucket. CopySourceVersionId *string // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header confirming the encryption - // algorithm used. + // requested, the response will include this header to confirm the encryption + // algorithm that's used. + // + // This functionality is not supported for directory buckets. SSECustomerAlgorithm *string // If server-side encryption with a customer-provided encryption key was - // requested, the response will include this header to provide round-trip message - // integrity verification of the customer-provided encryption key. + // requested, the response will include this header to provide the round-trip + // message integrity verification of the customer-provided encryption key. + // + // This functionality is not supported for directory buckets. SSECustomerKeyMD5 *string - // If present, specifies the ID of the Key Management Service (KMS) symmetric - // encryption customer managed key that was used for the object. + // If present, indicates the ID of the KMS key that was used for object encryption. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing this object in Amazon S3 - // (for example, AES256 , aws:kms ). + // The server-side encryption algorithm used when you store this object in Amazon + // S3 (for example, AES256 , aws:kms ). ServerSideEncryption types.ServerSideEncryption // Metadata pertaining to the operation's result. @@ -285,6 +497,9 @@ type UploadPartCopyOutput struct { } func (c *Client) addOperationUploadPartCopyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpUploadPartCopy{}, middleware.After) if err != nil { return err @@ -293,34 +508,38 @@ func (c *Client) addOperationUploadPartCopyMiddlewares(stack *middleware.Stack, if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "UploadPartCopy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + if err = addComputePayloadSHA256(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -332,10 +551,19 @@ func (c *Client) addOperationUploadPartCopyMiddlewares(stack *middleware.Stack, if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addUploadPartCopyResolveEndpointMiddleware(stack, options); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } if err = addOpUploadPartCopyValidationMiddleware(stack); err != nil { @@ -347,7 +575,7 @@ func (c *Client) addOperationUploadPartCopyMiddlewares(stack *middleware.Stack, if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addUploadPartCopyUpdateEndpoint(stack, options); err != nil { @@ -368,12 +596,24 @@ func (c *Client) addOperationUploadPartCopyMiddlewares(stack *middleware.Stack, if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -388,7 +628,6 @@ func newServiceMetadataMiddleware_opUploadPartCopy(region string) *awsmiddleware return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "UploadPartCopy", } } @@ -418,139 +657,3 @@ func addUploadPartCopyUpdateEndpoint(stack *middleware.Stack, options Options) e DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opUploadPartCopyResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opUploadPartCopyResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opUploadPartCopyResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - input, ok := in.Parameters.(*UploadPartCopyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.Bucket = input.Bucket - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addUploadPartCopyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opUploadPartCopyResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_WriteGetObjectResponse.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_WriteGetObjectResponse.go index 751f646d..83c91baf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_WriteGetObjectResponse.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_WriteGetObjectResponse.go @@ -4,17 +4,12 @@ package s3 import ( "context" - "errors" "fmt" - "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - "github.com/aws/aws-sdk-go-v2/internal/v4a" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/s3/types" smithy "github.com/aws/smithy-go" - smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -23,41 +18,54 @@ import ( "time" ) +// This operation is not supported for directory buckets. +// // Passes transformed objects to a GetObject operation when using Object Lambda -// access points. For information about Object Lambda access points, see -// Transforming objects with Object Lambda access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html) -// in the Amazon S3 User Guide. This operation supports metadata that can be -// returned by GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// , in addition to RequestRoute , RequestToken , StatusCode , ErrorCode , and -// ErrorMessage . The GetObject response metadata is supported so that the -// WriteGetObjectResponse caller, typically an Lambda function, can provide the -// same metadata when it internally invokes GetObject . When WriteGetObjectResponse -// is called by a customer-owned Lambda function, the metadata returned to the end -// user GetObject call might differ from what Amazon S3 would normally return. You -// can include any number of metadata headers. When including a metadata header, it -// should be prefaced with x-amz-meta . For example, x-amz-meta-my-custom-header: -// MyCustomValue . The primary use case for this is to forward GetObject metadata. +// access points. For information about Object Lambda access points, see [Transforming objects with Object Lambda access points]in the +// Amazon S3 User Guide. +// +// This operation supports metadata that can be returned by [GetObject], in addition to +// RequestRoute , RequestToken , StatusCode , ErrorCode , and ErrorMessage . The +// GetObject response metadata is supported so that the WriteGetObjectResponse +// caller, typically an Lambda function, can provide the same metadata when it +// internally invokes GetObject . When WriteGetObjectResponse is called by a +// customer-owned Lambda function, the metadata returned to the end user GetObject +// call might differ from what Amazon S3 would normally return. +// +// You can include any number of metadata headers. When including a metadata +// header, it should be prefaced with x-amz-meta . For example, +// x-amz-meta-my-custom-header: MyCustomValue . The primary use case for this is to +// forward GetObject metadata. +// // Amazon Web Services provides some prebuilt Lambda functions that you can use // with S3 Object Lambda to detect and redact personally identifiable information // (PII) and decompress S3 objects. These Lambda functions are available in the // Amazon Web Services Serverless Application Repository, and can be selected // through the Amazon Web Services Management Console when you create your Object -// Lambda access point. Example 1: PII Access Control - This Lambda function uses -// Amazon Comprehend, a natural language processing (NLP) service using machine -// learning to find insights and relationships in text. It automatically detects -// personally identifiable information (PII) such as names, addresses, dates, -// credit card numbers, and social security numbers from documents in your Amazon -// S3 bucket. Example 2: PII Redaction - This Lambda function uses Amazon -// Comprehend, a natural language processing (NLP) service using machine learning -// to find insights and relationships in text. It automatically redacts personally +// Lambda access point. +// +// Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, a +// natural language processing (NLP) service using machine learning to find +// insights and relationships in text. It automatically detects personally // identifiable information (PII) such as names, addresses, dates, credit card // numbers, and social security numbers from documents in your Amazon S3 bucket. +// +// Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a +// natural language processing (NLP) service using machine learning to find +// insights and relationships in text. It automatically redacts personally +// identifiable information (PII) such as names, addresses, dates, credit card +// numbers, and social security numbers from documents in your Amazon S3 bucket. +// // Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, is // equipped to decompress objects stored in S3 in one of six compressed file -// formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. For information -// on how to view and use these functions, see Using Amazon Web Services built -// Lambda functions (https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html) -// in the Amazon S3 User Guide. +// formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. +// +// For information on how to view and use these functions, see [Using Amazon Web Services built Lambda functions] in the Amazon S3 +// User Guide. +// +// [Transforming objects with Object Lambda access points]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html +// [Using Amazon Web Services built Lambda functions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html +// [GetObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html func (c *Client) WriteGetObjectResponse(ctx context.Context, params *WriteGetObjectResponseInput, optFns ...func(*Options)) (*WriteGetObjectResponseOutput, error) { if params == nil { params = &WriteGetObjectResponseInput{} @@ -92,33 +100,39 @@ type WriteGetObjectResponseInput struct { // The object data. Body io.Reader - // Indicates whether the object stored in Amazon S3 uses an S3 bucket key for + // Indicates whether the object stored in Amazon S3 uses an S3 bucket key for // server-side encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled bool + BucketKeyEnabled *bool // Specifies caching behavior along the request/reply chain. CacheControl *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This specifies the - // base64-encoded, 32-bit CRC32 checksum of the object returned by the Object + // base64-encoded, 32-bit CRC-32 checksum of the object returned by the Object // Lambda function. This may not match the checksum for the object stored in Amazon // S3. Amazon S3 will perform validation of the checksum values only when the // original GetObject request required checksum validation. For more information - // about checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. Only one checksum header can be specified at a - // time. If you supply multiple checksum headers, this request will fail. + // about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + // + // Only one checksum header can be specified at a time. If you supply multiple + // checksum headers, this request will fail. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This specifies the - // base64-encoded, 32-bit CRC32C checksum of the object returned by the Object + // base64-encoded, 32-bit CRC-32C checksum of the object returned by the Object // Lambda function. This may not match the checksum for the object stored in Amazon // S3. Amazon S3 will perform validation of the checksum values only when the // original GetObject request required checksum validation. For more information - // about checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. Only one checksum header can be specified at a - // time. If you supply multiple checksum headers, this request will fail. + // about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + // + // Only one checksum header can be specified at a time. If you supply multiple + // checksum headers, this request will fail. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // This header can be used as a data integrity check to verify that the data @@ -127,9 +141,12 @@ type WriteGetObjectResponseInput struct { // function. This may not match the checksum for the object stored in Amazon S3. // Amazon S3 will perform validation of the checksum values only when the original // GetObject request required checksum validation. For more information about - // checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. Only one checksum header can be specified at a - // time. If you supply multiple checksum headers, this request will fail. + // checksums, see [Checking object integrity]in the Amazon S3 User Guide. + // + // Only one checksum header can be specified at a time. If you supply multiple + // checksum headers, this request will fail. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // This header can be used as a data integrity check to verify that the data @@ -138,9 +155,12 @@ type WriteGetObjectResponseInput struct { // Lambda function. This may not match the checksum for the object stored in Amazon // S3. Amazon S3 will perform validation of the checksum values only when the // original GetObject request required checksum validation. For more information - // about checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. Only one checksum header can be specified at a - // time. If you supply multiple checksum headers, this request will fail. + // about checksums, see [Checking object integrity]in the Amazon S3 User Guide. + // + // Only one checksum header can be specified at a time. If you supply multiple + // checksum headers, this request will fail. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string // Specifies presentational information for the object. @@ -155,7 +175,7 @@ type WriteGetObjectResponseInput struct { ContentLanguage *string // The size of the content body in bytes. - ContentLength int64 + ContentLength *int64 // The portion of the object returned in the response. ContentRange *string @@ -165,7 +185,7 @@ type WriteGetObjectResponseInput struct { // Specifies whether an object stored in Amazon S3 is ( true ) or is not ( false ) // a delete marker. - DeleteMarker bool + DeleteMarker *bool // An opaque identifier assigned by a web server to a specific version of a // resource found at a URL. @@ -203,29 +223,33 @@ type WriteGetObjectResponseInput struct { // can happen if you create metadata using an API like SOAP that supports more // flexible metadata than the REST API. For example, using SOAP, you can create // metadata whose values are not legal HTTP headers. - MissingMeta int32 + MissingMeta *int32 // Indicates whether an object stored in Amazon S3 has an active legal hold. ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus // Indicates whether an object stored in Amazon S3 has Object Lock enabled. For - // more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) - // . + // more information about S3 Object Lock, see [Object Lock]. + // + // [Object Lock]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html ObjectLockMode types.ObjectLockMode // The date and time when Object Lock is configured to expire. ObjectLockRetainUntilDate *time.Time // The count of parts this object has. - PartsCount int32 + PartsCount *int32 // Indicates if request involves bucket that is either a source or destination in - // a Replication rule. For more information about S3 Replication, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html) - // . + // a Replication rule. For more information about S3 Replication, see [Replication]. + // + // [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html ReplicationStatus types.ReplicationStatus // If present, indicates that the requester was successfully charged for the // request. + // + // This functionality is not supported for directory buckets. RequestCharged types.RequestCharged // Provides information about object restoration operation and expiration time of @@ -236,47 +260,63 @@ type WriteGetObjectResponseInput struct { // encryption key was specified for object stored in Amazon S3. SSECustomerAlgorithm *string - // 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to - // encrypt data stored in S3. For more information, see Protecting data using - // server-side encryption with customer-provided encryption keys (SSE-C) (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html) - // . + // 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to + // encrypt data stored in S3. For more information, see [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]. + // + // [Protecting data using server-side encryption with customer-provided encryption keys (SSE-C)]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html SSECustomerKeyMD5 *string - // If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web + // If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web // Services Key Management Service (Amazon Web Services KMS) symmetric encryption // customer managed key that was used for stored in Amazon S3 object. SSEKMSKeyId *string - // The server-side encryption algorithm used when storing requested object in + // The server-side encryption algorithm used when storing requested object in // Amazon S3 (for example, AES256, aws:kms ). ServerSideEncryption types.ServerSideEncryption // The integer status code for an HTTP response of a corresponding GetObject // request. The following is a list of status codes. + // // - 200 - OK + // // - 206 - Partial Content + // // - 304 - Not Modified + // // - 400 - Bad Request + // // - 401 - Unauthorized + // // - 403 - Forbidden + // // - 404 - Not Found + // // - 405 - Method Not Allowed + // // - 409 - Conflict + // // - 411 - Length Required + // // - 412 - Precondition Failed + // // - 416 - Range Not Satisfiable + // // - 500 - Internal Server Error + // // - 503 - Service Unavailable - StatusCode int32 + StatusCode *int32 // Provides storage class information of the object. Amazon S3 returns this header - // for all objects except for S3 Standard storage class objects. For more - // information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // . + // for all objects except for S3 Standard storage class objects. + // + // For more information, see [Storage Classes]. + // + // [Storage Classes]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html StorageClass types.StorageClass // The number of tags, if any, on the object. - TagCount int32 + TagCount *int32 // An ID used to reference a specific version of the object. VersionId *string @@ -284,6 +324,11 @@ type WriteGetObjectResponseInput struct { noSmithyDocumentSerde } +func (in *WriteGetObjectResponseInput) bindEndpointParams(p *EndpointParameters) { + + p.UseObjectLambdaEndpoint = ptr.Bool(true) +} + type WriteGetObjectResponseOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata @@ -292,6 +337,9 @@ type WriteGetObjectResponseOutput struct { } func (c *Client) addOperationWriteGetObjectResponseMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } err = stack.Serialize.Add(&awsRestxml_serializeOpWriteGetObjectResponse{}, middleware.After) if err != nil { return err @@ -300,37 +348,41 @@ func (c *Client) addOperationWriteGetObjectResponseMiddlewares(stack *middleware if err != nil { return err } + if err := addProtocolFinalizerMiddlewares(stack, options, "WriteGetObjectResponse"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + if err = addClientRequestID(stack); err != nil { return err } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = v4.AddUnsignedPayloadMiddleware(stack); err != nil { + if err = addUnsignedPayload(stack); err != nil { return err } - if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil { + if err = addContentSHA256Header(stack); err != nil { return err } - if err = addRetryMiddlewares(stack, options); err != nil { + if err = addRetry(stack, options); err != nil { return err } - if err = addHTTPSignerV4Middleware(stack, options); err != nil { + if err = addRawResponseToMetadata(stack); err != nil { return err } - if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + if err = addRecordResponseTiming(stack); err != nil { return err } - if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { @@ -342,13 +394,22 @@ func (c *Client) addOperationWriteGetObjectResponseMiddlewares(stack *middleware if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } - if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil { + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } - if err = addEndpointPrefix_opWriteGetObjectResponseMiddleware(stack); err != nil { + if err = addPutBucketContextMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIsExpressUserAgent(stack); err != nil { return err } - if err = addWriteGetObjectResponseResolveEndpointMiddleware(stack, options); err != nil { + if err = addEndpointPrefix_opWriteGetObjectResponseMiddleware(stack); err != nil { return err } if err = addOpWriteGetObjectResponseValidationMiddleware(stack); err != nil { @@ -360,7 +421,7 @@ func (c *Client) addOperationWriteGetObjectResponseMiddlewares(stack *middleware if err = addMetadataRetrieverMiddleware(stack); err != nil { return err } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + if err = addRecursionDetection(stack); err != nil { return err } if err = addWriteGetObjectResponseUpdateEndpoint(stack, options); err != nil { @@ -378,12 +439,24 @@ func (c *Client) addOperationWriteGetObjectResponseMiddlewares(stack *middleware if err = addRequestResponseLogging(stack, options); err != nil { return err } - if err = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSerializeImmutableHostnameBucketMiddleware(stack, options); err != nil { return err } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } return nil } @@ -394,11 +467,11 @@ func (*endpointPrefix_opWriteGetObjectResponseMiddleware) ID() string { return "EndpointHostPrefix" } -func (m *endpointPrefix_opWriteGetObjectResponseMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, +func (m *endpointPrefix_opWriteGetObjectResponseMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) @@ -406,9 +479,10 @@ func (m *endpointPrefix_opWriteGetObjectResponseMiddleware) HandleSerialize(ctx return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } - input, ok := in.Parameters.(*WriteGetObjectResponseInput) + opaqueInput := getOperationInput(ctx) + input, ok := opaqueInput.(*WriteGetObjectResponseInput) if !ok { - return out, metadata, fmt.Errorf("unknown input type %T", in.Parameters) + return out, metadata, fmt.Errorf("unknown input type %T", opaqueInput) } var prefix strings.Builder @@ -422,17 +496,16 @@ func (m *endpointPrefix_opWriteGetObjectResponseMiddleware) HandleSerialize(ctx prefix.WriteString(".") req.URL.Host = prefix.String() + req.URL.Host - return next.HandleSerialize(ctx, in) + return next.HandleFinalize(ctx, in) } func addEndpointPrefix_opWriteGetObjectResponseMiddleware(stack *middleware.Stack) error { - return stack.Serialize.Insert(&endpointPrefix_opWriteGetObjectResponseMiddleware{}, `OperationSerializer`, middleware.After) + return stack.Finalize.Insert(&endpointPrefix_opWriteGetObjectResponseMiddleware{}, "ResolveEndpointV2", middleware.After) } func newServiceMetadataMiddleware_opWriteGetObjectResponse(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, - SigningName: "s3", OperationName: "WriteGetObjectResponse", } } @@ -452,134 +525,3 @@ func addWriteGetObjectResponseUpdateEndpoint(stack *middleware.Stack, options Op DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, }) } - -type opWriteGetObjectResponseResolveEndpointMiddleware struct { - EndpointResolver EndpointResolverV2 - BuiltInResolver builtInParameterResolver -} - -func (*opWriteGetObjectResponseResolveEndpointMiddleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *opWriteGetObjectResponseResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.EndpointResolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := EndpointParameters{} - - m.BuiltInResolver.ResolveBuiltIns(¶ms) - - params.UseObjectLambdaEndpoint = ptr.Bool(true) - - var resolvedEndpoint smithyendpoints.Endpoint - resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL = &resolvedEndpoint.URI - - for k := range resolvedEndpoint.Headers { - req.Header.Set( - k, - resolvedEndpoint.Headers.Get(k), - ) - } - - authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) - if err != nil { - var nfe *internalauth.NoAuthenticationSchemesFoundError - if errors.As(err, &nfe) { - // if no auth scheme is found, default to sigv4 - signingName := "s3" - signingRegion := m.BuiltInResolver.(*builtInResolver).Region - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, internalauth.SigV4) - } - var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError - if errors.As(err, &ue) { - return out, metadata, fmt.Errorf( - "This operation requests signer version(s) %v but the client only supports %v", - ue.UnsupportedSchemes, - internalauth.SupportedSchemes, - ) - } - } - - for _, authScheme := range authSchemes { - switch authScheme.(type) { - case *internalauth.AuthenticationSchemeV4: - v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) - var signingName, signingRegion string - if v4Scheme.SigningName == nil { - signingName = "s3" - } else { - signingName = *v4Scheme.SigningName - } - if v4Scheme.SigningRegion == nil { - signingRegion = m.BuiltInResolver.(*builtInResolver).Region - } else { - signingRegion = *v4Scheme.SigningRegion - } - if v4Scheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) - ctx = s3cust.SetSignerVersion(ctx, v4Scheme.Name) - break - case *internalauth.AuthenticationSchemeV4A: - v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) - if v4aScheme.SigningName == nil { - v4aScheme.SigningName = aws.String("s3") - } - if v4aScheme.DisableDoubleEncoding != nil { - // The signer sets an equivalent value at client initialization time. - // Setting this context value will cause the signer to extract it - // and override the value set at client initialization time. - ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) - } - ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) - ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) - ctx = s3cust.SetSignerVersion(ctx, v4a.Version) - break - case *internalauth.AuthenticationSchemeNone: - break - } - } - - return next.HandleSerialize(ctx, in) -} - -func addWriteGetObjectResponseResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { - return stack.Serialize.Insert(&opWriteGetObjectResponseResolveEndpointMiddleware{ - EndpointResolver: options.EndpointResolverV2, - BuiltInResolver: &builtInResolver{ - Region: options.Region, - UseFIPS: options.EndpointOptions.UseFIPSEndpoint, - UseDualStack: options.EndpointOptions.UseDualStackEndpoint, - Endpoint: options.BaseEndpoint, - ForcePathStyle: options.UsePathStyle, - Accelerate: options.UseAccelerate, - DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints, - UseArnRegion: options.UseARNRegion, - }, - }, "ResolveEndpoint", middleware.After) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/auth.go new file mode 100644 index 00000000..6faedcc0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/auth.go @@ -0,0 +1,347 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +func bindAuthEndpointParams(ctx context.Context, params *AuthResolverParameters, input interface{}, options Options) { + params.endpointParams = bindEndpointParams(ctx, input, options) +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The endpoint resolver parameters for this operation. This service's default + // resolver delegates to endpoint rules. + endpointParams *EndpointParameters + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthEndpointParams(ctx, params, input, options) + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "WriteGetObjectResponse": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "s3") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + smithyhttp.SetIsUnsignedPayload(&props, true) + return props + }(), + }, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "s3") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + + { + SchemeID: smithyauth.SchemeIDSigV4A, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4ASigningName(&props, "s3") + smithyhttp.SetSigV4ASigningRegions(&props, []string{params.Region}) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/bucket_context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/bucket_context.go new file mode 100644 index 00000000..860af056 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/bucket_context.go @@ -0,0 +1,47 @@ +package s3 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + "github.com/aws/smithy-go/middleware" +) + +// putBucketContextMiddleware stores the input bucket name within the request context (if +// present) which is required for a variety of custom S3 behaviors +type putBucketContextMiddleware struct{} + +func (*putBucketContextMiddleware) ID() string { + return "putBucketContext" +} + +func (m *putBucketContextMiddleware) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if bucket, ok := m.bucketFromInput(in.Parameters); ok { + ctx = customizations.SetBucket(ctx, bucket) + } + return next.HandleSerialize(ctx, in) +} + +func (m *putBucketContextMiddleware) bucketFromInput(params interface{}) (string, bool) { + v, ok := params.(bucketer) + if !ok { + return "", false + } + + return v.bucket() +} + +func addPutBucketContextMiddleware(stack *middleware.Stack) error { + // This is essentially a post-Initialize task - only run it once the input + // has received all modifications from that phase. Therefore we add it as + // an early Serialize step. + // + // FUTURE: it would be nice to have explicit phases that only we as SDK + // authors can hook into (such as between phases like this really should + // be) + return stack.Serialize.Add(&putBucketContextMiddleware{}, middleware.Before) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/create_mpu_checksum.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/create_mpu_checksum.go new file mode 100644 index 00000000..5803b9e4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/create_mpu_checksum.go @@ -0,0 +1,36 @@ +package s3 + +import ( + "context" + "fmt" + + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/smithy-go/middleware" +) + +// backfills checksum algorithm onto the context for CreateMultipart upload so +// transfer manager can set a checksum header on the request accordingly for +// s3express requests +type setCreateMPUChecksumAlgorithm struct{} + +func (*setCreateMPUChecksumAlgorithm) ID() string { + return "setCreateMPUChecksumAlgorithm" +} + +func (*setCreateMPUChecksumAlgorithm) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateMultipartUploadInput) + if !ok { + return out, metadata, fmt.Errorf("unexpected input type %T", in.Parameters) + } + + ctx = internalcontext.SetChecksumInputAlgorithm(ctx, string(input.ChecksumAlgorithm)) + return next.HandleSerialize(ctx, in) +} + +func addSetCreateMPUChecksumAlgorithm(s *middleware.Stack) error { + return s.Serialize.Add(&setCreateMPUChecksumAlgorithm{}, middleware.Before) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go index fc192a32..c1ccf106 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go @@ -20,13 +20,23 @@ import ( "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strconv" "strings" + "time" ) +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + type awsRestxml_deserializeOpAbortMultipartUpload struct { } @@ -42,6 +52,10 @@ func (m *awsRestxml_deserializeOpAbortMultipartUpload) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -58,6 +72,7 @@ func (m *awsRestxml_deserializeOpAbortMultipartUpload) HandleDeserialize(ctx con return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -132,6 +147,10 @@ func (m *awsRestxml_deserializeOpCompleteMultipartUpload) HandleDeserialize(ctx return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -176,6 +195,7 @@ func (m *awsRestxml_deserializeOpCompleteMultipartUpload) HandleDeserialize(ctx } } + span.End() return out, metadata, err } @@ -230,7 +250,7 @@ func awsRestxml_deserializeOpHttpBindingsCompleteMultipartUploadOutput(v *Comple if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 { @@ -415,6 +435,10 @@ func (m *awsRestxml_deserializeOpCopyObject) HandleDeserialize(ctx context.Conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -459,6 +483,7 @@ func (m *awsRestxml_deserializeOpCopyObject) HandleDeserialize(ctx context.Conte } } + span.End() return out, metadata, err } @@ -516,7 +541,7 @@ func awsRestxml_deserializeOpHttpBindingsCopyObjectOutput(v *CopyObjectOutput, r if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-copy-source-version-id"); len(headerValues) != 0 { @@ -623,6 +648,10 @@ func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -639,6 +668,7 @@ func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Con return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -701,6 +731,86 @@ func awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(v *CreateBucketOutpu return nil } +type awsRestxml_deserializeOpCreateBucketMetadataTableConfiguration struct { +} + +func (*awsRestxml_deserializeOpCreateBucketMetadataTableConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateBucketMetadataTableConfiguration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsRestxml_deserializeOpErrorCreateBucketMetadataTableConfiguration(response, &metadata) + } + output := &CreateBucketMetadataTableConfigurationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCreateBucketMetadataTableConfiguration(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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + UseStatusCode: true, StatusCode: response.StatusCode, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestxml_deserializeOpCreateMultipartUpload struct { } @@ -716,6 +826,10 @@ func (m *awsRestxml_deserializeOpCreateMultipartUpload) HandleDeserialize(ctx co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -760,6 +874,7 @@ func (m *awsRestxml_deserializeOpCreateMultipartUpload) HandleDeserialize(ctx co } } + span.End() return out, metadata, err } @@ -828,7 +943,7 @@ func awsRestxml_deserializeOpHttpBindingsCreateMultipartUploadOutput(v *CreateMu if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-checksum-algorithm"); len(headerValues) != 0 { @@ -943,6 +1058,189 @@ func awsRestxml_deserializeOpDocumentCreateMultipartUploadOutput(v **CreateMulti return nil } +type awsRestxml_deserializeOpCreateSession struct { +} + +func (*awsRestxml_deserializeOpCreateSession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateSession) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsRestxml_deserializeOpErrorCreateSession(response, &metadata) + } + output := &CreateSessionOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsCreateSessionOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentCreateSessionOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCreateSession(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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + UseStatusCode: true, StatusCode: response.StatusCode, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("NoSuchBucket", errorCode): + return awsRestxml_deserializeErrorNoSuchBucket(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsCreateSessionOutput(v *CreateSessionOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseBool(headerValues[0]) + if err != nil { + return err + } + v.BucketKeyEnabled = ptr.Bool(vv) + } + + if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-server-side-encryption-context"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.SSEKMSEncryptionContext = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.SSEKMSKeyId = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateSessionOutput + if *v == nil { + sv = &CreateSessionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSessionCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + type awsRestxml_deserializeOpDeleteBucket struct { } @@ -958,6 +1256,10 @@ func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -975,6 +1277,7 @@ func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Con } } + span.End() return out, metadata, err } @@ -1033,6 +1336,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketAnalyticsConfiguration) HandleDeser return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1050,6 +1357,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketAnalyticsConfiguration) HandleDeser } } + span.End() return out, metadata, err } @@ -1108,6 +1416,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketCors) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1125,6 +1437,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketCors) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -1183,6 +1496,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketEncryption) HandleDeserialize(ctx c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1200,6 +1517,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketEncryption) HandleDeserialize(ctx c } } + span.End() return out, metadata, err } @@ -1258,6 +1576,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketIntelligentTieringConfiguration) Ha return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1275,6 +1597,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketIntelligentTieringConfiguration) Ha } } + span.End() return out, metadata, err } @@ -1333,6 +1656,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketInventoryConfiguration) HandleDeser return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1350,6 +1677,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketInventoryConfiguration) HandleDeser } } + span.End() return out, metadata, err } @@ -1408,6 +1736,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketLifecycle) HandleDeserialize(ctx co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1425,6 +1757,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketLifecycle) HandleDeserialize(ctx co } } + span.End() return out, metadata, err } @@ -1468,14 +1801,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketLifecycle(response *smithyhttp.Res } } -type awsRestxml_deserializeOpDeleteBucketMetricsConfiguration struct { +type awsRestxml_deserializeOpDeleteBucketMetadataTableConfiguration struct { } -func (*awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketMetadataTableConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketMetadataTableConfiguration) 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) @@ -1483,15 +1816,19 @@ func (m *awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) HandleDeseria return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() 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, awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketMetadataTableConfiguration(response, &metadata) } - output := &DeleteBucketMetricsConfigurationOutput{} + output := &DeleteBucketMetadataTableConfigurationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1500,10 +1837,11 @@ func (m *awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) HandleDeseria } } + span.End() return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketMetadataTableConfiguration(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)} @@ -1543,14 +1881,14 @@ func awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response *smi } } -type awsRestxml_deserializeOpDeleteBucketOwnershipControls struct { +type awsRestxml_deserializeOpDeleteBucketMetricsConfiguration struct { } -func (*awsRestxml_deserializeOpDeleteBucketOwnershipControls) ID() string { +func (*awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteBucketOwnershipControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) 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) @@ -1558,15 +1896,19 @@ func (m *awsRestxml_deserializeOpDeleteBucketOwnershipControls) HandleDeserializ return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() 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, awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response, &metadata) } - output := &DeleteBucketOwnershipControlsOutput{} + output := &DeleteBucketMetricsConfigurationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1575,10 +1917,11 @@ func (m *awsRestxml_deserializeOpDeleteBucketOwnershipControls) HandleDeserializ } } + span.End() return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(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)} @@ -1618,7 +1961,87 @@ func awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response *smithy } } -type awsRestxml_deserializeOpDeleteBucketPolicy struct { +type awsRestxml_deserializeOpDeleteBucketOwnershipControls struct { +} + +func (*awsRestxml_deserializeOpDeleteBucketOwnershipControls) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteBucketOwnershipControls) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response, &metadata) + } + output := &DeleteBucketOwnershipControlsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + UseStatusCode: true, StatusCode: response.StatusCode, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDeleteBucketPolicy struct { } func (*awsRestxml_deserializeOpDeleteBucketPolicy) ID() string { @@ -1633,6 +2056,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1650,6 +2077,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx conte } } + span.End() return out, metadata, err } @@ -1708,6 +2136,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1725,6 +2157,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx } } + span.End() return out, metadata, err } @@ -1783,6 +2216,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1800,6 +2237,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -1858,6 +2296,10 @@ func (m *awsRestxml_deserializeOpDeleteBucketWebsite) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1875,6 +2317,7 @@ func (m *awsRestxml_deserializeOpDeleteBucketWebsite) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -1933,6 +2376,10 @@ func (m *awsRestxml_deserializeOpDeleteObject) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -1949,6 +2396,7 @@ func (m *awsRestxml_deserializeOpDeleteObject) HandleDeserialize(ctx context.Con return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -2003,7 +2451,7 @@ func awsRestxml_deserializeOpHttpBindingsDeleteObjectOutput(v *DeleteObjectOutpu if err != nil { return err } - v.DeleteMarker = vv + v.DeleteMarker = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 { @@ -2034,6 +2482,10 @@ func (m *awsRestxml_deserializeOpDeleteObjects) HandleDeserialize(ctx context.Co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2078,6 +2530,7 @@ func (m *awsRestxml_deserializeOpDeleteObjects) HandleDeserialize(ctx context.Co } } + span.End() return out, metadata, err } @@ -2196,6 +2649,10 @@ func (m *awsRestxml_deserializeOpDeleteObjectTagging) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2212,6 +2669,7 @@ func (m *awsRestxml_deserializeOpDeleteObjectTagging) HandleDeserialize(ctx cont return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -2283,6 +2741,10 @@ func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2300,6 +2762,7 @@ func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx } } + span.End() return out, metadata, err } @@ -2358,6 +2821,10 @@ func (m *awsRestxml_deserializeOpGetBucketAccelerateConfiguration) HandleDeseria return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2402,6 +2869,7 @@ func (m *awsRestxml_deserializeOpGetBucketAccelerateConfiguration) HandleDeseria } } + span.End() return out, metadata, err } @@ -2521,6 +2989,10 @@ func (m *awsRestxml_deserializeOpGetBucketAcl) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2560,6 +3032,7 @@ func (m *awsRestxml_deserializeOpGetBucketAcl) HandleDeserialize(ctx context.Con } } + span.End() return out, metadata, err } @@ -2666,6 +3139,10 @@ func (m *awsRestxml_deserializeOpGetBucketAnalyticsConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2705,6 +3182,7 @@ func (m *awsRestxml_deserializeOpGetBucketAnalyticsConfiguration) HandleDeserial } } + span.End() return out, metadata, err } @@ -2805,6 +3283,10 @@ func (m *awsRestxml_deserializeOpGetBucketCors) HandleDeserialize(ctx context.Co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2844,6 +3326,7 @@ func (m *awsRestxml_deserializeOpGetBucketCors) HandleDeserialize(ctx context.Co } } + span.End() return out, metadata, err } @@ -2944,6 +3427,10 @@ func (m *awsRestxml_deserializeOpGetBucketEncryption) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -2983,6 +3470,7 @@ func (m *awsRestxml_deserializeOpGetBucketEncryption) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -3083,6 +3571,10 @@ func (m *awsRestxml_deserializeOpGetBucketIntelligentTieringConfiguration) Handl return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3122,6 +3614,7 @@ func (m *awsRestxml_deserializeOpGetBucketIntelligentTieringConfiguration) Handl } } + span.End() return out, metadata, err } @@ -3222,6 +3715,10 @@ func (m *awsRestxml_deserializeOpGetBucketInventoryConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3261,6 +3758,7 @@ func (m *awsRestxml_deserializeOpGetBucketInventoryConfiguration) HandleDeserial } } + span.End() return out, metadata, err } @@ -3361,6 +3859,10 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3372,6 +3874,11 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial output := &GetBucketLifecycleConfigurationOutput{} out.Result = output + err = awsRestxml_deserializeOpHttpBindingsGetBucketLifecycleConfigurationOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -3400,6 +3907,7 @@ func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserial } } + span.End() return out, metadata, err } @@ -3443,6 +3951,18 @@ func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response *smit } } +func awsRestxml_deserializeOpHttpBindingsGetBucketLifecycleConfigurationOutput(v *GetBucketLifecycleConfigurationOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-transition-default-minimum-object-size"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.TransitionDefaultMinimumObjectSize = types.TransitionDefaultMinimumObjectSize(headerValues[0]) + } + + return nil +} func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **GetBucketLifecycleConfigurationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3500,6 +4020,10 @@ func (m *awsRestxml_deserializeOpGetBucketLocation) HandleDeserialize(ctx contex return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3539,6 +4063,7 @@ func (m *awsRestxml_deserializeOpGetBucketLocation) HandleDeserialize(ctx contex } } + span.End() return out, metadata, err } @@ -3646,6 +4171,10 @@ func (m *awsRestxml_deserializeOpGetBucketLogging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3685,6 +4214,7 @@ func (m *awsRestxml_deserializeOpGetBucketLogging) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -3770,6 +4300,150 @@ func awsRestxml_deserializeOpDocumentGetBucketLoggingOutput(v **GetBucketLogging return nil } +type awsRestxml_deserializeOpGetBucketMetadataTableConfiguration struct { +} + +func (*awsRestxml_deserializeOpGetBucketMetadataTableConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetBucketMetadataTableConfiguration) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsRestxml_deserializeOpErrorGetBucketMetadataTableConfiguration(response, &metadata) + } + output := &GetBucketMetadataTableConfigurationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentGetBucketMetadataTableConfigurationResult(&output.GetBucketMetadataTableConfigurationResult, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetBucketMetadataTableConfiguration(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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + UseStatusCode: true, StatusCode: response.StatusCode, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentGetBucketMetadataTableConfigurationOutput(v **GetBucketMetadataTableConfigurationOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetBucketMetadataTableConfigurationOutput + if *v == nil { + sv = &GetBucketMetadataTableConfigurationOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("GetBucketMetadataTableConfigurationResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentGetBucketMetadataTableConfigurationResult(&sv.GetBucketMetadataTableConfigurationResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + type awsRestxml_deserializeOpGetBucketMetricsConfiguration struct { } @@ -3785,6 +4459,10 @@ func (m *awsRestxml_deserializeOpGetBucketMetricsConfiguration) HandleDeserializ return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3824,6 +4502,7 @@ func (m *awsRestxml_deserializeOpGetBucketMetricsConfiguration) HandleDeserializ } } + span.End() return out, metadata, err } @@ -3924,6 +4603,10 @@ func (m *awsRestxml_deserializeOpGetBucketNotificationConfiguration) HandleDeser return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -3963,6 +4646,7 @@ func (m *awsRestxml_deserializeOpGetBucketNotificationConfiguration) HandleDeser } } + span.End() return out, metadata, err } @@ -4081,6 +4765,10 @@ func (m *awsRestxml_deserializeOpGetBucketOwnershipControls) HandleDeserialize(c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4120,6 +4808,7 @@ func (m *awsRestxml_deserializeOpGetBucketOwnershipControls) HandleDeserialize(c } } + span.End() return out, metadata, err } @@ -4220,6 +4909,10 @@ func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context. return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4236,6 +4929,7 @@ func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context. return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} } + span.End() return out, metadata, err } @@ -4315,6 +5009,10 @@ func (m *awsRestxml_deserializeOpGetBucketPolicyStatus) HandleDeserialize(ctx co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4354,6 +5052,7 @@ func (m *awsRestxml_deserializeOpGetBucketPolicyStatus) HandleDeserialize(ctx co } } + span.End() return out, metadata, err } @@ -4454,6 +5153,10 @@ func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4493,6 +5196,7 @@ func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx con } } + span.End() return out, metadata, err } @@ -4593,6 +5297,10 @@ func (m *awsRestxml_deserializeOpGetBucketRequestPayment) HandleDeserialize(ctx return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4632,6 +5340,7 @@ func (m *awsRestxml_deserializeOpGetBucketRequestPayment) HandleDeserialize(ctx } } + span.End() return out, metadata, err } @@ -4739,6 +5448,10 @@ func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4778,6 +5491,7 @@ func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -4878,6 +5592,10 @@ func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -4917,6 +5635,7 @@ func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -5037,6 +5756,10 @@ func (m *awsRestxml_deserializeOpGetBucketWebsite) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -5076,6 +5799,7 @@ func (m *awsRestxml_deserializeOpGetBucketWebsite) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -5194,6 +5918,10 @@ func (m *awsRestxml_deserializeOpGetObject) HandleDeserialize(ctx context.Contex return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -5215,6 +5943,7 @@ func (m *awsRestxml_deserializeOpGetObject) HandleDeserialize(ctx context.Contex return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} } + span.End() return out, metadata, err } @@ -5280,7 +6009,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { @@ -5329,7 +6058,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.ContentLength = vv + v.ContentLength = ptr.Int64(vv) } if headerValues := response.Header.Values("Content-Range"); len(headerValues) != 0 { @@ -5348,7 +6077,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.DeleteMarker = vv + v.DeleteMarker = ptr.Bool(vv) } if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { @@ -5362,12 +6091,17 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res } if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - t, err := smithytime.ParseHTTPDate(headerValues[0]) + deserOverride, err := deserializeS3Expires(headerValues[0]) if err != nil { return err } - v.Expires = ptr.Time(t) + v.Expires = deserOverride + + } + + if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ExpiresString = ptr.String(headerValues[0]) } if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 { @@ -5395,7 +6129,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.MissingMeta = int32(vv) + v.MissingMeta = ptr.Int32(int32(vv)) } if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 { @@ -5423,7 +6157,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.PartsCount = int32(vv) + v.PartsCount = ptr.Int32(int32(vv)) } if headerValues := response.Header.Values("x-amz-replication-status"); len(headerValues) != 0 { @@ -5472,7 +6206,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res if err != nil { return err } - v.TagCount = int32(vv) + v.TagCount = ptr.Int32(int32(vv)) } if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 { @@ -5510,6 +6244,10 @@ func (m *awsRestxml_deserializeOpGetObjectAcl) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -5554,6 +6292,7 @@ func (m *awsRestxml_deserializeOpGetObjectAcl) HandleDeserialize(ctx context.Con } } + span.End() return out, metadata, err } @@ -5675,6 +6414,10 @@ func (m *awsRestxml_deserializeOpGetObjectAttributes) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -5719,6 +6462,7 @@ func (m *awsRestxml_deserializeOpGetObjectAttributes) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -5776,7 +6520,7 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectAttributesOutput(v *GetObjectA if err != nil { return err } - v.DeleteMarker = vv + v.DeleteMarker = ptr.Bool(vv) } if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 { @@ -5861,7 +6605,7 @@ func awsRestxml_deserializeOpDocumentGetObjectAttributesOutput(v **GetObjectAttr if err != nil { return err } - sv.ObjectSize = i64 + sv.ObjectSize = ptr.Int64(i64) } case strings.EqualFold("StorageClass", t.Name.Local): @@ -5906,6 +6650,10 @@ func (m *awsRestxml_deserializeOpGetObjectLegalHold) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -5945,6 +6693,7 @@ func (m *awsRestxml_deserializeOpGetObjectLegalHold) HandleDeserialize(ctx conte } } + span.End() return out, metadata, err } @@ -6045,6 +6794,10 @@ func (m *awsRestxml_deserializeOpGetObjectLockConfiguration) HandleDeserialize(c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6084,6 +6837,7 @@ func (m *awsRestxml_deserializeOpGetObjectLockConfiguration) HandleDeserialize(c } } + span.End() return out, metadata, err } @@ -6184,6 +6938,10 @@ func (m *awsRestxml_deserializeOpGetObjectRetention) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6223,6 +6981,7 @@ func (m *awsRestxml_deserializeOpGetObjectRetention) HandleDeserialize(ctx conte } } + span.End() return out, metadata, err } @@ -6323,6 +7082,10 @@ func (m *awsRestxml_deserializeOpGetObjectTagging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6367,6 +7130,7 @@ func (m *awsRestxml_deserializeOpGetObjectTagging) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -6479,6 +7243,10 @@ func (m *awsRestxml_deserializeOpGetObjectTorrent) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6500,6 +7268,7 @@ func (m *awsRestxml_deserializeOpGetObjectTorrent) HandleDeserialize(ctx context return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} } + span.End() return out, metadata, err } @@ -6578,6 +7347,10 @@ func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6617,6 +7390,7 @@ func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx con } } + span.End() return out, metadata, err } @@ -6717,6 +7491,10 @@ func (m *awsRestxml_deserializeOpHeadBucket) HandleDeserialize(ctx context.Conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6728,12 +7506,12 @@ func (m *awsRestxml_deserializeOpHeadBucket) HandleDeserialize(ctx context.Conte output := &HeadBucketOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } + err = awsRestxml_deserializeOpHttpBindingsHeadBucketOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -6780,6 +7558,38 @@ func awsRestxml_deserializeOpErrorHeadBucket(response *smithyhttp.Response, meta } } +func awsRestxml_deserializeOpHttpBindingsHeadBucketOutput(v *HeadBucketOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-access-point-alias"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseBool(headerValues[0]) + if err != nil { + return err + } + v.AccessPointAlias = ptr.Bool(vv) + } + + if headerValues := response.Header.Values("x-amz-bucket-location-name"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.BucketLocationName = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-bucket-location-type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.BucketLocationType = types.LocationType(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-bucket-region"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.BucketRegion = ptr.String(headerValues[0]) + } + + return nil +} + type awsRestxml_deserializeOpHeadObject struct { } @@ -6795,6 +7605,10 @@ func (m *awsRestxml_deserializeOpHeadObject) HandleDeserialize(ctx context.Conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -6811,6 +7625,7 @@ func (m *awsRestxml_deserializeOpHeadObject) HandleDeserialize(ctx context.Conte return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -6878,7 +7693,7 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 { @@ -6927,7 +7742,7 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r if err != nil { return err } - v.ContentLength = vv + v.ContentLength = ptr.Int64(vv) } if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { @@ -6941,7 +7756,7 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r if err != nil { return err } - v.DeleteMarker = vv + v.DeleteMarker = ptr.Bool(vv) } if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { @@ -6955,15 +7770,20 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r } if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - t, err := smithytime.ParseHTTPDate(headerValues[0]) + deserOverride, err := deserializeS3Expires(headerValues[0]) if err != nil { return err } - v.Expires = ptr.Time(t) + v.Expires = deserOverride + } - if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 { + if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ExpiresString = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) t, err := smithytime.ParseHTTPDate(headerValues[0]) if err != nil { @@ -6988,7 +7808,7 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r if err != nil { return err } - v.MissingMeta = int32(vv) + v.MissingMeta = ptr.Int32(int32(vv)) } if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 { @@ -7016,7 +7836,7 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r if err != nil { return err } - v.PartsCount = int32(vv) + v.PartsCount = ptr.Int32(int32(vv)) } if headerValues := response.Header.Values("x-amz-replication-status"); len(headerValues) != 0 { @@ -7087,6 +7907,10 @@ func (m *awsRestxml_deserializeOpListBucketAnalyticsConfigurations) HandleDeseri return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -7126,6 +7950,7 @@ func (m *awsRestxml_deserializeOpListBucketAnalyticsConfigurations) HandleDeseri } } + span.End() return out, metadata, err } @@ -7223,7 +8048,7 @@ func awsRestxml_deserializeOpDocumentListBucketAnalyticsConfigurationsOutput(v * if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("NextContinuationToken", t.Name.Local): @@ -7268,6 +8093,10 @@ func (m *awsRestxml_deserializeOpListBucketIntelligentTieringConfigurations) Han return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -7307,6 +8136,7 @@ func (m *awsRestxml_deserializeOpListBucketIntelligentTieringConfigurations) Han } } + span.End() return out, metadata, err } @@ -7404,7 +8234,7 @@ func awsRestxml_deserializeOpDocumentListBucketIntelligentTieringConfigurationsO if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("NextContinuationToken", t.Name.Local): @@ -7449,6 +8279,10 @@ func (m *awsRestxml_deserializeOpListBucketInventoryConfigurations) HandleDeseri return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -7488,6 +8322,7 @@ func (m *awsRestxml_deserializeOpListBucketInventoryConfigurations) HandleDeseri } } + span.End() return out, metadata, err } @@ -7585,7 +8420,7 @@ func awsRestxml_deserializeOpDocumentListBucketInventoryConfigurationsOutput(v * if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("NextContinuationToken", t.Name.Local): @@ -7630,6 +8465,10 @@ func (m *awsRestxml_deserializeOpListBucketMetricsConfigurations) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -7669,6 +8508,7 @@ func (m *awsRestxml_deserializeOpListBucketMetricsConfigurations) HandleDeserial } } + span.End() return out, metadata, err } @@ -7760,7 +8600,7 @@ func awsRestxml_deserializeOpDocumentListBucketMetricsConfigurationsOutput(v **L if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("MetricsConfiguration", t.Name.Local): @@ -7811,6 +8651,10 @@ func (m *awsRestxml_deserializeOpListBuckets) HandleDeserialize(ctx context.Cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -7850,6 +8694,7 @@ func (m *awsRestxml_deserializeOpListBuckets) HandleDeserialize(ctx context.Cont } } + span.End() return out, metadata, err } @@ -7921,12 +8766,195 @@ func awsRestxml_deserializeOpDocumentListBucketsOutput(v **ListBucketsOutput, de return err } + case strings.EqualFold("ContinuationToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ContinuationToken = ptr.String(xtv) + } + case strings.EqualFold("Owner", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil { return err } + case strings.EqualFold("Prefix", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Prefix = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpListDirectoryBuckets struct { +} + +func (*awsRestxml_deserializeOpListDirectoryBuckets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpListDirectoryBuckets) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsRestxml_deserializeOpErrorListDirectoryBuckets(response, &metadata) + } + output := &ListDirectoryBucketsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentListDirectoryBucketsOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorListDirectoryBuckets(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 + + errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{ + UseStatusCode: true, StatusCode: response.StatusCode, + }) + if err != nil { + return err + } + if hostID := errorComponents.HostID; len(hostID) != 0 { + s3shared.SetHostIDMetadata(metadata, hostID) + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentListDirectoryBucketsOutput(v **ListDirectoryBucketsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ListDirectoryBucketsOutput + if *v == nil { + sv = &ListDirectoryBucketsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Buckets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ContinuationToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ContinuationToken = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -7956,6 +8984,10 @@ func (m *awsRestxml_deserializeOpListMultipartUploads) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -8000,6 +9032,7 @@ func (m *awsRestxml_deserializeOpListMultipartUploads) HandleDeserialize(ctx con } } + span.End() return out, metadata, err } @@ -8135,7 +9168,7 @@ func awsRestxml_deserializeOpDocumentListMultipartUploadsOutput(v **ListMultipar if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("KeyMarker", t.Name.Local): @@ -8165,7 +9198,7 @@ func awsRestxml_deserializeOpDocumentListMultipartUploadsOutput(v **ListMultipar if err != nil { return err } - sv.MaxUploads = int32(i64) + sv.MaxUploads = ptr.Int32(int32(i64)) } case strings.EqualFold("NextKeyMarker", t.Name.Local): @@ -8255,6 +9288,10 @@ func (m *awsRestxml_deserializeOpListObjects) HandleDeserialize(ctx context.Cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -8299,6 +9336,7 @@ func (m *awsRestxml_deserializeOpListObjects) HandleDeserialize(ctx context.Cont } } + span.End() return out, metadata, err } @@ -8430,7 +9468,7 @@ func awsRestxml_deserializeOpDocumentListObjectsOutput(v **ListObjectsOutput, de if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("Marker", t.Name.Local): @@ -8460,7 +9498,7 @@ func awsRestxml_deserializeOpDocumentListObjectsOutput(v **ListObjectsOutput, de if err != nil { return err } - sv.MaxKeys = int32(i64) + sv.MaxKeys = ptr.Int32(int32(i64)) } case strings.EqualFold("Name", t.Name.Local): @@ -8531,6 +9569,10 @@ func (m *awsRestxml_deserializeOpListObjectsV2) HandleDeserialize(ctx context.Co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -8575,6 +9617,7 @@ func (m *awsRestxml_deserializeOpListObjectsV2) HandleDeserialize(ctx context.Co } } + span.End() return out, metadata, err } @@ -8719,7 +9762,7 @@ func awsRestxml_deserializeOpDocumentListObjectsV2Output(v **ListObjectsV2Output if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("KeyCount", t.Name.Local): @@ -8736,7 +9779,7 @@ func awsRestxml_deserializeOpDocumentListObjectsV2Output(v **ListObjectsV2Output if err != nil { return err } - sv.KeyCount = int32(i64) + sv.KeyCount = ptr.Int32(int32(i64)) } case strings.EqualFold("MaxKeys", t.Name.Local): @@ -8753,7 +9796,7 @@ func awsRestxml_deserializeOpDocumentListObjectsV2Output(v **ListObjectsV2Output if err != nil { return err } - sv.MaxKeys = int32(i64) + sv.MaxKeys = ptr.Int32(int32(i64)) } case strings.EqualFold("Name", t.Name.Local): @@ -8837,6 +9880,10 @@ func (m *awsRestxml_deserializeOpListObjectVersions) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -8881,6 +9928,7 @@ func (m *awsRestxml_deserializeOpListObjectVersions) HandleDeserialize(ctx conte } } + span.End() return out, metadata, err } @@ -9009,7 +10057,7 @@ func awsRestxml_deserializeOpDocumentListObjectVersionsOutput(v **ListObjectVers if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("KeyMarker", t.Name.Local): @@ -9039,7 +10087,7 @@ func awsRestxml_deserializeOpDocumentListObjectVersionsOutput(v **ListObjectVers if err != nil { return err } - sv.MaxKeys = int32(i64) + sv.MaxKeys = ptr.Int32(int32(i64)) } case strings.EqualFold("Name", t.Name.Local): @@ -9142,6 +10190,10 @@ func (m *awsRestxml_deserializeOpListParts) HandleDeserialize(ctx context.Contex return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9186,6 +10238,7 @@ func (m *awsRestxml_deserializeOpListParts) HandleDeserialize(ctx context.Contex } } + span.End() return out, metadata, err } @@ -9322,7 +10375,7 @@ func awsRestxml_deserializeOpDocumentListPartsOutput(v **ListPartsOutput, decode if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("Key", t.Name.Local): @@ -9352,7 +10405,7 @@ func awsRestxml_deserializeOpDocumentListPartsOutput(v **ListPartsOutput, decode if err != nil { return err } - sv.MaxParts = int32(i64) + sv.MaxParts = ptr.Int32(int32(i64)) } case strings.EqualFold("NextPartNumberMarker", t.Name.Local): @@ -9448,6 +10501,10 @@ func (m *awsRestxml_deserializeOpPutBucketAccelerateConfiguration) HandleDeseria return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9465,6 +10522,7 @@ func (m *awsRestxml_deserializeOpPutBucketAccelerateConfiguration) HandleDeseria } } + span.End() return out, metadata, err } @@ -9523,6 +10581,10 @@ func (m *awsRestxml_deserializeOpPutBucketAcl) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9540,6 +10602,7 @@ func (m *awsRestxml_deserializeOpPutBucketAcl) HandleDeserialize(ctx context.Con } } + span.End() return out, metadata, err } @@ -9598,6 +10661,10 @@ func (m *awsRestxml_deserializeOpPutBucketAnalyticsConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9615,6 +10682,7 @@ func (m *awsRestxml_deserializeOpPutBucketAnalyticsConfiguration) HandleDeserial } } + span.End() return out, metadata, err } @@ -9673,6 +10741,10 @@ func (m *awsRestxml_deserializeOpPutBucketCors) HandleDeserialize(ctx context.Co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9690,6 +10762,7 @@ func (m *awsRestxml_deserializeOpPutBucketCors) HandleDeserialize(ctx context.Co } } + span.End() return out, metadata, err } @@ -9748,6 +10821,10 @@ func (m *awsRestxml_deserializeOpPutBucketEncryption) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9765,6 +10842,7 @@ func (m *awsRestxml_deserializeOpPutBucketEncryption) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -9823,6 +10901,10 @@ func (m *awsRestxml_deserializeOpPutBucketIntelligentTieringConfiguration) Handl return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9840,6 +10922,7 @@ func (m *awsRestxml_deserializeOpPutBucketIntelligentTieringConfiguration) Handl } } + span.End() return out, metadata, err } @@ -9898,6 +10981,10 @@ func (m *awsRestxml_deserializeOpPutBucketInventoryConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9915,6 +11002,7 @@ func (m *awsRestxml_deserializeOpPutBucketInventoryConfiguration) HandleDeserial } } + span.End() return out, metadata, err } @@ -9973,6 +11061,10 @@ func (m *awsRestxml_deserializeOpPutBucketLifecycleConfiguration) HandleDeserial return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -9984,12 +11076,12 @@ func (m *awsRestxml_deserializeOpPutBucketLifecycleConfiguration) HandleDeserial output := &PutBucketLifecycleConfigurationOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } + err = awsRestxml_deserializeOpHttpBindingsPutBucketLifecycleConfigurationOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -10033,6 +11125,19 @@ func awsRestxml_deserializeOpErrorPutBucketLifecycleConfiguration(response *smit } } +func awsRestxml_deserializeOpHttpBindingsPutBucketLifecycleConfigurationOutput(v *PutBucketLifecycleConfigurationOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("x-amz-transition-default-minimum-object-size"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.TransitionDefaultMinimumObjectSize = types.TransitionDefaultMinimumObjectSize(headerValues[0]) + } + + return nil +} + type awsRestxml_deserializeOpPutBucketLogging struct { } @@ -10048,6 +11153,10 @@ func (m *awsRestxml_deserializeOpPutBucketLogging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10065,6 +11174,7 @@ func (m *awsRestxml_deserializeOpPutBucketLogging) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -10123,6 +11233,10 @@ func (m *awsRestxml_deserializeOpPutBucketMetricsConfiguration) HandleDeserializ return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10140,6 +11254,7 @@ func (m *awsRestxml_deserializeOpPutBucketMetricsConfiguration) HandleDeserializ } } + span.End() return out, metadata, err } @@ -10198,6 +11313,10 @@ func (m *awsRestxml_deserializeOpPutBucketNotificationConfiguration) HandleDeser return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10215,6 +11334,7 @@ func (m *awsRestxml_deserializeOpPutBucketNotificationConfiguration) HandleDeser } } + span.End() return out, metadata, err } @@ -10273,6 +11393,10 @@ func (m *awsRestxml_deserializeOpPutBucketOwnershipControls) HandleDeserialize(c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10290,6 +11414,7 @@ func (m *awsRestxml_deserializeOpPutBucketOwnershipControls) HandleDeserialize(c } } + span.End() return out, metadata, err } @@ -10348,6 +11473,10 @@ func (m *awsRestxml_deserializeOpPutBucketPolicy) HandleDeserialize(ctx context. return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10365,6 +11494,7 @@ func (m *awsRestxml_deserializeOpPutBucketPolicy) HandleDeserialize(ctx context. } } + span.End() return out, metadata, err } @@ -10423,6 +11553,10 @@ func (m *awsRestxml_deserializeOpPutBucketReplication) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10440,6 +11574,7 @@ func (m *awsRestxml_deserializeOpPutBucketReplication) HandleDeserialize(ctx con } } + span.End() return out, metadata, err } @@ -10498,6 +11633,10 @@ func (m *awsRestxml_deserializeOpPutBucketRequestPayment) HandleDeserialize(ctx return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10515,6 +11654,7 @@ func (m *awsRestxml_deserializeOpPutBucketRequestPayment) HandleDeserialize(ctx } } + span.End() return out, metadata, err } @@ -10573,6 +11713,10 @@ func (m *awsRestxml_deserializeOpPutBucketTagging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10590,6 +11734,7 @@ func (m *awsRestxml_deserializeOpPutBucketTagging) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -10648,6 +11793,10 @@ func (m *awsRestxml_deserializeOpPutBucketVersioning) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10665,6 +11814,7 @@ func (m *awsRestxml_deserializeOpPutBucketVersioning) HandleDeserialize(ctx cont } } + span.End() return out, metadata, err } @@ -10723,6 +11873,10 @@ func (m *awsRestxml_deserializeOpPutBucketWebsite) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10740,6 +11894,7 @@ func (m *awsRestxml_deserializeOpPutBucketWebsite) HandleDeserialize(ctx context } } + span.End() return out, metadata, err } @@ -10798,6 +11953,10 @@ func (m *awsRestxml_deserializeOpPutObject) HandleDeserialize(ctx context.Contex return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10814,6 +11973,7 @@ func (m *awsRestxml_deserializeOpPutObject) HandleDeserialize(ctx context.Contex return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -10847,6 +12007,18 @@ func awsRestxml_deserializeOpErrorPutObject(response *smithyhttp.Response, metad } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("EncryptionTypeMismatch", errorCode): + return awsRestxml_deserializeErrorEncryptionTypeMismatch(response, errorBody) + + case strings.EqualFold("InvalidRequest", errorCode): + return awsRestxml_deserializeErrorInvalidRequest(response, errorBody) + + case strings.EqualFold("InvalidWriteOffset", errorCode): + return awsRestxml_deserializeErrorInvalidWriteOffset(response, errorBody) + + case strings.EqualFold("TooManyParts", errorCode): + return awsRestxml_deserializeErrorTooManyParts(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10868,7 +12040,7 @@ func awsRestxml_deserializeOpHttpBindingsPutObjectOutput(v *PutObjectOutput, res if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 { @@ -10911,6 +12083,15 @@ func awsRestxml_deserializeOpHttpBindingsPutObjectOutput(v *PutObjectOutput, res v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0]) } + if headerValues := response.Header.Values("x-amz-object-size"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 64) + if err != nil { + return err + } + v.Size = ptr.Int64(vv) + } + if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.SSECustomerAlgorithm = ptr.String(headerValues[0]) @@ -10954,6 +12135,10 @@ func (m *awsRestxml_deserializeOpPutObjectAcl) HandleDeserialize(ctx context.Con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -10970,6 +12155,7 @@ func (m *awsRestxml_deserializeOpPutObjectAcl) HandleDeserialize(ctx context.Con return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11044,6 +12230,10 @@ func (m *awsRestxml_deserializeOpPutObjectLegalHold) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11060,6 +12250,7 @@ func (m *awsRestxml_deserializeOpPutObjectLegalHold) HandleDeserialize(ctx conte return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11131,6 +12322,10 @@ func (m *awsRestxml_deserializeOpPutObjectLockConfiguration) HandleDeserialize(c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11147,6 +12342,7 @@ func (m *awsRestxml_deserializeOpPutObjectLockConfiguration) HandleDeserialize(c return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11218,6 +12414,10 @@ func (m *awsRestxml_deserializeOpPutObjectRetention) HandleDeserialize(ctx conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11234,6 +12434,7 @@ func (m *awsRestxml_deserializeOpPutObjectRetention) HandleDeserialize(ctx conte return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11305,6 +12506,10 @@ func (m *awsRestxml_deserializeOpPutObjectTagging) HandleDeserialize(ctx context return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11321,6 +12526,7 @@ func (m *awsRestxml_deserializeOpPutObjectTagging) HandleDeserialize(ctx context return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11392,6 +12598,10 @@ func (m *awsRestxml_deserializeOpPutPublicAccessBlock) HandleDeserialize(ctx con return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11409,6 +12619,7 @@ func (m *awsRestxml_deserializeOpPutPublicAccessBlock) HandleDeserialize(ctx con } } + span.End() return out, metadata, err } @@ -11467,6 +12678,10 @@ func (m *awsRestxml_deserializeOpRestoreObject) HandleDeserialize(ctx context.Co return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11483,6 +12698,7 @@ func (m *awsRestxml_deserializeOpRestoreObject) HandleDeserialize(ctx context.Co return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11562,6 +12778,10 @@ func (m *awsRestxml_deserializeOpSelectObjectContent) HandleDeserialize(ctx cont return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11573,6 +12793,7 @@ func (m *awsRestxml_deserializeOpSelectObjectContent) HandleDeserialize(ctx cont output := &SelectObjectContentOutput{} out.Result = output + span.End() return out, metadata, err } @@ -11631,6 +12852,10 @@ func (m *awsRestxml_deserializeOpUploadPart) HandleDeserialize(ctx context.Conte return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11647,6 +12872,7 @@ func (m *awsRestxml_deserializeOpUploadPart) HandleDeserialize(ctx context.Conte return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + span.End() return out, metadata, err } @@ -11701,7 +12927,7 @@ func awsRestxml_deserializeOpHttpBindingsUploadPartOutput(v *UploadPartOutput, r if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 { @@ -11772,6 +12998,10 @@ func (m *awsRestxml_deserializeOpUploadPartCopy) HandleDeserialize(ctx context.C return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11816,6 +13046,7 @@ func (m *awsRestxml_deserializeOpUploadPartCopy) HandleDeserialize(ctx context.C } } + span.End() return out, metadata, err } @@ -11870,7 +13101,7 @@ func awsRestxml_deserializeOpHttpBindingsUploadPartCopyOutput(v *UploadPartCopyO if err != nil { return err } - v.BucketKeyEnabled = vv + v.BucketKeyEnabled = ptr.Bool(vv) } if headerValues := response.Header.Values("x-amz-copy-source-version-id"); len(headerValues) != 0 { @@ -11962,6 +13193,10 @@ func (m *awsRestxml_deserializeOpWriteGetObjectResponse) HandleDeserialize(ctx c return out, metadata, err } + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} @@ -11979,6 +13214,7 @@ func (m *awsRestxml_deserializeOpWriteGetObjectResponse) HandleDeserialize(ctx c } } + span.End() return out, metadata, err } @@ -12392,7 +13628,7 @@ func awsRestxml_deserializeDocumentProgress(v **types.Progress, decoder smithyxm if err != nil { return err } - sv.BytesProcessed = i64 + sv.BytesProcessed = ptr.Int64(i64) } case strings.EqualFold("BytesReturned", t.Name.Local): @@ -12409,7 +13645,7 @@ func awsRestxml_deserializeDocumentProgress(v **types.Progress, decoder smithyxm if err != nil { return err } - sv.BytesReturned = i64 + sv.BytesReturned = ptr.Int64(i64) } case strings.EqualFold("BytesScanned", t.Name.Local): @@ -12426,7 +13662,7 @@ func awsRestxml_deserializeDocumentProgress(v **types.Progress, decoder smithyxm if err != nil { return err } - sv.BytesScanned = i64 + sv.BytesScanned = ptr.Int64(i64) } default: @@ -12479,7 +13715,7 @@ func awsRestxml_deserializeDocumentStats(v **types.Stats, decoder smithyxml.Node if err != nil { return err } - sv.BytesProcessed = i64 + sv.BytesProcessed = ptr.Int64(i64) } case strings.EqualFold("BytesReturned", t.Name.Local): @@ -12496,7 +13732,7 @@ func awsRestxml_deserializeDocumentStats(v **types.Stats, decoder smithyxml.Node if err != nil { return err } - sv.BytesReturned = i64 + sv.BytesReturned = ptr.Int64(i64) } case strings.EqualFold("BytesScanned", t.Name.Local): @@ -12513,7 +13749,7 @@ func awsRestxml_deserializeDocumentStats(v **types.Stats, decoder smithyxml.Node if err != nil { return err } - sv.BytesScanned = i64 + sv.BytesScanned = ptr.Int64(i64) } default: @@ -12540,6 +13776,11 @@ func awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response *smithyhttp.Res return output } +func awsRestxml_deserializeErrorEncryptionTypeMismatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EncryptionTypeMismatch{} + return output +} + func awsRestxml_deserializeErrorInvalidObjectState(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidObjectState{} var buff [1024]byte @@ -12573,6 +13814,16 @@ func awsRestxml_deserializeErrorInvalidObjectState(response *smithyhttp.Response return output } +func awsRestxml_deserializeErrorInvalidRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequest{} + return output +} + +func awsRestxml_deserializeErrorInvalidWriteOffset(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidWriteOffset{} + return output +} + func awsRestxml_deserializeErrorNoSuchBucket(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NoSuchBucket{} return output @@ -12603,6 +13854,11 @@ func awsRestxml_deserializeErrorObjectNotInActiveTierError(response *smithyhttp. return output } +func awsRestxml_deserializeErrorTooManyParts(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyParts{} + return output +} + func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12639,7 +13895,7 @@ func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.Abor if err != nil { return err } - sv.DaysAfterInitiation = int32(i64) + sv.DaysAfterInitiation = ptr.Int32(int32(i64)) } default: @@ -13352,6 +14608,19 @@ func awsRestxml_deserializeDocumentBucket(v **types.Bucket, decoder smithyxml.No originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("BucketRegion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BucketRegion = ptr.String(xtv) + } + case strings.EqualFold("CreationDate", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -14192,7 +15461,7 @@ func awsRestxml_deserializeDocumentCORSRule(v **types.CORSRule, decoder smithyxm if err != nil { return err } - sv.MaxAgeSeconds = int32(i64) + sv.MaxAgeSeconds = ptr.Int32(int32(i64)) } default: @@ -14313,7 +15582,7 @@ func awsRestxml_deserializeDocumentDefaultRetention(v **types.DefaultRetention, if err != nil { return err } - sv.Days = int32(i64) + sv.Days = ptr.Int32(int32(i64)) } case strings.EqualFold("Mode", t.Name.Local): @@ -14343,7 +15612,7 @@ func awsRestxml_deserializeDocumentDefaultRetention(v **types.DefaultRetention, if err != nil { return err } - sv.Years = int32(i64) + sv.Years = ptr.Int32(int32(i64)) } default: @@ -14395,7 +15664,7 @@ func awsRestxml_deserializeDocumentDeletedObject(v **types.DeletedObject, decode if err != nil { return fmt.Errorf("expected DeleteMarker to be of type *bool, got %T instead", val) } - sv.DeleteMarker = xtv + sv.DeleteMarker = ptr.Bool(xtv) } case strings.EqualFold("DeleteMarkerVersionId", t.Name.Local): @@ -14554,7 +15823,7 @@ func awsRestxml_deserializeDocumentDeleteMarkerEntry(v **types.DeleteMarkerEntry if err != nil { return fmt.Errorf("expected IsLatest to be of type *bool, got %T instead", val) } - sv.IsLatest = xtv + sv.IsLatest = ptr.Bool(xtv) } case strings.EqualFold("Key", t.Name.Local): @@ -14885,6 +16154,42 @@ func awsRestxml_deserializeDocumentEncryptionConfiguration(v **types.EncryptionC return nil } +func awsRestxml_deserializeDocumentEncryptionTypeMismatch(v **types.EncryptionTypeMismatch, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EncryptionTypeMismatch + if *v == nil { + sv = &types.EncryptionTypeMismatch{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentError(v **types.Error, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14973,7 +16278,69 @@ func awsRestxml_deserializeDocumentError(v **types.Error, decoder smithyxml.Node return nil } -func awsRestxml_deserializeDocumentErrorDocument(v **types.ErrorDocument, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentErrorDetails(v **types.ErrorDetails, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ErrorDetails + if *v == nil { + sv = &types.ErrorDetails{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ErrorCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ErrorCode = ptr.String(xtv) + } + + case strings.EqualFold("ErrorMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ErrorMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentErrorDocument(v **types.ErrorDocument, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15465,6 +16832,67 @@ func awsRestxml_deserializeDocumentFilterRuleListUnwrapped(v *[]types.FilterRule *v = sv return nil } +func awsRestxml_deserializeDocumentGetBucketMetadataTableConfigurationResult(v **types.GetBucketMetadataTableConfigurationResult, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.GetBucketMetadataTableConfigurationResult + if *v == nil { + sv = &types.GetBucketMetadataTableConfigurationResult{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Error", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentErrorDetails(&sv.Error, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MetadataTableConfigurationResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentMetadataTableConfigurationResult(&sv.MetadataTableConfigurationResult, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentGetObjectAttributesParts(v **types.GetObjectAttributesParts, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15500,7 +16928,7 @@ func awsRestxml_deserializeDocumentGetObjectAttributesParts(v **types.GetObjectA if err != nil { return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val) } - sv.IsTruncated = xtv + sv.IsTruncated = ptr.Bool(xtv) } case strings.EqualFold("MaxParts", t.Name.Local): @@ -15517,7 +16945,7 @@ func awsRestxml_deserializeDocumentGetObjectAttributesParts(v **types.GetObjectA if err != nil { return err } - sv.MaxParts = int32(i64) + sv.MaxParts = ptr.Int32(int32(i64)) } case strings.EqualFold("NextPartNumberMarker", t.Name.Local): @@ -15566,7 +16994,7 @@ func awsRestxml_deserializeDocumentGetObjectAttributesParts(v **types.GetObjectA if err != nil { return err } - sv.TotalPartsCount = int32(i64) + sv.TotalPartsCount = ptr.Int32(int32(i64)) } default: @@ -16240,6 +17668,78 @@ func awsRestxml_deserializeDocumentInvalidObjectState(v **types.InvalidObjectSta return nil } +func awsRestxml_deserializeDocumentInvalidRequest(v **types.InvalidRequest, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidRequest + if *v == nil { + sv = &types.InvalidRequest{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentInvalidWriteOffset(v **types.InvalidWriteOffset, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidWriteOffset + if *v == nil { + sv = &types.InvalidWriteOffset{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentInventoryConfiguration(v **types.InventoryConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16313,7 +17813,7 @@ func awsRestxml_deserializeDocumentInventoryConfiguration(v **types.InventoryCon if err != nil { return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val) } - sv.IsEnabled = xtv + sv.IsEnabled = ptr.Bool(xtv) } case strings.EqualFold("OptionalFields", t.Name.Local): @@ -16967,7 +18467,7 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira if err != nil { return err } - sv.Days = int32(i64) + sv.Days = ptr.Int32(int32(i64)) } case strings.EqualFold("ExpiredObjectDeleteMarker", t.Name.Local): @@ -16983,7 +18483,7 @@ func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpira if err != nil { return fmt.Errorf("expected ExpiredObjectDeleteMarker to be of type *bool, got %T instead", val) } - sv.ExpiredObjectDeleteMarker = xtv + sv.ExpiredObjectDeleteMarker = ptr.Bool(xtv) } default: @@ -17147,7 +18647,7 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR if err != nil { return err } - sv.ObjectSizeGreaterThan = i64 + sv.ObjectSizeGreaterThan = ptr.Int64(i64) } case strings.EqualFold("ObjectSizeLessThan", t.Name.Local): @@ -17164,7 +18664,7 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR if err != nil { return err } - sv.ObjectSizeLessThan = i64 + sv.ObjectSizeLessThan = ptr.Int64(i64) } case strings.EqualFold("Prefix", t.Name.Local): @@ -17200,12 +18700,17 @@ func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleR return nil } -func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentLifecycleRuleFilter(v **types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var uv types.LifecycleRuleFilter - var memberFound bool + var sv *types.LifecycleRuleFilter + if *v == nil { + sv = &types.LifecycleRuleFilter{} + } else { + sv = *v + } + for { t, done, err := decoder.Token() if err != nil { @@ -17214,27 +18719,16 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFil if done { break } - if memberFound { - if err = decoder.Decoder.Skip(); err != nil { - return err - } - } originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { case strings.EqualFold("And", t.Name.Local): - var mv types.LifecycleRuleAndOperator nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&sv.And, nodeDecoder); err != nil { return err } - mv = *destAddr - uv = &types.LifecycleRuleFilterMemberAnd{Value: mv} - memberFound = true case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local): - var mv int64 val, err := decoder.Value() if err != nil { return err @@ -17248,13 +18742,10 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFil if err != nil { return err } - mv = i64 + sv.ObjectSizeGreaterThan = ptr.Int64(i64) } - uv = &types.LifecycleRuleFilterMemberObjectSizeGreaterThan{Value: mv} - memberFound = true case strings.EqualFold("ObjectSizeLessThan", t.Name.Local): - var mv int64 val, err := decoder.Value() if err != nil { return err @@ -17268,13 +18759,10 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFil if err != nil { return err } - mv = i64 + sv.ObjectSizeLessThan = ptr.Int64(i64) } - uv = &types.LifecycleRuleFilterMemberObjectSizeLessThan{Value: mv} - memberFound = true case strings.EqualFold("Prefix", t.Name.Local): - var mv string val, err := decoder.Value() if err != nil { return err @@ -17284,30 +18772,26 @@ func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFil } { xtv := string(val) - mv = xtv + sv.Prefix = ptr.String(xtv) } - uv = &types.LifecycleRuleFilterMemberPrefix{Value: mv} - memberFound = true case strings.EqualFold("Tag", t.Name.Local): - var mv types.Tag nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTag(&sv.Tag, nodeDecoder); err != nil { return err } - mv = *destAddr - uv = &types.LifecycleRuleFilterMemberTag{Value: mv} - memberFound = true default: - uv = &types.UnknownUnionMember{Tag: t.Name.Local} - memberFound = true + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } } decoder = originalDecoder } - *v = uv + *v = sv return nil } @@ -17420,6 +18904,12 @@ func awsRestxml_deserializeDocumentLoggingEnabled(v **types.LoggingEnabled, deco return err } + case strings.EqualFold("TargetObjectKeyFormat", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTargetObjectKeyFormat(&sv.TargetObjectKeyFormat, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("TargetPrefix", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -17447,6 +18937,48 @@ func awsRestxml_deserializeDocumentLoggingEnabled(v **types.LoggingEnabled, deco return nil } +func awsRestxml_deserializeDocumentMetadataTableConfigurationResult(v **types.MetadataTableConfigurationResult, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MetadataTableConfigurationResult + if *v == nil { + sv = &types.MetadataTableConfigurationResult{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("S3TablesDestinationResult", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentS3TablesDestinationResult(&sv.S3TablesDestinationResult, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentMetrics(v **types.Metrics, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18001,7 +19533,7 @@ func awsRestxml_deserializeDocumentNoncurrentVersionExpiration(v **types.Noncurr if err != nil { return err } - sv.NewerNoncurrentVersions = int32(i64) + sv.NewerNoncurrentVersions = ptr.Int32(int32(i64)) } case strings.EqualFold("NoncurrentDays", t.Name.Local): @@ -18018,7 +19550,7 @@ func awsRestxml_deserializeDocumentNoncurrentVersionExpiration(v **types.Noncurr if err != nil { return err } - sv.NoncurrentDays = int32(i64) + sv.NoncurrentDays = ptr.Int32(int32(i64)) } default: @@ -18071,7 +19603,7 @@ func awsRestxml_deserializeDocumentNoncurrentVersionTransition(v **types.Noncurr if err != nil { return err } - sv.NewerNoncurrentVersions = int32(i64) + sv.NewerNoncurrentVersions = ptr.Int32(int32(i64)) } case strings.EqualFold("NoncurrentDays", t.Name.Local): @@ -18088,7 +19620,7 @@ func awsRestxml_deserializeDocumentNoncurrentVersionTransition(v **types.Noncurr if err != nil { return err } - sv.NoncurrentDays = int32(i64) + sv.NoncurrentDays = ptr.Int32(int32(i64)) } case strings.EqualFold("StorageClass", t.Name.Local): @@ -18469,7 +20001,7 @@ func awsRestxml_deserializeDocumentObject(v **types.Object, decoder smithyxml.No if err != nil { return err } - sv.Size = i64 + sv.Size = ptr.Int64(i64) } case strings.EqualFold("StorageClass", t.Name.Local): @@ -18939,7 +20471,7 @@ func awsRestxml_deserializeDocumentObjectPart(v **types.ObjectPart, decoder smit if err != nil { return err } - sv.PartNumber = int32(i64) + sv.PartNumber = ptr.Int32(int32(i64)) } case strings.EqualFold("Size", t.Name.Local): @@ -18956,7 +20488,7 @@ func awsRestxml_deserializeDocumentObjectPart(v **types.ObjectPart, decoder smit if err != nil { return err } - sv.Size = i64 + sv.Size = ptr.Int64(i64) } default: @@ -19027,7 +20559,7 @@ func awsRestxml_deserializeDocumentObjectVersion(v **types.ObjectVersion, decode if err != nil { return fmt.Errorf("expected IsLatest to be of type *bool, got %T instead", val) } - sv.IsLatest = xtv + sv.IsLatest = ptr.Bool(xtv) } case strings.EqualFold("Key", t.Name.Local): @@ -19086,7 +20618,7 @@ func awsRestxml_deserializeDocumentObjectVersion(v **types.ObjectVersion, decode if err != nil { return err } - sv.Size = i64 + sv.Size = ptr.Int64(i64) } case strings.EqualFold("StorageClass", t.Name.Local): @@ -19536,7 +21068,7 @@ func awsRestxml_deserializeDocumentPart(v **types.Part, decoder smithyxml.NodeDe if err != nil { return err } - sv.PartNumber = int32(i64) + sv.PartNumber = ptr.Int32(int32(i64)) } case strings.EqualFold("Size", t.Name.Local): @@ -19553,7 +21085,7 @@ func awsRestxml_deserializeDocumentPart(v **types.Part, decoder smithyxml.NodeDe if err != nil { return err } - sv.Size = i64 + sv.Size = ptr.Int64(i64) } default: @@ -19570,18 +21102,67 @@ func awsRestxml_deserializeDocumentPart(v **types.Part, decoder smithyxml.NodeDe return nil } -func awsRestxml_deserializeDocumentParts(v *[]types.Part, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentPartitionedPrefix(v **types.PartitionedPrefix, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.Part + var sv *types.PartitionedPrefix if *v == nil { - sv = make([]types.Part, 0) + sv = &types.PartitionedPrefix{} } else { sv = *v } - originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("PartitionDateSource", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.PartitionDateSource = types.PartitionDateSource(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentParts(v *[]types.Part, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Part + if *v == nil { + sv = make([]types.Part, 0) + } else { + sv = *v + } + + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -19741,7 +21322,7 @@ func awsRestxml_deserializeDocumentPolicyStatus(v **types.PolicyStatus, decoder if err != nil { return fmt.Errorf("expected IsPublic to be of type *bool, got %T instead", val) } - sv.IsPublic = xtv + sv.IsPublic = ptr.Bool(xtv) } default: @@ -19793,7 +21374,7 @@ func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.Publ if err != nil { return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val) } - sv.BlockPublicAcls = xtv + sv.BlockPublicAcls = ptr.Bool(xtv) } case strings.EqualFold("BlockPublicPolicy", t.Name.Local): @@ -19809,7 +21390,7 @@ func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.Publ if err != nil { return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val) } - sv.BlockPublicPolicy = xtv + sv.BlockPublicPolicy = ptr.Bool(xtv) } case strings.EqualFold("IgnorePublicAcls", t.Name.Local): @@ -19825,7 +21406,7 @@ func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.Publ if err != nil { return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val) } - sv.IgnorePublicAcls = xtv + sv.IgnorePublicAcls = ptr.Bool(xtv) } case strings.EqualFold("RestrictPublicBuckets", t.Name.Local): @@ -19841,7 +21422,7 @@ func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.Publ if err != nil { return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val) } - sv.RestrictPublicBuckets = xtv + sv.RestrictPublicBuckets = ptr.Bool(xtv) } default: @@ -20353,7 +21934,7 @@ func awsRestxml_deserializeDocumentReplicationRule(v **types.ReplicationRule, de if err != nil { return err } - sv.Priority = int32(i64) + sv.Priority = ptr.Int32(int32(i64)) } case strings.EqualFold("SourceSelectionCriteria", t.Name.Local): @@ -20444,12 +22025,17 @@ func awsRestxml_deserializeDocumentReplicationRuleAndOperator(v **types.Replicat return nil } -func awsRestxml_deserializeDocumentReplicationRuleFilter(v *types.ReplicationRuleFilter, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentReplicationRuleFilter(v **types.ReplicationRuleFilter, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var uv types.ReplicationRuleFilter - var memberFound bool + var sv *types.ReplicationRuleFilter + if *v == nil { + sv = &types.ReplicationRuleFilter{} + } else { + sv = *v + } + for { t, done, err := decoder.Token() if err != nil { @@ -20458,27 +22044,16 @@ func awsRestxml_deserializeDocumentReplicationRuleFilter(v *types.ReplicationRul if done { break } - if memberFound { - if err = decoder.Decoder.Skip(); err != nil { - return err - } - } originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { case strings.EqualFold("And", t.Name.Local): - var mv types.ReplicationRuleAndOperator nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentReplicationRuleAndOperator(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentReplicationRuleAndOperator(&sv.And, nodeDecoder); err != nil { return err } - mv = *destAddr - uv = &types.ReplicationRuleFilterMemberAnd{Value: mv} - memberFound = true case strings.EqualFold("Prefix", t.Name.Local): - var mv string val, err := decoder.Value() if err != nil { return err @@ -20488,30 +22063,26 @@ func awsRestxml_deserializeDocumentReplicationRuleFilter(v *types.ReplicationRul } { xtv := string(val) - mv = xtv + sv.Prefix = ptr.String(xtv) } - uv = &types.ReplicationRuleFilterMemberPrefix{Value: mv} - memberFound = true case strings.EqualFold("Tag", t.Name.Local): - var mv types.Tag nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTag(&sv.Tag, nodeDecoder); err != nil { return err } - mv = *destAddr - uv = &types.ReplicationRuleFilterMemberTag{Value: mv} - memberFound = true default: - uv = &types.UnknownUnionMember{Tag: t.Name.Local} - memberFound = true + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } } decoder = originalDecoder } - *v = uv + *v = sv return nil } @@ -20674,7 +22245,7 @@ func awsRestxml_deserializeDocumentReplicationTimeValue(v **types.ReplicationTim if err != nil { return err } - sv.Minutes = int32(i64) + sv.Minutes = ptr.Int32(int32(i64)) } default: @@ -20726,7 +22297,7 @@ func awsRestxml_deserializeDocumentRestoreStatus(v **types.RestoreStatus, decode if err != nil { return fmt.Errorf("expected IsRestoreInProgress to be of type *bool, got %T instead", val) } - sv.IsRestoreInProgress = xtv + sv.IsRestoreInProgress = ptr.Bool(xtv) } case strings.EqualFold("RestoreExpiryDate", t.Name.Local): @@ -20918,6 +22489,94 @@ func awsRestxml_deserializeDocumentS3KeyFilter(v **types.S3KeyFilter, decoder sm return nil } +func awsRestxml_deserializeDocumentS3TablesDestinationResult(v **types.S3TablesDestinationResult, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.S3TablesDestinationResult + if *v == nil { + sv = &types.S3TablesDestinationResult{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TableArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TableArn = ptr.String(xtv) + } + + case strings.EqualFold("TableBucketArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TableBucketArn = ptr.String(xtv) + } + + case strings.EqualFold("TableName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TableName = ptr.String(xtv) + } + + case strings.EqualFold("TableNamespace", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TableNamespace = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentServerSideEncryptionByDefault(v **types.ServerSideEncryptionByDefault, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21063,7 +22722,7 @@ func awsRestxml_deserializeDocumentServerSideEncryptionRule(v **types.ServerSide if err != nil { return fmt.Errorf("expected BucketKeyEnabled to be of type *bool, got %T instead", val) } - sv.BucketKeyEnabled = xtv + sv.BucketKeyEnabled = ptr.Bool(xtv) } default: @@ -21148,6 +22807,134 @@ func awsRestxml_deserializeDocumentServerSideEncryptionRulesUnwrapped(v *[]types *v = sv return nil } +func awsRestxml_deserializeDocumentSessionCredentials(v **types.SessionCredentials, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SessionCredentials + if *v == nil { + sv = &types.SessionCredentials{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AccessKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Expiration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Expiration = ptr.Time(t) + } + + case strings.EqualFold("SecretAccessKey", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretAccessKey = ptr.String(xtv) + } + + case strings.EqualFold("SessionToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentSimplePrefix(v **types.SimplePrefix, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SimplePrefix + if *v == nil { + sv = &types.SimplePrefix{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentSourceSelectionCriteria(v **types.SourceSelectionCriteria, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21680,6 +23467,54 @@ func awsRestxml_deserializeDocumentTargetGrantsUnwrapped(v *[]types.TargetGrant, *v = sv return nil } +func awsRestxml_deserializeDocumentTargetObjectKeyFormat(v **types.TargetObjectKeyFormat, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TargetObjectKeyFormat + if *v == nil { + sv = &types.TargetObjectKeyFormat{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("PartitionedPrefix", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentPartitionedPrefix(&sv.PartitionedPrefix, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SimplePrefix", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSimplePrefix(&sv.SimplePrefix, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentTiering(v **types.Tiering, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21729,7 +23564,7 @@ func awsRestxml_deserializeDocumentTiering(v **types.Tiering, decoder smithyxml. if err != nil { return err } - sv.Days = int32(i64) + sv.Days = ptr.Int32(int32(i64)) } default: @@ -21814,6 +23649,42 @@ func awsRestxml_deserializeDocumentTieringListUnwrapped(v *[]types.Tiering, deco *v = sv return nil } +func awsRestxml_deserializeDocumentTooManyParts(v **types.TooManyParts, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyParts + if *v == nil { + sv = &types.TooManyParts{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentTopicConfiguration(v **types.TopicConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22009,7 +23880,7 @@ func awsRestxml_deserializeDocumentTransition(v **types.Transition, decoder smit if err != nil { return err } - sv.Days = int32(i64) + sv.Days = ptr.Int32(int32(i64)) } case strings.EqualFold("StorageClass", t.Name.Local): diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoint_auth_resolver.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoint_auth_resolver.go new file mode 100644 index 00000000..bb5f4cf4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoint_auth_resolver.go @@ -0,0 +1,126 @@ +package s3 + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + smithyauth "github.com/aws/smithy-go/auth" +) + +type endpointAuthResolver struct { + EndpointResolver EndpointResolverV2 +} + +var _ AuthSchemeResolver = (*endpointAuthResolver)(nil) + +func (r *endpointAuthResolver) ResolveAuthSchemes( + ctx context.Context, params *AuthResolverParameters, +) ( + []*smithyauth.Option, error, +) { + if params.endpointParams.Region == nil { + // #2502: We're correcting the endpoint binding behavior to treat empty + // Region as "unset" (nil), but auth resolution technically doesn't + // care and someone could be using V1 or non-default V2 endpoint + // resolution, both of which would bypass the required-region check. + // They shouldn't be broken because the region is technically required + // by this service's endpoint-based auth resolver, so we stub it here. + params.endpointParams.Region = aws.String("") + } + + opts, err := r.resolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + // canonicalize sigv4-s3express ID + for _, opt := range opts { + if opt.SchemeID == "sigv4-s3express" { + opt.SchemeID = "com.amazonaws.s3#sigv4express" + } + } + + // preserve pre-SRA behavior where everything technically had anonymous + return append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }), nil +} + +func (r *endpointAuthResolver) resolveAuthSchemes( + ctx context.Context, params *AuthResolverParameters, +) ( + []*smithyauth.Option, error, +) { + baseOpts, err := (&defaultAuthSchemeResolver{}).ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, fmt.Errorf("get base options: %w", err) + } + + endpt, err := r.EndpointResolver.ResolveEndpoint(ctx, *params.endpointParams) + if err != nil { + return nil, fmt.Errorf("resolve endpoint: %w", err) + } + + endptOpts, ok := smithyauth.GetAuthOptions(&endpt.Properties) + if !ok { + return baseOpts, nil + } + + // the list of options from the endpoint is authoritative, however, the + // modeled options have some properties that the endpoint ones don't, so we + // start from the latter and merge in + for _, endptOpt := range endptOpts { + if baseOpt := findScheme(baseOpts, endptOpt.SchemeID); baseOpt != nil { + rebaseProps(endptOpt, baseOpt) + } + } + + return endptOpts, nil +} + +// rebase the properties of dst, taking src as the base and overlaying those +// from dst +func rebaseProps(dst, src *smithyauth.Option) { + iprops, sprops := src.IdentityProperties, src.SignerProperties + + iprops.SetAll(&dst.IdentityProperties) + sprops.SetAll(&dst.SignerProperties) + + dst.IdentityProperties = iprops + dst.SignerProperties = sprops +} + +func findScheme(opts []*smithyauth.Option, schemeID string) *smithyauth.Option { + for _, opt := range opts { + if opt.SchemeID == schemeID { + return opt + } + } + return nil +} + +func finalizeServiceEndpointAuthResolver(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &endpointAuthResolver{ + EndpointResolver: options.EndpointResolverV2, + } +} + +func finalizeOperationEndpointAuthResolver(options *Options) { + resolver, ok := options.AuthSchemeResolver.(*endpointAuthResolver) + if !ok { + return + } + + if resolver.EndpointResolver == options.EndpointResolverV2 { + return + } + + options.AuthSchemeResolver = &endpointAuthResolver{ + EndpointResolver: options.EndpointResolverV2, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go index 7d57e70d..1a4af282 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/endpoints.go @@ -9,13 +9,18 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" internalendpoints "github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints" smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" "github.com/aws/smithy-go/endpoints/private/rulesfn" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" @@ -224,94 +229,11 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) { } } -// Utility function to aid with translating pseudo-regions to classical regions -// with the appropriate setting indicated by the pseudo-region -func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(pr, fipsInfix) || - strings.Contains(pr, fipsPrefix) || - strings.Contains(pr, fipsSuffix) { - region = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - pr, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - fips = aws.FIPSEndpointStateEnabled - } else { - region = pr +func bindRegion(region string) *string { + if region == "" { + return nil } - - return region, fips -} - -// builtInParameterResolver is the interface responsible for resolving BuiltIn -// values during the sourcing of EndpointParameters -type builtInParameterResolver interface { - ResolveBuiltIns(*EndpointParameters) error -} - -// builtInResolver resolves modeled BuiltIn values using only the members defined -// below. -type builtInResolver struct { - // The AWS region used to dispatch the request. - Region string - - // Sourced BuiltIn value in a historical enabled or disabled state. - UseFIPS aws.FIPSEndpointState - - // Sourced BuiltIn value in a historical enabled or disabled state. - UseDualStack aws.DualStackEndpointState - - // Base endpoint that can potentially be modified during Endpoint resolution. - Endpoint *string - - // When true, force a path-style endpoint to be used where the bucket name is part - // of the path. - ForcePathStyle bool - - // When true, use S3 Accelerate. NOTE: Not all regions support S3 accelerate. - Accelerate bool - - // Whether the global endpoint should be used, rather then the regional endpoint - // for us-east-1. - UseGlobalEndpoint bool - - // Whether multi-region access points (MRAP) should be disabled. - DisableMultiRegionAccessPoints bool - - // When an Access Point ARN is provided and this flag is enabled, the SDK MUST use - // the ARN's region when constructing the endpoint instead of the client's - // configured region. - UseArnRegion bool -} - -// Invoked at runtime to resolve BuiltIn Values. Only resolution code specific to -// each BuiltIn value is generated. -func (b *builtInResolver) ResolveBuiltIns(params *EndpointParameters) error { - - region, _ := mapPseudoRegion(b.Region) - if len(region) == 0 { - return fmt.Errorf("Could not resolve AWS::Region") - } else { - params.Region = aws.String(region) - } - if b.UseFIPS == aws.FIPSEndpointStateEnabled { - params.UseFIPS = aws.Bool(true) - } else { - params.UseFIPS = aws.Bool(false) - } - if b.UseDualStack == aws.DualStackEndpointStateEnabled { - params.UseDualStack = aws.Bool(true) - } else { - params.UseDualStack = aws.Bool(false) - } - params.Endpoint = b.Endpoint - params.ForcePathStyle = aws.Bool(b.ForcePathStyle) - params.Accelerate = aws.Bool(b.Accelerate) - params.UseGlobalEndpoint = aws.Bool(b.UseGlobalEndpoint) - params.DisableMultiRegionAccessPoints = aws.Bool(b.DisableMultiRegionAccessPoints) - params.UseArnRegion = aws.Bool(b.UseArnRegion) - return nil + return aws.String(endpoints.MapFIPSRegion(region)) } // EndpointParameters provides the parameters that influence how endpoints are @@ -391,6 +313,27 @@ type EndpointParameters struct { // Parameter is required. UseObjectLambdaEndpoint *bool + // The S3 Key used to send the request. This is an optional parameter that will be + // set automatically for operations that are scoped to an S3 Key. + // + // Parameter is + // required. + Key *string + + // The S3 Prefix used to send the request. This is an optional parameter that will + // be set automatically for operations that are scoped to an S3 Prefix. + // + // Parameter + // is required. + Prefix *string + + // The Copy Source used for Copy Object request. This is an optional parameter that + // will be set automatically for operations that are scoped to Copy + // Source. + // + // Parameter is required. + CopySource *string + // Internal parameter to disable Access Point Buckets // // Parameter is required. @@ -412,6 +355,18 @@ type EndpointParameters struct { // // AWS::S3::UseArnRegion UseArnRegion *bool + + // Internal parameter to indicate whether S3Express operation should use control + // plane, (ex. CreateBucket) + // + // Parameter is required. + UseS3ExpressControlEndpoint *bool + + // Parameter to indicate whether S3Express session auth should be + // disabled + // + // Parameter is required. + DisableS3ExpressSessionAuth *bool } // ValidateRequired validates required parameters are set. @@ -466,81 +421,1466 @@ func (p EndpointParameters) WithDefaults() EndpointParameters { p.UseFIPS = ptr.Bool(false) } - if p.UseGlobalEndpoint == nil { - p.UseGlobalEndpoint = ptr.Bool(false) - } - return p -} + if p.UseGlobalEndpoint == nil { + p.UseGlobalEndpoint = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseFIPS := *params.UseFIPS + _UseDualStack := *params.UseDualStack + _ForcePathStyle := *params.ForcePathStyle + _Accelerate := *params.Accelerate + _UseGlobalEndpoint := *params.UseGlobalEndpoint + _DisableMultiRegionAccessPoints := *params.DisableMultiRegionAccessPoints + + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if _Accelerate == true { + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Accelerate cannot be used with FIPS") + } + } + if _UseDualStack == true { + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + return endpoint, fmt.Errorf("endpoint rule error, %s", "Cannot set dual-stack in combination with a custom endpoint.") + } + } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "A custom endpoint cannot be combined with FIPS") + } + } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _Accelerate == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "A custom endpoint cannot be combined with S3 Accelerate") + } + } + if _UseFIPS == true { + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _partitionResult := *exprVal + _ = _partitionResult + if _partitionResult.Name == "aws-cn" { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Partition does not support FIPS") + } + } + } + if exprVal := params.Bucket; exprVal != nil { + _Bucket := *exprVal + _ = _Bucket + if exprVal := rulesfn.SubString(_Bucket, 0, 6, true); exprVal != nil { + _bucketSuffix := *exprVal + _ = _bucketSuffix + if _bucketSuffix == "--x-s3" { + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "S3Express does not support Dual-stack.") + } + if _Accelerate == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "S3Express does not support S3 Accelerate.") + } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if exprVal := rulesfn.ParseURL(_Endpoint); exprVal != nil { + _url := *exprVal + _ = _url + if exprVal := params.DisableS3ExpressSessionAuth; exprVal != nil { + _DisableS3ExpressSessionAuth := *exprVal + _ = _DisableS3ExpressSessionAuth + if _DisableS3ExpressSessionAuth == true { + if _url.IsIp == true { + _uri_encoded_bucket := rulesfn.URIEncode(_Bucket) + _ = _uri_encoded_bucket + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_url.Authority) + out.WriteString("/") + out.WriteString(_uri_encoded_bucket) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if awsrulesfn.IsVirtualHostableS3Bucket(_Bucket, false) { + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_Bucket) + out.WriteString(".") + out.WriteString(_url.Authority) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "S3Express bucket name is not a valid virtual hostable name.") + } + } + if _url.IsIp == true { + _uri_encoded_bucket := rulesfn.URIEncode(_Bucket) + _ = _uri_encoded_bucket + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_url.Authority) + out.WriteString("/") + out.WriteString(_uri_encoded_bucket) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if awsrulesfn.IsVirtualHostableS3Bucket(_Bucket, false) { + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_Bucket) + out.WriteString(".") + out.WriteString(_url.Authority) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "S3Express bucket name is not a valid virtual hostable name.") + } + } + if exprVal := params.UseS3ExpressControlEndpoint; exprVal != nil { + _UseS3ExpressControlEndpoint := *exprVal + _ = _UseS3ExpressControlEndpoint + if _UseS3ExpressControlEndpoint == true { + _uri_encoded_bucket := rulesfn.URIEncode(_Bucket) + _ = _uri_encoded_bucket + if !(params.Endpoint != nil) { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://s3express-control-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com/") + out.WriteString(_uri_encoded_bucket) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://s3express-control.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com/") + out.WriteString(_uri_encoded_bucket) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + } + if awsrulesfn.IsVirtualHostableS3Bucket(_Bucket, false) { + if exprVal := params.DisableS3ExpressSessionAuth; exprVal != nil { + _DisableS3ExpressSessionAuth := *exprVal + _ = _DisableS3ExpressSessionAuth + if _DisableS3ExpressSessionAuth == true { + if exprVal := rulesfn.SubString(_Bucket, 6, 14, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 14, 16, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 15, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 15, 17, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 19, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 19, 21, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 20, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 20, 22, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 26, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 26, 28, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Unrecognized S3Express bucket name format.") + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 14, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 14, 16, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 15, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 15, 17, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 19, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 19, 21, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 20, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 20, 22, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + if exprVal := rulesfn.SubString(_Bucket, 6, 26, true); exprVal != nil { + _s3expressAvailabilityZoneId := *exprVal + _ = _s3expressAvailabilityZoneId + if exprVal := rulesfn.SubString(_Bucket, 26, 28, true); exprVal != nil { + _s3expressAvailabilityZoneDelim := *exprVal + _ = _s3expressAvailabilityZoneDelim + if _s3expressAvailabilityZoneDelim == "--" { + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-fips-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Bucket) + out.WriteString(".s3express-") + out.WriteString(_s3expressAvailabilityZoneId) + out.WriteString(".") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "sigv4-s3express", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Unrecognized S3Express bucket name format.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "S3Express bucket name is not a valid virtual hostable name.") + } + } + } + if !(params.Bucket != nil) { + if exprVal := params.UseS3ExpressControlEndpoint; exprVal != nil { + _UseS3ExpressControlEndpoint := *exprVal + _ = _UseS3ExpressControlEndpoint + if _UseS3ExpressControlEndpoint == true { + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if exprVal := rulesfn.ParseURL(_Endpoint); exprVal != nil { + _url := *exprVal + _ = _url + uriString := func() string { + var out strings.Builder + out.WriteString(_url.Scheme) + out.WriteString("://") + out.WriteString(_url.Authority) + out.WriteString(_url.Path) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://s3express-control-fips.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() -// resolver provides the implementation for resolving endpoints. -type resolver struct{} + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://s3express-control.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseFIPS := *params.UseFIPS - _UseDualStack := *params.UseDualStack - _ForcePathStyle := *params.ForcePathStyle - _Accelerate := *params.Accelerate - _UseGlobalEndpoint := *params.UseGlobalEndpoint - _DisableMultiRegionAccessPoints := *params.DisableMultiRegionAccessPoints + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if _Accelerate == true { - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Accelerate cannot be used with FIPS") - } - } - if _UseDualStack == true { - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - return endpoint, fmt.Errorf("endpoint rule error, %s", "Cannot set dual-stack in combination with a custom endpoint.") - } - } - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "A custom endpoint cannot be combined with FIPS") - } - } - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _Accelerate == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "A custom endpoint cannot be combined with S3 Accelerate") - } - } - if _UseFIPS == true { - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _partitionResult := *exprVal - _ = _partitionResult - if _partitionResult.Name == "aws-cn" { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Partition does not support FIPS") + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("backend", "S3Express") + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3express") + smithyhttp.SetSigV4ASigningName(&sp, "s3express") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil } } } @@ -594,12 +1934,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -630,12 +1990,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -674,12 +2054,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -712,12 +2112,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -791,12 +2211,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -834,12 +2261,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -878,12 +2312,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -919,12 +2360,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -962,12 +2410,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1006,12 +2461,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1047,12 +2509,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1088,12 +2557,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1130,12 +2606,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1171,12 +2654,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1214,12 +2704,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1258,12 +2755,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1306,12 +2810,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1356,12 +2867,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1407,12 +2925,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1439,12 +2964,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1492,12 +3024,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1525,12 +3064,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1576,12 +3122,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1628,12 +3181,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1671,12 +3231,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1713,12 +3280,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1744,12 +3318,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1786,12 +3367,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1827,12 +3415,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -1869,12 +3464,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1902,12 +3504,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -1946,12 +3555,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -2007,12 +3623,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -2118,12 +3741,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2155,12 +3785,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2190,12 +3827,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2329,12 +3973,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2367,12 +4018,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2405,12 +4063,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2449,12 +4114,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2489,12 +4161,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2593,14 +4272,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4a", - "signingName": "s3", - "signingRegionSet": []interface{}{ - "*", - }, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), }, }) return out @@ -2635,8 +4319,8 @@ func (r *resolver) ResolveEndpoint( return endpoint, fmt.Errorf("endpoint rule error, %s", "S3 Outposts does not support S3 Accelerate") } if exprVal := _bucketArn.ResourceId.Get(4); exprVal != nil { - _var_244 := *exprVal - _ = _var_244 + _var_287 := *exprVal + _ = _var_287 return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Arn: Outpost Access Point ARN contains sub resources") } if exprVal := _bucketArn.ResourceId.Get(1); exprVal != nil { @@ -2705,12 +4389,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2743,12 +4447,32 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-outposts", - "signingRegion": _bucketArn.Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4a", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4ASigningRegions(&sp, []string{"*"}) + return sp + }(), + }, + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-outposts") + smithyhttp.SetSigV4ASigningName(&sp, "s3-outposts") + + smithyhttp.SetSigV4SigningRegion(&sp, _bucketArn.Region) + return sp + }(), }, }) return out @@ -2839,8 +4563,8 @@ func (r *resolver) ResolveEndpoint( } if _ForcePathStyle == true { if exprVal := awsrulesfn.ParseARN(_Bucket); exprVal != nil { - _var_257 := *exprVal - _ = _var_257 + _var_300 := *exprVal + _ = _var_300 return endpoint, fmt.Errorf("endpoint rule error, %s", "Path-style addressing cannot be used with ARN buckets") } } @@ -2873,12 +4597,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -2914,12 +4645,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -2956,12 +4694,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -2995,12 +4740,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3036,12 +4788,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3078,12 +4837,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3117,12 +4883,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3158,12 +4931,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3200,12 +4980,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3245,12 +5032,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3292,12 +5086,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3324,12 +5125,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3371,12 +5179,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3411,12 +5226,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3451,12 +5273,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3484,12 +5313,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3526,12 +5362,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3587,12 +5430,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3620,12 +5470,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3651,12 +5508,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3-object-lambda", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3-object-lambda") + smithyhttp.SetSigV4ASigningName(&sp, "s3-object-lambda") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3694,12 +5558,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3733,12 +5604,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3773,12 +5651,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3810,12 +5695,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3849,12 +5741,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3889,12 +5788,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -3926,12 +5832,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -3965,12 +5878,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4005,12 +5925,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4049,12 +5976,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -4095,12 +6029,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4126,12 +6067,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4172,12 +6120,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4210,12 +6165,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": "us-east-1", + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), }, }) return out @@ -4248,12 +6210,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4279,12 +6248,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4319,12 +6295,19 @@ func (r *resolver) ResolveEndpoint( Headers: http.Header{}, Properties: func() smithy.Properties { var out smithy.Properties - out.Set("authSchemes", []interface{}{ - map[string]interface{}{ - "disableDoubleEncoding": true, - "name": "sigv4", - "signingName": "s3", - "signingRegion": _Region, + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetDisableDoubleEncoding(&sp, true) + + smithyhttp.SetSigV4SigningName(&sp, "s3") + smithyhttp.SetSigV4ASigningName(&sp, "s3") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), }, }) return out @@ -4345,3 +6328,96 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "A region must be set when sending requests to S3.") } + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.ForcePathStyle = aws.Bool(options.UsePathStyle) + params.Accelerate = aws.Bool(options.UseAccelerate) + params.DisableMultiRegionAccessPoints = aws.Bool(options.DisableMultiRegionAccessPoints) + params.UseArnRegion = aws.Bool(options.UseARNRegion) + + params.DisableS3ExpressSessionAuth = options.DisableS3ExpressSessionAuth + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + ctx = setS3ResolvedURI(ctx, endpt.URI.String()) + + backend := s3cust.GetPropertiesBackend(&endpt.Properties) + ctx = internalcontext.SetS3Backend(ctx, backend) + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express.go new file mode 100644 index 00000000..bbac9ca2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express.go @@ -0,0 +1,9 @@ +package s3 + +import ( + "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" +) + +// ExpressCredentialsProvider retrieves credentials for operations against the +// S3Express storage class. +type ExpressCredentialsProvider = customizations.S3ExpressCredentialsProvider diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_default.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_default.go new file mode 100644 index 00000000..3b35a3e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_default.go @@ -0,0 +1,170 @@ +package s3 + +import ( + "context" + "crypto/hmac" + "crypto/sha256" + "errors" + "fmt" + "sync" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/internal/sync/singleflight" + "github.com/aws/smithy-go/container/private/cache" + "github.com/aws/smithy-go/container/private/cache/lru" +) + +const s3ExpressCacheCap = 100 + +const s3ExpressRefreshWindow = 1 * time.Minute + +type cacheKey struct { + CredentialsHash string // hmac(sigv4 akid, sigv4 secret) + Bucket string +} + +func (c cacheKey) Slug() string { + return fmt.Sprintf("%s%s", c.CredentialsHash, c.Bucket) +} + +type sessionCredsCache struct { + mu sync.Mutex + cache cache.Cache +} + +func (c *sessionCredsCache) Get(key cacheKey) (*aws.Credentials, bool) { + c.mu.Lock() + defer c.mu.Unlock() + + if v, ok := c.cache.Get(key); ok { + return v.(*aws.Credentials), true + } + return nil, false +} + +func (c *sessionCredsCache) Put(key cacheKey, creds *aws.Credentials) { + c.mu.Lock() + defer c.mu.Unlock() + + c.cache.Put(key, creds) +} + +// The default S3Express provider uses an LRU cache with a capacity of 100. +// +// Credentials will be refreshed asynchronously when a Retrieve() call is made +// for cached credentials within an expiry window (1 minute, currently +// non-configurable). +type defaultS3ExpressCredentialsProvider struct { + sf singleflight.Group + + client createSessionAPIClient + cache *sessionCredsCache + refreshWindow time.Duration + v4creds aws.CredentialsProvider // underlying credentials used for CreateSession +} + +type createSessionAPIClient interface { + CreateSession(context.Context, *CreateSessionInput, ...func(*Options)) (*CreateSessionOutput, error) +} + +func newDefaultS3ExpressCredentialsProvider() *defaultS3ExpressCredentialsProvider { + return &defaultS3ExpressCredentialsProvider{ + cache: &sessionCredsCache{ + cache: lru.New(s3ExpressCacheCap), + }, + refreshWindow: s3ExpressRefreshWindow, + } +} + +// returns a cloned provider using new base credentials, used when per-op +// config mutations change the credentials provider +func (p *defaultS3ExpressCredentialsProvider) CloneWithBaseCredentials(v4creds aws.CredentialsProvider) *defaultS3ExpressCredentialsProvider { + return &defaultS3ExpressCredentialsProvider{ + client: p.client, + cache: p.cache, + refreshWindow: p.refreshWindow, + v4creds: v4creds, + } +} + +func (p *defaultS3ExpressCredentialsProvider) Retrieve(ctx context.Context, bucket string) (aws.Credentials, error) { + v4creds, err := p.v4creds.Retrieve(ctx) + if err != nil { + return aws.Credentials{}, fmt.Errorf("get sigv4 creds: %w", err) + } + + key := cacheKey{ + CredentialsHash: gethmac(v4creds.AccessKeyID, v4creds.SecretAccessKey), + Bucket: bucket, + } + creds, ok := p.cache.Get(key) + if !ok || creds.Expired() { + return p.awaitDoChanRetrieve(ctx, key) + } + + if creds.Expires.Sub(sdk.NowTime()) <= p.refreshWindow { + p.doChanRetrieve(ctx, key) + } + + return *creds, nil +} + +func (p *defaultS3ExpressCredentialsProvider) doChanRetrieve(ctx context.Context, key cacheKey) <-chan singleflight.Result { + return p.sf.DoChan(key.Slug(), func() (interface{}, error) { + return p.retrieve(ctx, key) + }) +} + +func (p *defaultS3ExpressCredentialsProvider) awaitDoChanRetrieve(ctx context.Context, key cacheKey) (aws.Credentials, error) { + ch := p.doChanRetrieve(ctx, key) + + select { + case r := <-ch: + return r.Val.(aws.Credentials), r.Err + case <-ctx.Done(): + return aws.Credentials{}, errors.New("s3express retrieve credentials canceled") + } +} + +func (p *defaultS3ExpressCredentialsProvider) retrieve(ctx context.Context, key cacheKey) (aws.Credentials, error) { + resp, err := p.client.CreateSession(ctx, &CreateSessionInput{ + Bucket: aws.String(key.Bucket), + }) + if err != nil { + return aws.Credentials{}, err + } + + creds, err := credentialsFromResponse(resp) + if err != nil { + return aws.Credentials{}, err + } + + p.cache.Put(key, creds) + return *creds, nil +} + +func credentialsFromResponse(o *CreateSessionOutput) (*aws.Credentials, error) { + if o.Credentials == nil { + return nil, errors.New("s3express session credentials unset") + } + + if o.Credentials.AccessKeyId == nil || o.Credentials.SecretAccessKey == nil || o.Credentials.SessionToken == nil || o.Credentials.Expiration == nil { + return nil, errors.New("s3express session credentials missing one or more required fields") + } + + return &aws.Credentials{ + AccessKeyID: *o.Credentials.AccessKeyId, + SecretAccessKey: *o.Credentials.SecretAccessKey, + SessionToken: *o.Credentials.SessionToken, + CanExpire: true, + Expires: *o.Credentials.Expiration, + }, nil +} + +func gethmac(p, key string) string { + hash := hmac.New(sha256.New, []byte(key)) + hash.Write([]byte(p)) + return string(hash.Sum(nil)) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_resolve.go new file mode 100644 index 00000000..7c7a7b42 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_resolve.go @@ -0,0 +1,39 @@ +package s3 + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" +) + +// If the caller hasn't provided an S3Express provider, we use our default +// which will grab a reference to the S3 client itself in finalization. +func resolveExpressCredentials(o *Options) { + if o.ExpressCredentials == nil { + o.ExpressCredentials = newDefaultS3ExpressCredentialsProvider() + } +} + +// Config finalizer: if we're using the default S3Express implementation, grab +// a reference to the client for its CreateSession API, and the underlying +// sigv4 credentials provider for cache keying. +func finalizeExpressCredentials(o *Options, c *Client) { + if p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider); ok { + p.client = c + p.v4creds = o.Credentials + } +} + +// Operation config finalizer: update the sigv4 credentials on the default +// express provider in case it changed to ensure different cache keys +func finalizeOperationExpressCredentials(o *Options, c Client) { + if p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider); ok { + o.ExpressCredentials = p.CloneWithBaseCredentials(o.Credentials) + } +} + +// NewFromConfig resolver: pull from opaque sources if it exists. +func resolveDisableExpressAuth(cfg aws.Config, o *Options) { + if v, ok := customizations.ResolveDisableExpressAuth(cfg.ConfigSources); ok { + o.DisableS3ExpressSessionAuth = &v + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_user_agent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_user_agent.go new file mode 100644 index 00000000..a9b54535 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/express_user_agent.go @@ -0,0 +1,43 @@ +package s3 + +import ( + "context" + "strings" + + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" +) + +// isExpressUserAgent tracks whether the caller is using S3 Express +// +// we can only derive this at runtime, so the middleware needs to hold a handle +// to the underlying user-agent manipulator to set the feature flag as +// necessary +type isExpressUserAgent struct { + ua *awsmiddleware.RequestUserAgent +} + +func (*isExpressUserAgent) ID() string { + return "isExpressUserAgent" +} + +func (m *isExpressUserAgent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + const expressSuffix = "--x-s3" + + bucket, ok := bucketFromInput(in.Parameters) + if ok && strings.HasSuffix(bucket, expressSuffix) { + m.ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureS3ExpressBucket) + } + return next.HandleSerialize(ctx, in) +} + +func addIsExpressUserAgent(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + return stack.Serialize.Add(&isExpressUserAgent{ua}, middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/generated.json index b15270c4..d865ac68 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/generated.json @@ -9,8 +9,7 @@ "github.com/aws/aws-sdk-go-v2/service/internal/checksum": "v0.0.0-00010101000000-000000000000", "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", "github.com/aws/aws-sdk-go-v2/service/internal/s3shared": "v1.2.3", - "github.com/aws/smithy-go": "v1.4.0", - "github.com/google/go-cmp": "v0.5.4" + "github.com/aws/smithy-go": "v1.4.0" }, "files": [ "api_client.go", @@ -19,7 +18,9 @@ "api_op_CompleteMultipartUpload.go", "api_op_CopyObject.go", "api_op_CreateBucket.go", + "api_op_CreateBucketMetadataTableConfiguration.go", "api_op_CreateMultipartUpload.go", + "api_op_CreateSession.go", "api_op_DeleteBucket.go", "api_op_DeleteBucketAnalyticsConfiguration.go", "api_op_DeleteBucketCors.go", @@ -27,6 +28,7 @@ "api_op_DeleteBucketIntelligentTieringConfiguration.go", "api_op_DeleteBucketInventoryConfiguration.go", "api_op_DeleteBucketLifecycle.go", + "api_op_DeleteBucketMetadataTableConfiguration.go", "api_op_DeleteBucketMetricsConfiguration.go", "api_op_DeleteBucketOwnershipControls.go", "api_op_DeleteBucketPolicy.go", @@ -47,6 +49,7 @@ "api_op_GetBucketLifecycleConfiguration.go", "api_op_GetBucketLocation.go", "api_op_GetBucketLogging.go", + "api_op_GetBucketMetadataTableConfiguration.go", "api_op_GetBucketMetricsConfiguration.go", "api_op_GetBucketNotificationConfiguration.go", "api_op_GetBucketOwnershipControls.go", @@ -73,6 +76,7 @@ "api_op_ListBucketInventoryConfigurations.go", "api_op_ListBucketMetricsConfigurations.go", "api_op_ListBuckets.go", + "api_op_ListDirectoryBuckets.go", "api_op_ListMultipartUploads.go", "api_op_ListObjectVersions.go", "api_op_ListObjects.go", @@ -108,6 +112,7 @@ "api_op_UploadPart.go", "api_op_UploadPartCopy.go", "api_op_WriteGetObjectResponse.go", + "auth.go", "deserializers.go", "doc.go", "endpoints.go", @@ -117,8 +122,10 @@ "generated.json", "internal/endpoints/endpoints.go", "internal/endpoints/endpoints_test.go", + "options.go", "protocol_test.go", "serializers.go", + "snapshot_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go index 9ef7a1d2..84c94294 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go @@ -3,4 +3,4 @@ package s3 // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.42.1" +const goModuleVersion = "1.71.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/handwritten_paginators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/handwritten_paginators.go index 3d0b2510..6aae79e7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/handwritten_paginators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/handwritten_paginators.go @@ -3,6 +3,8 @@ package s3 import ( "context" "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" ) // ListObjectVersionsAPIClient is a client that implements the ListObjectVersions @@ -42,7 +44,9 @@ func NewListObjectVersionsPaginator(client ListObjectVersionsAPIClient, params * } options := ListObjectVersionsPaginatorOptions{} - options.Limit = params.MaxKeys + if params.MaxKeys != nil { + options.Limit = aws.ToInt32(params.MaxKeys) + } for _, fn := range optFns { fn(&options) @@ -77,7 +81,9 @@ func (p *ListObjectVersionsPaginator) NextPage(ctx context.Context, optFns ...fu if p.options.Limit > 0 { limit = p.options.Limit } - params.MaxKeys = limit + if limit > 0 { + params.MaxKeys = aws.Int32(limit) + } result, err := p.client.ListObjectVersions(ctx, ¶ms, optFns...) if err != nil { @@ -86,10 +92,10 @@ func (p *ListObjectVersionsPaginator) NextPage(ctx context.Context, optFns ...fu p.firstPage = false prevToken := p.keyMarker - p.isTruncated = result.IsTruncated + p.isTruncated = aws.ToBool(result.IsTruncated) p.keyMarker = nil p.versionIDMarker = nil - if result.IsTruncated { + if aws.ToBool(result.IsTruncated) { p.keyMarker = result.NextKeyMarker p.versionIDMarker = result.NextVersionIdMarker } @@ -141,7 +147,9 @@ func NewListMultipartUploadsPaginator(client ListMultipartUploadsAPIClient, para } options := ListMultipartUploadsPaginatorOptions{} - options.Limit = params.MaxUploads + if params.MaxUploads != nil { + options.Limit = aws.ToInt32(params.MaxUploads) + } for _, fn := range optFns { fn(&options) @@ -176,7 +184,9 @@ func (p *ListMultipartUploadsPaginator) NextPage(ctx context.Context, optFns ... if p.options.Limit > 0 { limit = p.options.Limit } - params.MaxUploads = limit + if limit > 0 { + params.MaxUploads = aws.Int32(limit) + } result, err := p.client.ListMultipartUploads(ctx, ¶ms, optFns...) if err != nil { @@ -185,10 +195,10 @@ func (p *ListMultipartUploadsPaginator) NextPage(ctx context.Context, optFns ... p.firstPage = false prevToken := p.keyMarker - p.isTruncated = result.IsTruncated + p.isTruncated = aws.ToBool(result.IsTruncated) p.keyMarker = nil p.uploadIDMarker = nil - if result.IsTruncated { + if aws.ToBool(result.IsTruncated) { p.keyMarker = result.NextKeyMarker p.uploadIDMarker = result.NextUploadIdMarker } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/context.go new file mode 100644 index 00000000..91b8fde0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/context.go @@ -0,0 +1,21 @@ +package customizations + +import ( + "context" + + "github.com/aws/smithy-go/middleware" +) + +type bucketKey struct{} + +// SetBucket stores a bucket name within the request context, which is required +// for a variety of custom S3 behaviors. +func SetBucket(ctx context.Context, bucket string) context.Context { + return middleware.WithStackValue(ctx, bucketKey{}, bucket) +} + +// GetBucket retrieves a stored bucket name within a context. +func GetBucket(ctx context.Context) string { + v, _ := middleware.GetStackValue(ctx, bucketKey{}).(string) + return v +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express.go new file mode 100644 index 00000000..8cc0b362 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express.go @@ -0,0 +1,44 @@ +package customizations + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// S3ExpressCredentialsProvider retrieves credentials for the S3Express storage +// class. +type S3ExpressCredentialsProvider interface { + Retrieve(ctx context.Context, bucket string) (aws.Credentials, error) +} + +// ExpressIdentityResolver retrieves identity for the S3Express storage class. +type ExpressIdentityResolver struct { + Provider S3ExpressCredentialsProvider +} + +var _ (auth.IdentityResolver) = (*ExpressIdentityResolver)(nil) + +// GetIdentity retrieves AWS credentials using the underlying provider. +func (v *ExpressIdentityResolver) GetIdentity(ctx context.Context, props smithy.Properties) ( + auth.Identity, error, +) { + bucket, ok := GetIdentityPropertiesBucket(&props) + if !ok { + bucket = GetBucket(ctx) + } + if bucket == "" { + return nil, fmt.Errorf("bucket name is missing") + } + + creds, err := v.Provider.Retrieve(ctx, bucket) + if err != nil { + return nil, fmt.Errorf("get credentials: %v", err) + } + + return &internalauthsmithy.CredentialsAdapter{Credentials: creds}, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_config.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_config.go new file mode 100644 index 00000000..bb22d347 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_config.go @@ -0,0 +1,18 @@ +package customizations + +type s3DisableExpressAuthProvider interface { + GetS3DisableExpressAuth() (bool, bool) +} + +// ResolveDisableExpressAuth pulls S3DisableExpressAuth setting from config +// sources. +func ResolveDisableExpressAuth(configs []interface{}) (value bool, exists bool) { + for _, cfg := range configs { + if p, ok := cfg.(s3DisableExpressAuthProvider); ok { + if value, exists = p.GetS3DisableExpressAuth(); exists { + break + } + } + } + return +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_default_checksum.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_default_checksum.go new file mode 100644 index 00000000..cf3ff596 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_default_checksum.go @@ -0,0 +1,42 @@ +package customizations + +import ( + "context" + "fmt" + + ictx "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/aws-sdk-go-v2/service/internal/checksum" + "github.com/aws/smithy-go/middleware" +) + +type expressDefaultChecksumMiddleware struct{} + +func (*expressDefaultChecksumMiddleware) ID() string { + return "expressDefaultChecksum" +} + +func (*expressDefaultChecksumMiddleware) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if ictx.GetS3Backend(ctx) == ictx.S3BackendS3Express && ictx.GetChecksumInputAlgorithm(ctx) == "" { + ctx = ictx.SetChecksumInputAlgorithm(ctx, string(checksum.AlgorithmCRC32)) + } + return next.HandleFinalize(ctx, in) +} + +// AddExpressDefaultChecksumMiddleware appends a step to default to CRC32 for +// S3Express requests. This should only be applied to operations where a +// checksum is required (e.g. DeleteObject). +func AddExpressDefaultChecksumMiddleware(s *middleware.Stack) error { + err := s.Finalize.Insert( + &expressDefaultChecksumMiddleware{}, + "AWSChecksum:ComputeInputPayloadChecksum", + middleware.Before, + ) + if err != nil { + return fmt.Errorf("add expressDefaultChecksum: %v", err) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_properties.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_properties.go new file mode 100644 index 00000000..171de461 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_properties.go @@ -0,0 +1,21 @@ +package customizations + +import "github.com/aws/smithy-go" + +// GetPropertiesBackend returns a resolved endpoint backend from the property +// set. +func GetPropertiesBackend(p *smithy.Properties) string { + v, _ := p.Get("backend").(string) + return v +} + +// GetIdentityPropertiesBucket returns the S3 bucket from identity properties. +func GetIdentityPropertiesBucket(ip *smithy.Properties) (string, bool) { + v, ok := ip.Get(bucketKey{}).(string) + return v, ok +} + +// SetIdentityPropertiesBucket sets the S3 bucket to identity properties. +func SetIdentityPropertiesBucket(ip *smithy.Properties, bucket string) { + ip.Set(bucketKey{}, bucket) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer.go new file mode 100644 index 00000000..545e5b22 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer.go @@ -0,0 +1,109 @@ +package customizations + +import ( + "context" + "net/http" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" +) + +const ( + s3ExpressSignerVersion = "com.amazonaws.s3#sigv4express" + headerAmzSessionToken = "x-amz-s3session-token" +) + +// adapts a v4 signer for S3Express +type s3ExpressSignerAdapter struct { + v4 v4.HTTPSigner +} + +// SignHTTP performs S3Express signing on a request, which is identical to +// SigV4 signing save for an additional header containing the S3Express +// session token. +func (s *s3ExpressSignerAdapter) SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error { + r.Header.Set(headerAmzSessionToken, credentials.SessionToken) + optFns = append(optFns, func(o *v4.SignerOptions) { + o.DisableSessionToken = true + }) + return s.v4.SignHTTP(ctx, credentials, r, payloadHash, service, region, signingTime, optFns...) +} + +// adapts S3ExpressCredentialsProvider to the standard AWS +// CredentialsProvider interface +type s3ExpressCredentialsAdapter struct { + provider S3ExpressCredentialsProvider + bucket string +} + +func (c *s3ExpressCredentialsAdapter) Retrieve(ctx context.Context) (aws.Credentials, error) { + return c.provider.Retrieve(ctx, c.bucket) +} + +// S3ExpressSignHTTPRequestMiddleware signs S3 S3Express requests. +// +// This is NOT mutually exclusive with existing v4 or v4a signer handling on +// the stack itself, but only one handler will actually perform signing based +// on the provided signing version in the context. +type S3ExpressSignHTTPRequestMiddleware struct { + Credentials S3ExpressCredentialsProvider + Signer v4.HTTPSigner + LogSigning bool +} + +// ID identifies S3ExpressSignHTTPRequestMiddleware. +func (*S3ExpressSignHTTPRequestMiddleware) ID() string { + return "S3ExpressSigning" +} + +// HandleFinalize will sign the request if the S3Express signer has been +// selected. +func (m *S3ExpressSignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + if GetSignerVersion(ctx) != s3ExpressSignerVersion { + return next.HandleFinalize(ctx, in) + } + + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: m.credentialsAdapter(ctx), + Signer: m.signerAdapter(), + LogSigning: m.LogSigning, + }) + return mw.HandleFinalize(ctx, in, next) +} + +func (m *S3ExpressSignHTTPRequestMiddleware) credentialsAdapter(ctx context.Context) aws.CredentialsProvider { + return &s3ExpressCredentialsAdapter{ + provider: m.Credentials, + bucket: GetBucket(ctx), + } +} + +func (m *S3ExpressSignHTTPRequestMiddleware) signerAdapter() v4.HTTPSigner { + return &s3ExpressSignerAdapter{v4: m.Signer} +} + +type s3ExpressPresignerAdapter struct { + v4 v4.HTTPPresigner +} + +// SignHTTP performs S3Express signing on a request, which is identical to +// SigV4 signing save for an additional header containing the S3Express +// session token. +func (s *s3ExpressPresignerAdapter) PresignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) ( + string, http.Header, error, +) { + r.Header.Set(headerAmzSessionToken, credentials.SessionToken) + optFns = append(optFns, func(o *v4.SignerOptions) { + o.DisableSessionToken = true + }) + return s.v4.PresignHTTP(ctx, credentials, r, payloadHash, service, region, signingTime, optFns...) +} + +var ( + _ aws.CredentialsProvider = &s3ExpressCredentialsAdapter{} + _ v4.HTTPSigner = &s3ExpressSignerAdapter{} +) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer_smithy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer_smithy.go new file mode 100644 index 00000000..e3ec7f01 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/express_signer_smithy.go @@ -0,0 +1,61 @@ +package customizations + +import ( + "context" + "fmt" + + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// ExpressSigner signs requests for the sigv4-s3express auth scheme. +// +// This signer respects the aws.auth#sigv4 properties for signing name and +// region. +type ExpressSigner struct { + Signer v4.HTTPSigner + Logger logging.Logger + LogSigning bool +} + +var _ (smithyhttp.Signer) = (*ExpressSigner)(nil) + +// SignRequest signs the request with the provided identity. +func (v *ExpressSigner) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { + ca, ok := identity.(*internalauthsmithy.CredentialsAdapter) + if !ok { + return fmt.Errorf("unexpected identity type: %T", identity) + } + + name, ok := smithyhttp.GetSigV4SigningName(&props) + if !ok { + return fmt.Errorf("sigv4 signing name is required for s3express variant") + } + + region, ok := smithyhttp.GetSigV4SigningRegion(&props) + if !ok { + return fmt.Errorf("sigv4 signing region is required for s3express variant") + } + + hash := v4.GetPayloadHash(ctx) + + r.Header.Set(headerAmzSessionToken, ca.Credentials.SessionToken) + err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, sdk.NowTime(), func(o *v4.SignerOptions) { + o.DisableSessionToken = true + + o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) + + o.Logger = v.Logger + o.LogSigning = v.LogSigning + }) + if err != nil { + return fmt.Errorf("sign http: %v", err) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/signer_wrapper.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/signer_wrapper.go index 4408f3e8..756823cb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/signer_wrapper.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/signer_wrapper.go @@ -77,15 +77,21 @@ func (s *SignHTTPRequestMiddleware) ID() string { return "Signing" } -// HandleFinalize will take the provided input and sign the request using the SigV4 authentication scheme +// HandleFinalize will take the provided input and handle signing for either +// SigV4 or SigV4A as called for. func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) { - // fetch signer type from context - signerVersion := GetSignerVersion(ctx) + sv := GetSignerVersion(ctx) - // SigV4a - if strings.EqualFold(signerVersion, v4a.Version) { + if strings.EqualFold(sv, v4.Version) { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: s.credentialsProvider, + Signer: s.v4Signer, + LogSigning: s.logSigning, + }) + return mw.HandleFinalize(ctx, in, next) + } else if strings.EqualFold(sv, v4a.Version) { v4aCredentialProvider, ok := s.credentialsProvider.(v4a.CredentialsProvider) if !ok { return out, metadata, fmt.Errorf("invalid credential-provider provided for sigV4a Signer") @@ -98,13 +104,8 @@ func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middl }) return mw.HandleFinalize(ctx, in, next) } - // SigV4 - mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ - CredentialsProvider: s.credentialsProvider, - Signer: s.v4Signer, - LogSigning: s.logSigning, - }) - return mw.HandleFinalize(ctx, in, next) + + return next.HandleFinalize(ctx, in) } // RegisterSigningMiddleware registers the wrapper signing middleware to the stack. If a signing middleware is already @@ -124,6 +125,7 @@ func RegisterSigningMiddleware(stack *middleware.Stack, signingMiddleware *SignH // PresignHTTPRequestMiddlewareOptions is the options for the PresignHTTPRequestMiddleware middleware. type PresignHTTPRequestMiddlewareOptions struct { CredentialsProvider aws.CredentialsProvider + ExpressCredentials S3ExpressCredentialsProvider V4Presigner v4.HTTPPresigner V4aPresigner v4a.HTTPPresigner LogSigning bool @@ -139,6 +141,9 @@ type PresignHTTPRequestMiddleware struct { // cred provider and signer for sigv4 credentialsProvider aws.CredentialsProvider + // s3Express credentials + expressCredentials S3ExpressCredentialsProvider + // sigV4 signer v4Signer v4.HTTPPresigner @@ -153,6 +158,7 @@ type PresignHTTPRequestMiddleware struct { func NewPresignHTTPRequestMiddleware(options PresignHTTPRequestMiddlewareOptions) *PresignHTTPRequestMiddleware { return &PresignHTTPRequestMiddleware{ credentialsProvider: options.CredentialsProvider, + expressCredentials: options.ExpressCredentials, v4Signer: options.V4Presigner, v4aSigner: options.V4aPresigner, logSigning: options.LogSigning, @@ -175,26 +181,34 @@ func (p *PresignHTTPRequestMiddleware) HandleFinalize( signerVersion := GetSignerVersion(ctx) switch signerVersion { - case v4a.Version: - v4aCredentialProvider, ok := p.credentialsProvider.(v4a.CredentialsProvider) - if !ok { - return out, metadata, fmt.Errorf("invalid credential-provider provided for sigV4a Signer") - } - + case "aws.auth#sigv4a": mw := v4a.NewPresignHTTPRequestMiddleware(v4a.PresignHTTPRequestMiddlewareOptions{ - CredentialsProvider: v4aCredentialProvider, - Presigner: p.v4aSigner, - LogSigning: p.logSigning, + CredentialsProvider: &v4a.SymmetricCredentialAdaptor{ + SymmetricProvider: p.credentialsProvider, + }, + Presigner: p.v4aSigner, + LogSigning: p.logSigning, }) return mw.HandleFinalize(ctx, in, next) - - default: + case "aws.auth#sigv4": mw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ CredentialsProvider: p.credentialsProvider, Presigner: p.v4Signer, LogSigning: p.logSigning, }) return mw.HandleFinalize(ctx, in, next) + case s3ExpressSignerVersion: + mw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ + CredentialsProvider: &s3ExpressCredentialsAdapter{ + provider: p.expressCredentials, + bucket: GetBucket(ctx), + }, + Presigner: &s3ExpressPresignerAdapter{v4: p.v4Signer}, + LogSigning: p.logSigning, + }) + return mw.HandleFinalize(ctx, in, next) + default: + return out, metadata, fmt.Errorf("unsupported signer type \"%s\"", signerVersion) } } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go index c7e5f6d2..c887fa35 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go @@ -96,7 +96,7 @@ var partitionRegexp = struct { AwsUsGov *regexp.Regexp }{ - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), @@ -252,6 +252,15 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "s3.dualstack.ap-southeast-4.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "s3.dualstack.ap-southeast-5.amazonaws.com", + }, endpoints.EndpointKey{ Region: "aws-global", }: endpoints.Endpoint{ @@ -282,6 +291,27 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "s3.dualstack.ca-central-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "s3-fips.ca-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "s3-fips.dualstack.ca-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "s3.dualstack.ca-west-1.amazonaws.com", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, @@ -367,6 +397,15 @@ var defaultPartitions = endpoints.Partitions{ }, Deprecated: aws.TrueTernary, }, + endpoints.EndpointKey{ + Region: "fips-ca-west-1", + }: endpoints.Endpoint{ + Hostname: "s3-fips.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ @@ -632,15 +671,61 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-iso-east-1", + }: endpoints.Endpoint{ + Hostname: "s3-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-iso-west-1", + }: endpoints.Endpoint{ + Hostname: "s3-fips.us-iso-west-1.c2s.ic.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-iso-west-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{ Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, }, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "s3-fips.dualstack.us-iso-east-1.c2s.ic.gov", + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + endpoints.EndpointKey{ + Region: "us-iso-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "s3-fips.us-iso-east-1.c2s.ic.gov", + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, endpoints.EndpointKey{ Region: "us-iso-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "s3-fips.dualstack.us-iso-west-1.c2s.ic.gov", + }, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "s3-fips.us-iso-west-1.c2s.ic.gov", + }, }, }, { @@ -664,9 +749,30 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-isob-east-1", + }: endpoints.Endpoint{ + Hostname: "s3-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: endpoints.CredentialScope{ + Region: "us-isob-east-1", + }, + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "s3-fips.dualstack.us-isob-east-1.sc2s.sgov.gov", + }, + endpoints.EndpointKey{ + Region: "us-isob-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "s3-fips.us-isob-east-1.sc2s.sgov.gov", + }, }, }, { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/options.go new file mode 100644 index 00000000..8c67e4c6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/options.go @@ -0,0 +1,329 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + "github.com/aws/aws-sdk-go-v2/internal/v4a" + s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The threshold ContentLength in bytes for HTTP PUT request to receive {Expect: + // 100-continue} header. Setting to -1 will disable adding the Expect header to + // requests; setting to 0 will set the threshold to default 2MB + ContinueHeaderThresholdBytes int64 + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // Allows you to disable S3 Multi-Region access points feature. + DisableMultiRegionAccessPoints bool + + // Disables this client's usage of Session Auth for S3Express buckets and reverts + // to using conventional SigV4 for those. + DisableS3ExpressSessionAuth *bool + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // The credentials provider for S3Express requests. + ExpressCredentials ExpressCredentialsProvider + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // Allows you to enable arn region support for the service. + UseARNRegion bool + + // Allows you to enable S3 Accelerate feature. All operations compatible with S3 + // Accelerate will use the accelerate endpoint for requests. Requests not + // compatible will fall back to normal S3 requests. The bucket must be enabled for + // accelerate to be used with S3 client with accelerate enabled. If the bucket is + // not enabled for accelerate an error will be returned. The bucket name must be + // DNS compatible to work with accelerate. + UseAccelerate bool + + // Allows you to enable dual-stack endpoint support for the service. + // + // Deprecated: Set dual-stack by setting UseDualStackEndpoint on + // EndpointResolverOptions. When EndpointResolverOptions' UseDualStackEndpoint + // field is set it overrides this field value. + UseDualstack bool + + // Allows you to enable the client to use path-style addressing, i.e., + // https://s3.amazonaws.com/BUCKET/KEY . By default, the S3 client will use virtual + // hosted bucket addressing when possible( https://BUCKET.s3.amazonaws.com/KEY ). + UsePathStyle bool + + // Signature Version 4a (SigV4a) Signer + httpSignerV4a httpSignerV4a + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "com.amazonaws.s3#sigv4express" { + return getExpressIdentityResolver(o) + } + if schemeID == "aws.auth#sigv4a" { + return getSigV4AIdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func getSigV4AIdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &v4a.CredentialsProviderAdapter{ + Provider: &v4a.SymmetricCredentialAdaptor{ + SymmetricProvider: o.Credentials, + }, + } + } + return nil +} + +// WithSigV4ASigningRegions applies an override to the authentication workflow to +// use the given signing region set for SigV4A-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region set from both auth scheme resolution and endpoint +// resolution. +func WithSigV4ASigningRegions(regions []string) func(*Options) { + fn := func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, + ) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, regions) + return next.HandleFinalize(ctx, in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Finalize.Insert( + middleware.FinalizeMiddlewareFunc("withSigV4ASigningRegions", fn), + "Signing", + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} + +func getExpressIdentityResolver(o Options) smithyauth.IdentityResolver { + if o.ExpressCredentials != nil { + return &s3cust.ExpressIdentityResolver{Provider: o.ExpressCredentials} + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go new file mode 100644 index 00000000..491ed2e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go @@ -0,0 +1,419 @@ +package s3 + +import ( + "context" + "crypto/hmac" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalcontext "github.com/aws/aws-sdk-go-v2/internal/context" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +const ( + algorithmHeader = "X-Amz-Algorithm" + credentialHeader = "X-Amz-Credential" + dateHeader = "X-Amz-Date" + tokenHeader = "X-Amz-Security-Token" + signatureHeader = "X-Amz-Signature" + + algorithm = "AWS4-HMAC-SHA256" + aws4Request = "aws4_request" + bucketHeader = "bucket" + defaultExpiresIn = 15 * time.Minute + shortDateLayout = "20060102" +) + +// PresignPostObject is a special kind of [presigned request] used to send a request using +// form data, likely from an HTML form on a browser. +// Unlike other presigned operations, the return values of this function are not meant to be used directly +// to make an HTTP request but rather to be used as inputs to a form. See [the docs] for more information +// on how to use these values +// +// [presigned request] https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html +// [the docs] https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html +func (c *PresignClient) PresignPostObject(ctx context.Context, params *PutObjectInput, optFns ...func(*PresignPostOptions)) (*PresignedPostRequest, error) { + if params == nil { + params = &PutObjectInput{} + } + clientOptions := c.options.copy() + options := PresignPostOptions{ + Expires: clientOptions.Expires, + PostPresigner: &postSignAdapter{}, + } + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(clientOptions.ClientOptions, withNopHTTPClientAPIOption) + cvt := presignPostConverter(options) + result, _, err := c.client.invokeOperation(ctx, "$type:L", params, clientOptFns, + c.client.addOperationPutObjectMiddlewares, + cvt.ConvertToPresignMiddleware, + func(stack *middleware.Stack, options Options) error { + return awshttp.RemoveContentTypeHeader(stack) + }, + ) + if err != nil { + return nil, err + } + + out := result.(*PresignedPostRequest) + return out, nil +} + +// PresignedPostRequest represents a presigned request to be sent using HTTP verb POST and FormData +type PresignedPostRequest struct { + // Represents the Base URL to make a request to + URL string + // Values is a key-value map of values to be sent as FormData + // these values are not encoded + Values map[string]string +} + +// postSignAdapter adapter to implement the presignPost interface +type postSignAdapter struct{} + +// PresignPost creates a special kind of [presigned request] +// to be used with HTTP verb POST. +// It differs from PUT request mostly on +// 1. It accepts a new set of parameters, `Conditions[]`, that are used to create a policy doc to limit where an object can be posted to +// 2. The return value needs to have more processing since it's meant to be sent via a form and not stand on its own +// 3. There's no body to be signed, since that will be attached when the actual request is made +// 4. The signature is made based on the policy document, not the whole request +// More information can be found at https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html +// +// [presigned request] https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html +func (s *postSignAdapter) PresignPost( + credentials aws.Credentials, + bucket string, key string, + region string, service string, signingTime time.Time, conditions []interface{}, expirationTime time.Time, optFns ...func(*v4.SignerOptions), +) (fields map[string]string, err error) { + credentialScope := buildCredentialScope(signingTime, region, service) + credentialStr := credentials.AccessKeyID + "/" + credentialScope + + policyDoc, err := createPolicyDocument(expirationTime, signingTime, bucket, key, credentialStr, &credentials.SessionToken, conditions) + if err != nil { + return nil, err + } + + signature := buildSignature(policyDoc, credentials.SecretAccessKey, service, region, signingTime) + + fields = getPostSignRequiredFields(signingTime, credentialStr, credentials) + fields[signatureHeader] = signature + fields["key"] = key + fields["policy"] = policyDoc + + return fields, nil +} + +func getPostSignRequiredFields(t time.Time, credentialStr string, awsCredentials aws.Credentials) map[string]string { + fields := map[string]string{ + algorithmHeader: algorithm, + dateHeader: t.UTC().Format("20060102T150405Z"), + credentialHeader: credentialStr, + } + + sessionToken := awsCredentials.SessionToken + if len(sessionToken) > 0 { + fields[tokenHeader] = sessionToken + } + + return fields +} + +// PresignPost defines the interface to presign a POST request +type PresignPost interface { + PresignPost( + credentials aws.Credentials, + bucket string, key string, + region string, service string, signingTime time.Time, conditions []interface{}, expirationTime time.Time, + optFns ...func(*v4.SignerOptions), + ) (fields map[string]string, err error) +} + +// PresignPostOptions represent the options to be passed to a PresignPost sign request +type PresignPostOptions struct { + + // ClientOptions are list of functional options to mutate client options used by + // the presign client. + ClientOptions []func(*Options) + + // PostPresigner to use. One will be created if none is provided + PostPresigner PresignPost + + // Expires sets the expiration duration for the generated presign url. This should + // be the duration in seconds the presigned URL should be considered valid for. If + // not set or set to zero, presign url would default to expire after 900 seconds. + Expires time.Duration + + // Conditions a list of extra conditions to pass to the policy document + // Available conditions can be found [here] + // + // [here]https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html#sigv4-PolicyConditions + Conditions []interface{} +} + +type presignPostConverter PresignPostOptions + +// presignPostRequestMiddlewareOptions is the options for the presignPostRequestMiddleware middleware. +type presignPostRequestMiddlewareOptions struct { + CredentialsProvider aws.CredentialsProvider + Presigner PresignPost + LogSigning bool + ExpiresIn time.Duration + Conditions []interface{} +} + +type presignPostRequestMiddleware struct { + credentialsProvider aws.CredentialsProvider + presigner PresignPost + logSigning bool + expiresIn time.Duration + conditions []interface{} +} + +// newPresignPostRequestMiddleware returns a new presignPostRequestMiddleware +// initialized with the presigner. +func newPresignPostRequestMiddleware(options presignPostRequestMiddlewareOptions) *presignPostRequestMiddleware { + return &presignPostRequestMiddleware{ + credentialsProvider: options.CredentialsProvider, + presigner: options.Presigner, + logSigning: options.LogSigning, + expiresIn: options.ExpiresIn, + conditions: options.Conditions, + } +} + +// ID provides the middleware ID. +func (*presignPostRequestMiddleware) ID() string { return "PresignPostRequestMiddleware" } + +// HandleFinalize will take the provided input and create a presigned url for +// the http request using the SigV4 presign authentication scheme. +// +// Since the signed request is not a valid HTTP request +func (s *presignPostRequestMiddleware) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + + input := getOperationInput(ctx) + asS3Put, ok := input.(*PutObjectInput) + if !ok { + return out, metadata, fmt.Errorf("expected PutObjectInput") + } + bucketName, ok := asS3Put.bucket() + if !ok { + return out, metadata, fmt.Errorf("requested input bucketName not found on request") + } + uploadKey := asS3Put.Key + if uploadKey == nil { + return out, metadata, fmt.Errorf("PutObject input does not have a key input") + } + + uri := getS3ResolvedURI(ctx) + + signingName := awsmiddleware.GetSigningName(ctx) + signingRegion := awsmiddleware.GetSigningRegion(ctx) + + credentials, err := s.credentialsProvider.Retrieve(ctx) + if err != nil { + return out, metadata, &v4.SigningError{ + Err: fmt.Errorf("failed to retrieve credentials: %w", err), + } + } + skew := internalcontext.GetAttemptSkewContext(ctx) + signingTime := sdk.NowTime().Add(skew) + expirationTime := signingTime.Add(s.expiresIn).UTC() + + fields, err := s.presigner.PresignPost( + credentials, + bucketName, + *uploadKey, + signingRegion, + signingName, + signingTime, + s.conditions, + expirationTime, + func(o *v4.SignerOptions) { + o.Logger = middleware.GetLogger(ctx) + o.LogSigning = s.logSigning + }) + if err != nil { + return out, metadata, &v4.SigningError{ + Err: fmt.Errorf("failed to sign http request, %w", err), + } + } + + out.Result = &PresignedPostRequest{ + URL: uri, + Values: fields, + } + + return out, metadata, nil +} + +// Adapted from existing PresignConverter middleware +func (c presignPostConverter) ConvertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { + stack.Build.Remove("UserAgent") + stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + stack.Deserialize.Clear() + + if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { + return err + } + + // if no expiration is set, set one + expiresIn := c.Expires + if expiresIn == 0 { + expiresIn = defaultExpiresIn + } + + pmw := newPresignPostRequestMiddleware(presignPostRequestMiddlewareOptions{ + CredentialsProvider: options.Credentials, + Presigner: c.PostPresigner, + LogSigning: options.ClientLogMode.IsSigning(), + ExpiresIn: expiresIn, + Conditions: c.Conditions, + }) + if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { + return err + } + if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { + return err + } + err = presignedurlcust.AddAsIsPresigningMiddleware(stack) + if err != nil { + return err + } + return nil +} + +func createPolicyDocument(expirationTime time.Time, signingTime time.Time, bucket string, key string, credentialString string, securityToken *string, extraConditions []interface{}) (string, error) { + initialConditions := []interface{}{ + map[string]string{ + algorithmHeader: algorithm, + }, + map[string]string{ + bucketHeader: bucket, + }, + map[string]string{ + credentialHeader: credentialString, + }, + map[string]string{ + dateHeader: signingTime.UTC().Format("20060102T150405Z"), + }, + } + + var conditions []interface{} + for _, v := range initialConditions { + conditions = append(conditions, v) + } + + if securityToken != nil && *securityToken != "" { + conditions = append(conditions, map[string]string{ + tokenHeader: *securityToken, + }) + } + + // append user-defined conditions at the end + conditions = append(conditions, extraConditions...) + + // The policy allows you to set a "key" value to specify what's the name of the + // key to add. Customers can add one by specifying one in their conditions, + // so we're checking if one has already been set. + // If none is found, restrict this to just the key name passed on the request + // This can be disabled by adding a condition that explicitly allows + // everything + if !isAlreadyCheckingForKey(conditions) { + conditions = append(conditions, map[string]string{"key": key}) + } + + policyDoc := map[string]interface{}{ + "conditions": conditions, + "expiration": expirationTime.Format(time.RFC3339), + } + + jsonBytes, err := json.Marshal(policyDoc) + if err != nil { + return "", err + } + + return base64.StdEncoding.EncodeToString(jsonBytes), nil +} + +func isAlreadyCheckingForKey(conditions []interface{}) bool { + // Need to check for two conditions: + // 1. A condition of the form ["starts-with", "$key", "mykey"] + // 2. A condition of the form {"key": "mykey"} + for _, c := range conditions { + slice, ok := c.([]interface{}) + if ok && len(slice) > 1 { + if slice[0] == "starts-with" && slice[1] == "$key" { + return true + } + } + m, ok := c.(map[string]interface{}) + if ok && len(m) > 0 { + for k := range m { + if k == "key" { + return true + } + } + } + // Repeat this but for map[string]string due to type constrains + ms, ok := c.(map[string]string) + if ok && len(ms) > 0 { + for k := range ms { + if k == "key" { + return true + } + } + } + } + return false +} + +// these methods have been copied from v4 implementation since they are not exported for public use +func hmacsha256(key []byte, data []byte) []byte { + hash := hmac.New(sha256.New, key) + hash.Write(data) + return hash.Sum(nil) +} + +func buildSignature(strToSign, secret, service, region string, t time.Time) string { + key := deriveKey(secret, service, region, t) + return hex.EncodeToString(hmacsha256(key, []byte(strToSign))) +} + +func deriveKey(secret, service, region string, t time.Time) []byte { + hmacDate := hmacsha256([]byte("AWS4"+secret), []byte(t.UTC().Format(shortDateLayout))) + hmacRegion := hmacsha256(hmacDate, []byte(region)) + hmacService := hmacsha256(hmacRegion, []byte(service)) + return hmacsha256(hmacService, []byte(aws4Request)) +} + +func buildCredentialScope(signingTime time.Time, region, service string) string { + return strings.Join([]string{ + signingTime.UTC().Format(shortDateLayout), + region, + service, + aws4Request, + }, "/") +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serialize_immutable_hostname_bucket.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serialize_immutable_hostname_bucket.go index cb22779f..4e34d1a2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serialize_immutable_hostname_bucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serialize_immutable_hostname_bucket.go @@ -3,9 +3,10 @@ package s3 import ( "context" "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "path" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" @@ -38,16 +39,20 @@ func (m *serializeImmutableHostnameBucketMiddleware) HandleSerialize( if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - if !smithyhttp.GetHostnameImmutable(ctx) && - !(awsmiddleware.GetRequiresLegacyEndpoints(ctx) && m.UsePathStyle) { - return next.HandleSerialize(ctx, in) - } bucket, ok := bucketFromInput(in.Parameters) if !ok { return next.HandleSerialize(ctx, in) } + // a bucket being un-vhostable will also force us to use path style + usePathStyle := m.UsePathStyle || !awsrulesfn.IsVirtualHostableS3Bucket(bucket, request.URL.Scheme != "https") + + if !smithyhttp.GetHostnameImmutable(ctx) && + !(awsmiddleware.GetRequiresLegacyEndpoints(ctx) && usePathStyle) { + return next.HandleSerialize(ctx, in) + } + parsedBucket := awsrulesfn.ParseARN(bucket) // disallow ARN buckets except for MRAP arns diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go index 463f6b70..fcdea87c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go @@ -12,6 +12,7 @@ import ( smithyxml "github.com/aws/smithy-go/encoding/xml" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "strconv" @@ -28,6 +29,10 @@ func (*awsRestxml_serializeOpAbortMultipartUpload) ID() string { func (m *awsRestxml_serializeOpAbortMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -64,6 +69,8 @@ func (m *awsRestxml_serializeOpAbortMultipartUpload) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(v *AbortMultipartUploadInput, encoder *httpbinding.Encoder) error { @@ -71,11 +78,16 @@ func awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(v *AbortMultipa return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatchInitiatedTime != nil { + locationName := "X-Amz-If-Match-Initiated-Time" + encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchInitiatedTime)) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -107,6 +119,10 @@ func (*awsRestxml_serializeOpCompleteMultipartUpload) ID() string { func (m *awsRestxml_serializeOpCompleteMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -118,7 +134,7 @@ func (m *awsRestxml_serializeOpCompleteMultipartUpload) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/{Key+}?x-id=CompleteMultipartUpload") + opPath, opQuery := httpbinding.SplitURI("/{Key+}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -167,6 +183,8 @@ func (m *awsRestxml_serializeOpCompleteMultipartUpload) HandleSerialize(ctx cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteMultipartUploadInput, encoder *httpbinding.Encoder) error { @@ -174,31 +192,41 @@ func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteM return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ChecksumCRC32 != nil && len(*v.ChecksumCRC32) > 0 { + if v.ChecksumCRC32 != nil { locationName := "X-Amz-Checksum-Crc32" encoder.SetHeader(locationName).String(*v.ChecksumCRC32) } - if v.ChecksumCRC32C != nil && len(*v.ChecksumCRC32C) > 0 { + if v.ChecksumCRC32C != nil { locationName := "X-Amz-Checksum-Crc32c" encoder.SetHeader(locationName).String(*v.ChecksumCRC32C) } - if v.ChecksumSHA1 != nil && len(*v.ChecksumSHA1) > 0 { + if v.ChecksumSHA1 != nil { locationName := "X-Amz-Checksum-Sha1" encoder.SetHeader(locationName).String(*v.ChecksumSHA1) } - if v.ChecksumSHA256 != nil && len(*v.ChecksumSHA256) > 0 { + if v.ChecksumSHA256 != nil { locationName := "X-Amz-Checksum-Sha256" encoder.SetHeader(locationName).String(*v.ChecksumSHA256) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.IfNoneMatch != nil { + locationName := "If-None-Match" + encoder.SetHeader(locationName).String(*v.IfNoneMatch) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -213,17 +241,17 @@ func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteM encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -245,6 +273,10 @@ func (*awsRestxml_serializeOpCopyObject) ID() string { func (m *awsRestxml_serializeOpCopyObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -281,6 +313,8 @@ func (m *awsRestxml_serializeOpCopyObject) HandleSerialize(ctx context.Context, } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encoder *httpbinding.Encoder) error { @@ -293,12 +327,12 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.ACL)) } - if v.BucketKeyEnabled { + if v.BucketKeyEnabled != nil { locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" - encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) + encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled) } - if v.CacheControl != nil && len(*v.CacheControl) > 0 { + if v.CacheControl != nil { locationName := "Cache-Control" encoder.SetHeader(locationName).String(*v.CacheControl) } @@ -308,32 +342,32 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { + if v.ContentDisposition != nil { locationName := "Content-Disposition" encoder.SetHeader(locationName).String(*v.ContentDisposition) } - if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { + if v.ContentEncoding != nil { locationName := "Content-Encoding" encoder.SetHeader(locationName).String(*v.ContentEncoding) } - if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { + if v.ContentLanguage != nil { locationName := "Content-Language" encoder.SetHeader(locationName).String(*v.ContentLanguage) } - if v.ContentType != nil && len(*v.ContentType) > 0 { + if v.ContentType != nil { locationName := "Content-Type" encoder.SetHeader(locationName).String(*v.ContentType) } - if v.CopySource != nil && len(*v.CopySource) > 0 { + if v.CopySource != nil { locationName := "X-Amz-Copy-Source" encoder.SetHeader(locationName).String(*v.CopySource) } - if v.CopySourceIfMatch != nil && len(*v.CopySourceIfMatch) > 0 { + if v.CopySourceIfMatch != nil { locationName := "X-Amz-Copy-Source-If-Match" encoder.SetHeader(locationName).String(*v.CopySourceIfMatch) } @@ -343,7 +377,7 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince)) } - if v.CopySourceIfNoneMatch != nil && len(*v.CopySourceIfNoneMatch) > 0 { + if v.CopySourceIfNoneMatch != nil { locationName := "X-Amz-Copy-Source-If-None-Match" encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch) } @@ -353,27 +387,27 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince)) } - if v.CopySourceSSECustomerAlgorithm != nil && len(*v.CopySourceSSECustomerAlgorithm) > 0 { + if v.CopySourceSSECustomerAlgorithm != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm) } - if v.CopySourceSSECustomerKey != nil && len(*v.CopySourceSSECustomerKey) > 0 { + if v.CopySourceSSECustomerKey != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey) } - if v.CopySourceSSECustomerKeyMD5 != nil && len(*v.CopySourceSSECustomerKeyMD5) > 0 { + if v.CopySourceSSECustomerKeyMD5 != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.ExpectedSourceBucketOwner != nil && len(*v.ExpectedSourceBucketOwner) > 0 { + if v.ExpectedSourceBucketOwner != nil { locationName := "X-Amz-Source-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner) } @@ -383,22 +417,22 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } @@ -415,9 +449,7 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod if v.Metadata != nil { hv := encoder.Headers("X-Amz-Meta-") for mapKey, mapVal := range v.Metadata { - if len(mapVal) > 0 { - hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) - } + hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) } } @@ -451,27 +483,27 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } - if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { + if v.SSEKMSEncryptionContext != nil { locationName := "X-Amz-Server-Side-Encryption-Context" encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) } - if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { + if v.SSEKMSKeyId != nil { locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) } @@ -481,7 +513,7 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.StorageClass)) } - if v.Tagging != nil && len(*v.Tagging) > 0 { + if v.Tagging != nil { locationName := "X-Amz-Tagging" encoder.SetHeader(locationName).String(*v.Tagging) } @@ -491,7 +523,7 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.TaggingDirective)) } - if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { + if v.WebsiteRedirectLocation != nil { locationName := "X-Amz-Website-Redirect-Location" encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) } @@ -509,6 +541,10 @@ func (*awsRestxml_serializeOpCreateBucket) ID() string { func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -569,6 +605,8 @@ func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error { @@ -581,34 +619,34 @@ func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, e encoder.SetHeader(locationName).String(string(v.ACL)) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { + if v.GrantWrite != nil { locationName := "X-Amz-Grant-Write" encoder.SetHeader(locationName).String(*v.GrantWrite) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } - if v.ObjectLockEnabledForBucket { + if v.ObjectLockEnabledForBucket != nil { locationName := "X-Amz-Bucket-Object-Lock-Enabled" - encoder.SetHeader(locationName).Boolean(v.ObjectLockEnabledForBucket) + encoder.SetHeader(locationName).Boolean(*v.ObjectLockEnabledForBucket) } if len(v.ObjectOwnership) > 0 { @@ -619,6 +657,107 @@ func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, e return nil } +type awsRestxml_serializeOpCreateBucketMetadataTableConfiguration struct { +} + +func (*awsRestxml_serializeOpCreateBucketMetadataTableConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateBucketMetadataTableConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/?metadataTable") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsCreateBucketMetadataTableConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if input.MetadataTableConfiguration != nil { + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/xml") + } + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + payloadRootAttr := []smithyxml.Attr{} + payloadRoot := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "MetadataTableConfiguration", + }, + Attr: payloadRootAttr, + } + payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) + if err := awsRestxml_serializeDocumentMetadataTableConfiguration(input.MetadataTableConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + payload := bytes.NewReader(xmlEncoder.Bytes()) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsCreateBucketMetadataTableConfigurationInput(v *CreateBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ChecksumAlgorithm) > 0 { + locationName := "X-Amz-Sdk-Checksum-Algorithm" + encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) + } + + if v.ContentMD5 != nil { + locationName := "Content-Md5" + encoder.SetHeader(locationName).String(*v.ContentMD5) + } + + if v.ExpectedBucketOwner != nil { + locationName := "X-Amz-Expected-Bucket-Owner" + encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) + } + + return nil +} + type awsRestxml_serializeOpCreateMultipartUpload struct { } @@ -629,6 +768,10 @@ func (*awsRestxml_serializeOpCreateMultipartUpload) ID() string { func (m *awsRestxml_serializeOpCreateMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -640,7 +783,7 @@ func (m *awsRestxml_serializeOpCreateMultipartUpload) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/{Key+}?uploads&x-id=CreateMultipartUpload") + opPath, opQuery := httpbinding.SplitURI("/{Key+}?uploads") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -665,6 +808,8 @@ func (m *awsRestxml_serializeOpCreateMultipartUpload) HandleSerialize(ctx contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMultipartUploadInput, encoder *httpbinding.Encoder) error { @@ -677,12 +822,12 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti encoder.SetHeader(locationName).String(string(v.ACL)) } - if v.BucketKeyEnabled { + if v.BucketKeyEnabled != nil { locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" - encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) + encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled) } - if v.CacheControl != nil && len(*v.CacheControl) > 0 { + if v.CacheControl != nil { locationName := "Cache-Control" encoder.SetHeader(locationName).String(*v.CacheControl) } @@ -692,27 +837,27 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { + if v.ContentDisposition != nil { locationName := "Content-Disposition" encoder.SetHeader(locationName).String(*v.ContentDisposition) } - if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { + if v.ContentEncoding != nil { locationName := "Content-Encoding" encoder.SetHeader(locationName).String(*v.ContentEncoding) } - if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { + if v.ContentLanguage != nil { locationName := "Content-Language" encoder.SetHeader(locationName).String(*v.ContentLanguage) } - if v.ContentType != nil && len(*v.ContentType) > 0 { + if v.ContentType != nil { locationName := "Content-Type" encoder.SetHeader(locationName).String(*v.ContentType) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -722,22 +867,22 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } @@ -754,9 +899,7 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti if v.Metadata != nil { hv := encoder.Headers("X-Amz-Meta-") for mapKey, mapVal := range v.Metadata { - if len(mapVal) > 0 { - hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) - } + hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) } } @@ -785,27 +928,27 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } - if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { + if v.SSEKMSEncryptionContext != nil { locationName := "X-Amz-Server-Side-Encryption-Context" encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) } - if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { + if v.SSEKMSKeyId != nil { locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) } @@ -815,12 +958,12 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti encoder.SetHeader(locationName).String(string(v.StorageClass)) } - if v.Tagging != nil && len(*v.Tagging) > 0 { + if v.Tagging != nil { locationName := "X-Amz-Tagging" encoder.SetHeader(locationName).String(*v.Tagging) } - if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { + if v.WebsiteRedirectLocation != nil { locationName := "X-Amz-Website-Redirect-Location" encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) } @@ -828,6 +971,93 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti return nil } +type awsRestxml_serializeOpCreateSession struct { +} + +func (*awsRestxml_serializeOpCreateSession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/?session") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsCreateSessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsCreateSessionInput(v *CreateSessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BucketKeyEnabled != nil { + locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" + encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled) + } + + if len(v.ServerSideEncryption) > 0 { + locationName := "X-Amz-Server-Side-Encryption" + encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) + } + + if len(v.SessionMode) > 0 { + locationName := "X-Amz-Create-Session-Mode" + encoder.SetHeader(locationName).String(string(v.SessionMode)) + } + + if v.SSEKMSEncryptionContext != nil { + locationName := "X-Amz-Server-Side-Encryption-Context" + encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) + } + + if v.SSEKMSKeyId != nil { + locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" + encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) + } + + return nil +} + type awsRestxml_serializeOpDeleteBucket struct { } @@ -838,6 +1068,10 @@ func (*awsRestxml_serializeOpDeleteBucket) ID() string { func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -874,6 +1108,8 @@ func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error { @@ -881,7 +1117,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, e return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -899,6 +1135,10 @@ func (*awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) ID() string { func (m *awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -935,6 +1175,8 @@ func (m *awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) HandleSeriali } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(v *DeleteBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -942,7 +1184,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(v return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -964,6 +1206,10 @@ func (*awsRestxml_serializeOpDeleteBucketCors) ID() string { func (m *awsRestxml_serializeOpDeleteBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1000,6 +1246,8 @@ func (m *awsRestxml_serializeOpDeleteBucketCors) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(v *DeleteBucketCorsInput, encoder *httpbinding.Encoder) error { @@ -1007,7 +1255,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(v *DeleteBucketCors return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1025,6 +1273,10 @@ func (*awsRestxml_serializeOpDeleteBucketEncryption) ID() string { func (m *awsRestxml_serializeOpDeleteBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1061,6 +1313,8 @@ func (m *awsRestxml_serializeOpDeleteBucketEncryption) HandleSerialize(ctx conte } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(v *DeleteBucketEncryptionInput, encoder *httpbinding.Encoder) error { @@ -1068,7 +1322,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(v *DeleteBuck return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1086,6 +1340,10 @@ func (*awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) ID() s func (m *awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1122,6 +1380,8 @@ func (m *awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) Hand } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketIntelligentTieringConfigurationInput(v *DeleteBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { @@ -1146,6 +1406,10 @@ func (*awsRestxml_serializeOpDeleteBucketInventoryConfiguration) ID() string { func (m *awsRestxml_serializeOpDeleteBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1182,6 +1446,8 @@ func (m *awsRestxml_serializeOpDeleteBucketInventoryConfiguration) HandleSeriali } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(v *DeleteBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { @@ -1189,7 +1455,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(v return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1211,6 +1477,10 @@ func (*awsRestxml_serializeOpDeleteBucketLifecycle) ID() string { func (m *awsRestxml_serializeOpDeleteBucketLifecycle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1247,6 +1517,8 @@ func (m *awsRestxml_serializeOpDeleteBucketLifecycle) HandleSerialize(ctx contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(v *DeleteBucketLifecycleInput, encoder *httpbinding.Encoder) error { @@ -1254,7 +1526,74 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(v *DeleteBucke return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { + locationName := "X-Amz-Expected-Bucket-Owner" + encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) + } + + return nil +} + +type awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration struct { +} + +func (*awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteBucketMetadataTableConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/?metadataTable") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataTableConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsDeleteBucketMetadataTableConfigurationInput(v *DeleteBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1272,6 +1611,10 @@ func (*awsRestxml_serializeOpDeleteBucketMetricsConfiguration) ID() string { func (m *awsRestxml_serializeOpDeleteBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1308,6 +1651,8 @@ func (m *awsRestxml_serializeOpDeleteBucketMetricsConfiguration) HandleSerialize } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(v *DeleteBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -1315,7 +1660,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(v * return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1337,6 +1682,10 @@ func (*awsRestxml_serializeOpDeleteBucketOwnershipControls) ID() string { func (m *awsRestxml_serializeOpDeleteBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1373,6 +1722,8 @@ func (m *awsRestxml_serializeOpDeleteBucketOwnershipControls) HandleSerialize(ct } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(v *DeleteBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { @@ -1380,7 +1731,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(v *Del return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1398,6 +1749,10 @@ func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string { func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1434,6 +1789,8 @@ func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error { @@ -1441,7 +1798,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPo return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1459,6 +1816,10 @@ func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string { func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1495,6 +1856,8 @@ func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error { @@ -1502,7 +1865,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBuc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1520,6 +1883,10 @@ func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string { func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1556,6 +1923,8 @@ func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error { @@ -1563,7 +1932,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketT return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1581,6 +1950,10 @@ func (*awsRestxml_serializeOpDeleteBucketWebsite) ID() string { func (m *awsRestxml_serializeOpDeleteBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1617,6 +1990,8 @@ func (m *awsRestxml_serializeOpDeleteBucketWebsite) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(v *DeleteBucketWebsiteInput, encoder *httpbinding.Encoder) error { @@ -1624,7 +1999,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(v *DeleteBucketW return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1642,6 +2017,10 @@ func (*awsRestxml_serializeOpDeleteObject) ID() string { func (m *awsRestxml_serializeOpDeleteObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1678,6 +2057,8 @@ func (m *awsRestxml_serializeOpDeleteObject) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, encoder *httpbinding.Encoder) error { @@ -1685,16 +2066,31 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, e return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.BypassGovernanceRetention { + if v.BypassGovernanceRetention != nil { locationName := "X-Amz-Bypass-Governance-Retention" - encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) + encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.IfMatchLastModifiedTime != nil { + locationName := "X-Amz-If-Match-Last-Modified-Time" + encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchLastModifiedTime)) + } + + if v.IfMatchSize != nil { + locationName := "X-Amz-If-Match-Size" + encoder.SetHeader(locationName).Long(*v.IfMatchSize) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -1704,7 +2100,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, e } } - if v.MFA != nil && len(*v.MFA) > 0 { + if v.MFA != nil { locationName := "X-Amz-Mfa" encoder.SetHeader(locationName).String(*v.MFA) } @@ -1731,6 +2127,10 @@ func (*awsRestxml_serializeOpDeleteObjects) ID() string { func (m *awsRestxml_serializeOpDeleteObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1742,7 +2142,7 @@ func (m *awsRestxml_serializeOpDeleteObjects) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/?delete&x-id=DeleteObjects") + opPath, opQuery := httpbinding.SplitURI("/?delete") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1791,6 +2191,8 @@ func (m *awsRestxml_serializeOpDeleteObjects) HandleSerialize(ctx context.Contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(v *DeleteObjectsInput, encoder *httpbinding.Encoder) error { @@ -1798,9 +2200,9 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(v *DeleteObjectsInput, return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.BypassGovernanceRetention { + if v.BypassGovernanceRetention != nil { locationName := "X-Amz-Bypass-Governance-Retention" - encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) + encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention) } if len(v.ChecksumAlgorithm) > 0 { @@ -1808,12 +2210,12 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(v *DeleteObjectsInput, encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.MFA != nil && len(*v.MFA) > 0 { + if v.MFA != nil { locationName := "X-Amz-Mfa" encoder.SetHeader(locationName).String(*v.MFA) } @@ -1836,6 +2238,10 @@ func (*awsRestxml_serializeOpDeleteObjectTagging) ID() string { func (m *awsRestxml_serializeOpDeleteObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1872,6 +2278,8 @@ func (m *awsRestxml_serializeOpDeleteObjectTagging) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(v *DeleteObjectTaggingInput, encoder *httpbinding.Encoder) error { @@ -1879,7 +2287,7 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(v *DeleteObjectT return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1910,6 +2318,10 @@ func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string { func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -1946,6 +2358,8 @@ func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error { @@ -1953,7 +2367,7 @@ func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePub return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -1971,6 +2385,10 @@ func (*awsRestxml_serializeOpGetBucketAccelerateConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2007,6 +2425,8 @@ func (m *awsRestxml_serializeOpGetBucketAccelerateConfiguration) HandleSerialize } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(v *GetBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2014,7 +2434,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(v * return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2037,6 +2457,10 @@ func (*awsRestxml_serializeOpGetBucketAcl) ID() string { func (m *awsRestxml_serializeOpGetBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2073,6 +2497,8 @@ func (m *awsRestxml_serializeOpGetBucketAcl) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketAclInput(v *GetBucketAclInput, encoder *httpbinding.Encoder) error { @@ -2080,7 +2506,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketAclInput(v *GetBucketAclInput, e return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2098,6 +2524,10 @@ func (*awsRestxml_serializeOpGetBucketAnalyticsConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2134,6 +2564,8 @@ func (m *awsRestxml_serializeOpGetBucketAnalyticsConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(v *GetBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2141,7 +2573,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(v *G return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2163,6 +2595,10 @@ func (*awsRestxml_serializeOpGetBucketCors) ID() string { func (m *awsRestxml_serializeOpGetBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2199,6 +2635,8 @@ func (m *awsRestxml_serializeOpGetBucketCors) HandleSerialize(ctx context.Contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(v *GetBucketCorsInput, encoder *httpbinding.Encoder) error { @@ -2206,7 +2644,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(v *GetBucketCorsInput, return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2224,6 +2662,10 @@ func (*awsRestxml_serializeOpGetBucketEncryption) ID() string { func (m *awsRestxml_serializeOpGetBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2260,6 +2702,8 @@ func (m *awsRestxml_serializeOpGetBucketEncryption) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(v *GetBucketEncryptionInput, encoder *httpbinding.Encoder) error { @@ -2267,7 +2711,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(v *GetBucketEncr return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2285,6 +2729,10 @@ func (*awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) ID() stri func (m *awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2321,6 +2769,8 @@ func (m *awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) HandleS } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketIntelligentTieringConfigurationInput(v *GetBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2345,6 +2795,10 @@ func (*awsRestxml_serializeOpGetBucketInventoryConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2381,6 +2835,8 @@ func (m *awsRestxml_serializeOpGetBucketInventoryConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(v *GetBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2388,7 +2844,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(v *G return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2410,6 +2866,10 @@ func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2446,6 +2906,8 @@ func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2453,7 +2915,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *G return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2471,6 +2933,10 @@ func (*awsRestxml_serializeOpGetBucketLocation) ID() string { func (m *awsRestxml_serializeOpGetBucketLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2507,6 +2973,8 @@ func (m *awsRestxml_serializeOpGetBucketLocation) HandleSerialize(ctx context.Co } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(v *GetBucketLocationInput, encoder *httpbinding.Encoder) error { @@ -2514,7 +2982,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(v *GetBucketLocati return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2532,6 +3000,10 @@ func (*awsRestxml_serializeOpGetBucketLogging) ID() string { func (m *awsRestxml_serializeOpGetBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2568,6 +3040,8 @@ func (m *awsRestxml_serializeOpGetBucketLogging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(v *GetBucketLoggingInput, encoder *httpbinding.Encoder) error { @@ -2575,7 +3049,74 @@ func awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(v *GetBucketLogging return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { + locationName := "X-Amz-Expected-Bucket-Owner" + encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) + } + + return nil +} + +type awsRestxml_serializeOpGetBucketMetadataTableConfiguration struct { +} + +func (*awsRestxml_serializeOpGetBucketMetadataTableConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpGetBucketMetadataTableConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetBucketMetadataTableConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/?metadataTable") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsGetBucketMetadataTableConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsGetBucketMetadataTableConfigurationInput(v *GetBucketMetadataTableConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2593,6 +3134,10 @@ func (*awsRestxml_serializeOpGetBucketMetricsConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2629,6 +3174,8 @@ func (m *awsRestxml_serializeOpGetBucketMetricsConfiguration) HandleSerialize(ct } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(v *GetBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2636,7 +3183,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(v *Get return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2658,6 +3205,10 @@ func (*awsRestxml_serializeOpGetBucketNotificationConfiguration) ID() string { func (m *awsRestxml_serializeOpGetBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2694,6 +3245,8 @@ func (m *awsRestxml_serializeOpGetBucketNotificationConfiguration) HandleSeriali } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(v *GetBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error { @@ -2701,7 +3254,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(v return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2719,6 +3272,10 @@ func (*awsRestxml_serializeOpGetBucketOwnershipControls) ID() string { func (m *awsRestxml_serializeOpGetBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2755,6 +3312,8 @@ func (m *awsRestxml_serializeOpGetBucketOwnershipControls) HandleSerialize(ctx c } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(v *GetBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { @@ -2762,7 +3321,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(v *GetBuc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2780,6 +3339,10 @@ func (*awsRestxml_serializeOpGetBucketPolicy) ID() string { func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2816,6 +3379,8 @@ func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error { @@ -2823,7 +3388,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyIn return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2841,6 +3406,10 @@ func (*awsRestxml_serializeOpGetBucketPolicyStatus) ID() string { func (m *awsRestxml_serializeOpGetBucketPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2877,6 +3446,8 @@ func (m *awsRestxml_serializeOpGetBucketPolicyStatus) HandleSerialize(ctx contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(v *GetBucketPolicyStatusInput, encoder *httpbinding.Encoder) error { @@ -2884,7 +3455,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(v *GetBucketPo return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2902,6 +3473,10 @@ func (*awsRestxml_serializeOpGetBucketReplication) ID() string { func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2938,6 +3513,8 @@ func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error { @@ -2945,7 +3522,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketRep return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -2963,6 +3540,10 @@ func (*awsRestxml_serializeOpGetBucketRequestPayment) ID() string { func (m *awsRestxml_serializeOpGetBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -2999,6 +3580,8 @@ func (m *awsRestxml_serializeOpGetBucketRequestPayment) HandleSerialize(ctx cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(v *GetBucketRequestPaymentInput, encoder *httpbinding.Encoder) error { @@ -3006,7 +3589,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(v *GetBucket return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3024,6 +3607,10 @@ func (*awsRestxml_serializeOpGetBucketTagging) ID() string { func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3060,6 +3647,8 @@ func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error { @@ -3067,7 +3656,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTagging return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3085,6 +3674,10 @@ func (*awsRestxml_serializeOpGetBucketVersioning) ID() string { func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3121,6 +3714,8 @@ func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error { @@ -3128,7 +3723,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVers return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3146,6 +3741,10 @@ func (*awsRestxml_serializeOpGetBucketWebsite) ID() string { func (m *awsRestxml_serializeOpGetBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3182,6 +3781,8 @@ func (m *awsRestxml_serializeOpGetBucketWebsite) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(v *GetBucketWebsiteInput, encoder *httpbinding.Encoder) error { @@ -3189,7 +3790,7 @@ func awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(v *GetBucketWebsite return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3207,6 +3808,10 @@ func (*awsRestxml_serializeOpGetObject) ID() string { func (m *awsRestxml_serializeOpGetObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3243,6 +3848,8 @@ func (m *awsRestxml_serializeOpGetObject) HandleSerialize(ctx context.Context, i } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder *httpbinding.Encoder) error { @@ -3255,12 +3862,12 @@ func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder encoder.SetHeader(locationName).String(string(v.ChecksumMode)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.IfMatch != nil && len(*v.IfMatch) > 0 { + if v.IfMatch != nil { locationName := "If-Match" encoder.SetHeader(locationName).String(*v.IfMatch) } @@ -3270,7 +3877,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince)) } - if v.IfNoneMatch != nil && len(*v.IfNoneMatch) > 0 { + if v.IfNoneMatch != nil { locationName := "If-None-Match" encoder.SetHeader(locationName).String(*v.IfNoneMatch) } @@ -3289,11 +3896,11 @@ func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder } } - if v.PartNumber != 0 { - encoder.SetQuery("partNumber").Integer(v.PartNumber) + if v.PartNumber != nil { + encoder.SetQuery("partNumber").Integer(*v.PartNumber) } - if v.Range != nil && len(*v.Range) > 0 { + if v.Range != nil { locationName := "Range" encoder.SetHeader(locationName).String(*v.Range) } @@ -3327,17 +3934,17 @@ func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -3359,6 +3966,10 @@ func (*awsRestxml_serializeOpGetObjectAcl) ID() string { func (m *awsRestxml_serializeOpGetObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3395,6 +4006,8 @@ func (m *awsRestxml_serializeOpGetObjectAcl) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectAclInput(v *GetObjectAclInput, encoder *httpbinding.Encoder) error { @@ -3402,7 +4015,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectAclInput(v *GetObjectAclInput, e return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3438,6 +4051,10 @@ func (*awsRestxml_serializeOpGetObjectAttributes) ID() string { func (m *awsRestxml_serializeOpGetObjectAttributes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3474,6 +4091,8 @@ func (m *awsRestxml_serializeOpGetObjectAttributes) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttributesInput, encoder *httpbinding.Encoder) error { @@ -3481,7 +4100,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttr return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3495,13 +4114,16 @@ func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttr } } - if v.MaxParts != 0 { + if v.MaxParts != nil { locationName := "X-Amz-Max-Parts" - encoder.SetHeader(locationName).Integer(v.MaxParts) + encoder.SetHeader(locationName).Integer(*v.MaxParts) } if v.ObjectAttributes != nil { locationName := "X-Amz-Object-Attributes" + if len(v.ObjectAttributes) == 0 { + encoder.AddHeader(locationName).String("") + } for i := range v.ObjectAttributes { if len(v.ObjectAttributes[i]) > 0 { escaped := string(v.ObjectAttributes[i]) @@ -3514,7 +4136,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttr } } - if v.PartNumberMarker != nil && len(*v.PartNumberMarker) > 0 { + if v.PartNumberMarker != nil { locationName := "X-Amz-Part-Number-Marker" encoder.SetHeader(locationName).String(*v.PartNumberMarker) } @@ -3524,17 +4146,17 @@ func awsRestxml_serializeOpHttpBindingsGetObjectAttributesInput(v *GetObjectAttr encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -3556,6 +4178,10 @@ func (*awsRestxml_serializeOpGetObjectLegalHold) ID() string { func (m *awsRestxml_serializeOpGetObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3592,6 +4218,8 @@ func (m *awsRestxml_serializeOpGetObjectLegalHold) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(v *GetObjectLegalHoldInput, encoder *httpbinding.Encoder) error { @@ -3599,7 +4227,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(v *GetObjectLegal return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3635,6 +4263,10 @@ func (*awsRestxml_serializeOpGetObjectLockConfiguration) ID() string { func (m *awsRestxml_serializeOpGetObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3671,6 +4303,8 @@ func (m *awsRestxml_serializeOpGetObjectLockConfiguration) HandleSerialize(ctx c } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(v *GetObjectLockConfigurationInput, encoder *httpbinding.Encoder) error { @@ -3678,7 +4312,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(v *GetObj return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3696,6 +4330,10 @@ func (*awsRestxml_serializeOpGetObjectRetention) ID() string { func (m *awsRestxml_serializeOpGetObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3732,6 +4370,8 @@ func (m *awsRestxml_serializeOpGetObjectRetention) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(v *GetObjectRetentionInput, encoder *httpbinding.Encoder) error { @@ -3739,7 +4379,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(v *GetObjectReten return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3775,6 +4415,10 @@ func (*awsRestxml_serializeOpGetObjectTagging) ID() string { func (m *awsRestxml_serializeOpGetObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3811,6 +4455,8 @@ func (m *awsRestxml_serializeOpGetObjectTagging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(v *GetObjectTaggingInput, encoder *httpbinding.Encoder) error { @@ -3818,7 +4464,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(v *GetObjectTagging return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3854,6 +4500,10 @@ func (*awsRestxml_serializeOpGetObjectTorrent) ID() string { func (m *awsRestxml_serializeOpGetObjectTorrent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3890,6 +4540,8 @@ func (m *awsRestxml_serializeOpGetObjectTorrent) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(v *GetObjectTorrentInput, encoder *httpbinding.Encoder) error { @@ -3897,7 +4549,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(v *GetObjectTorrent return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3929,6 +4581,10 @@ func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string { func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -3965,6 +4621,8 @@ func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error { @@ -3972,7 +4630,7 @@ func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAcc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -3990,6 +4648,10 @@ func (*awsRestxml_serializeOpHeadBucket) ID() string { func (m *awsRestxml_serializeOpHeadBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4026,6 +4688,8 @@ func (m *awsRestxml_serializeOpHeadBucket) HandleSerialize(ctx context.Context, } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsHeadBucketInput(v *HeadBucketInput, encoder *httpbinding.Encoder) error { @@ -4033,7 +4697,7 @@ func awsRestxml_serializeOpHttpBindingsHeadBucketInput(v *HeadBucketInput, encod return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4051,6 +4715,10 @@ func (*awsRestxml_serializeOpHeadObject) ID() string { func (m *awsRestxml_serializeOpHeadObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4087,6 +4755,8 @@ func (m *awsRestxml_serializeOpHeadObject) HandleSerialize(ctx context.Context, } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encoder *httpbinding.Encoder) error { @@ -4099,12 +4769,12 @@ func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encod encoder.SetHeader(locationName).String(string(v.ChecksumMode)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.IfMatch != nil && len(*v.IfMatch) > 0 { + if v.IfMatch != nil { locationName := "If-Match" encoder.SetHeader(locationName).String(*v.IfMatch) } @@ -4114,7 +4784,7 @@ func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encod encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince)) } - if v.IfNoneMatch != nil && len(*v.IfNoneMatch) > 0 { + if v.IfNoneMatch != nil { locationName := "If-None-Match" encoder.SetHeader(locationName).String(*v.IfNoneMatch) } @@ -4133,11 +4803,11 @@ func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encod } } - if v.PartNumber != 0 { - encoder.SetQuery("partNumber").Integer(v.PartNumber) + if v.PartNumber != nil { + encoder.SetQuery("partNumber").Integer(*v.PartNumber) } - if v.Range != nil && len(*v.Range) > 0 { + if v.Range != nil { locationName := "Range" encoder.SetHeader(locationName).String(*v.Range) } @@ -4147,17 +4817,41 @@ func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encod encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.ResponseCacheControl != nil { + encoder.SetQuery("response-cache-control").String(*v.ResponseCacheControl) + } + + if v.ResponseContentDisposition != nil { + encoder.SetQuery("response-content-disposition").String(*v.ResponseContentDisposition) + } + + if v.ResponseContentEncoding != nil { + encoder.SetQuery("response-content-encoding").String(*v.ResponseContentEncoding) + } + + if v.ResponseContentLanguage != nil { + encoder.SetQuery("response-content-language").String(*v.ResponseContentLanguage) + } + + if v.ResponseContentType != nil { + encoder.SetQuery("response-content-type").String(*v.ResponseContentType) + } + + if v.ResponseExpires != nil { + encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires)) + } + + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -4179,6 +4873,10 @@ func (*awsRestxml_serializeOpListBucketAnalyticsConfigurations) ID() string { func (m *awsRestxml_serializeOpListBucketAnalyticsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4215,6 +4913,8 @@ func (m *awsRestxml_serializeOpListBucketAnalyticsConfigurations) HandleSerializ } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(v *ListBucketAnalyticsConfigurationsInput, encoder *httpbinding.Encoder) error { @@ -4226,7 +4926,7 @@ func awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(v encoder.SetQuery("continuation-token").String(*v.ContinuationToken) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4244,6 +4944,10 @@ func (*awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) ID() st func (m *awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4280,6 +4984,8 @@ func (m *awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) Handl } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListBucketIntelligentTieringConfigurationsInput(v *ListBucketIntelligentTieringConfigurationsInput, encoder *httpbinding.Encoder) error { @@ -4304,6 +5010,10 @@ func (*awsRestxml_serializeOpListBucketInventoryConfigurations) ID() string { func (m *awsRestxml_serializeOpListBucketInventoryConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4340,6 +5050,8 @@ func (m *awsRestxml_serializeOpListBucketInventoryConfigurations) HandleSerializ } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(v *ListBucketInventoryConfigurationsInput, encoder *httpbinding.Encoder) error { @@ -4351,7 +5063,7 @@ func awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(v encoder.SetQuery("continuation-token").String(*v.ContinuationToken) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4369,6 +5081,10 @@ func (*awsRestxml_serializeOpListBucketMetricsConfigurations) ID() string { func (m *awsRestxml_serializeOpListBucketMetricsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4405,6 +5121,8 @@ func (m *awsRestxml_serializeOpListBucketMetricsConfigurations) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(v *ListBucketMetricsConfigurationsInput, encoder *httpbinding.Encoder) error { @@ -4416,7 +5134,7 @@ func awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(v *L encoder.SetQuery("continuation-token").String(*v.ContinuationToken) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4434,6 +5152,10 @@ func (*awsRestxml_serializeOpListBuckets) ID() string { func (m *awsRestxml_serializeOpListBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4445,7 +5167,7 @@ func (m *awsRestxml_serializeOpListBuckets) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/") + opPath, opQuery := httpbinding.SplitURI("/?x-id=ListBuckets") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -4461,11 +5183,17 @@ func (m *awsRestxml_serializeOpListBuckets) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } + if err := awsRestxml_serializeOpHttpBindingsListBucketsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListBucketsInput(v *ListBucketsInput, encoder *httpbinding.Encoder) error { @@ -4473,6 +5201,92 @@ func awsRestxml_serializeOpHttpBindingsListBucketsInput(v *ListBucketsInput, enc return fmt.Errorf("unsupported serialization of nil %T", v) } + if v.BucketRegion != nil { + encoder.SetQuery("bucket-region").String(*v.BucketRegion) + } + + if v.ContinuationToken != nil { + encoder.SetQuery("continuation-token").String(*v.ContinuationToken) + } + + if v.MaxBuckets != nil { + encoder.SetQuery("max-buckets").Integer(*v.MaxBuckets) + } + + if v.Prefix != nil { + encoder.SetQuery("prefix").String(*v.Prefix) + } + + return nil +} + +type awsRestxml_serializeOpListDirectoryBuckets struct { +} + +func (*awsRestxml_serializeOpListDirectoryBuckets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpListDirectoryBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDirectoryBucketsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/?x-id=ListDirectoryBuckets") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsListDirectoryBucketsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsListDirectoryBucketsInput(v *ListDirectoryBucketsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContinuationToken != nil { + encoder.SetQuery("continuation-token").String(*v.ContinuationToken) + } + + if v.MaxDirectoryBuckets != nil { + encoder.SetQuery("max-directory-buckets").Integer(*v.MaxDirectoryBuckets) + } + return nil } @@ -4486,6 +5300,10 @@ func (*awsRestxml_serializeOpListMultipartUploads) ID() string { func (m *awsRestxml_serializeOpListMultipartUploads) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4522,6 +5340,8 @@ func (m *awsRestxml_serializeOpListMultipartUploads) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(v *ListMultipartUploadsInput, encoder *httpbinding.Encoder) error { @@ -4537,7 +5357,7 @@ func awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(v *ListMultipar encoder.SetQuery("encoding-type").String(string(v.EncodingType)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4546,8 +5366,8 @@ func awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(v *ListMultipar encoder.SetQuery("key-marker").String(*v.KeyMarker) } - if v.MaxUploads != 0 { - encoder.SetQuery("max-uploads").Integer(v.MaxUploads) + if v.MaxUploads != nil { + encoder.SetQuery("max-uploads").Integer(*v.MaxUploads) } if v.Prefix != nil { @@ -4576,6 +5396,10 @@ func (*awsRestxml_serializeOpListObjects) ID() string { func (m *awsRestxml_serializeOpListObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4612,6 +5436,8 @@ func (m *awsRestxml_serializeOpListObjects) HandleSerialize(ctx context.Context, } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListObjectsInput(v *ListObjectsInput, encoder *httpbinding.Encoder) error { @@ -4627,7 +5453,7 @@ func awsRestxml_serializeOpHttpBindingsListObjectsInput(v *ListObjectsInput, enc encoder.SetQuery("encoding-type").String(string(v.EncodingType)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4636,12 +5462,15 @@ func awsRestxml_serializeOpHttpBindingsListObjectsInput(v *ListObjectsInput, enc encoder.SetQuery("marker").String(*v.Marker) } - if v.MaxKeys != 0 { - encoder.SetQuery("max-keys").Integer(v.MaxKeys) + if v.MaxKeys != nil { + encoder.SetQuery("max-keys").Integer(*v.MaxKeys) } if v.OptionalObjectAttributes != nil { locationName := "X-Amz-Optional-Object-Attributes" + if len(v.OptionalObjectAttributes) == 0 { + encoder.AddHeader(locationName).String("") + } for i := range v.OptionalObjectAttributes { if len(v.OptionalObjectAttributes[i]) > 0 { escaped := string(v.OptionalObjectAttributes[i]) @@ -4676,6 +5505,10 @@ func (*awsRestxml_serializeOpListObjectsV2) ID() string { func (m *awsRestxml_serializeOpListObjectsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4712,6 +5545,8 @@ func (m *awsRestxml_serializeOpListObjectsV2) HandleSerialize(ctx context.Contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListObjectsV2Input(v *ListObjectsV2Input, encoder *httpbinding.Encoder) error { @@ -4731,21 +5566,24 @@ func awsRestxml_serializeOpHttpBindingsListObjectsV2Input(v *ListObjectsV2Input, encoder.SetQuery("encoding-type").String(string(v.EncodingType)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.FetchOwner { - encoder.SetQuery("fetch-owner").Boolean(v.FetchOwner) + if v.FetchOwner != nil { + encoder.SetQuery("fetch-owner").Boolean(*v.FetchOwner) } - if v.MaxKeys != 0 { - encoder.SetQuery("max-keys").Integer(v.MaxKeys) + if v.MaxKeys != nil { + encoder.SetQuery("max-keys").Integer(*v.MaxKeys) } if v.OptionalObjectAttributes != nil { locationName := "X-Amz-Optional-Object-Attributes" + if len(v.OptionalObjectAttributes) == 0 { + encoder.AddHeader(locationName).String("") + } for i := range v.OptionalObjectAttributes { if len(v.OptionalObjectAttributes[i]) > 0 { escaped := string(v.OptionalObjectAttributes[i]) @@ -4784,6 +5622,10 @@ func (*awsRestxml_serializeOpListObjectVersions) ID() string { func (m *awsRestxml_serializeOpListObjectVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4820,6 +5662,8 @@ func (m *awsRestxml_serializeOpListObjectVersions) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(v *ListObjectVersionsInput, encoder *httpbinding.Encoder) error { @@ -4835,7 +5679,7 @@ func awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(v *ListObjectVers encoder.SetQuery("encoding-type").String(string(v.EncodingType)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4844,12 +5688,15 @@ func awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(v *ListObjectVers encoder.SetQuery("key-marker").String(*v.KeyMarker) } - if v.MaxKeys != 0 { - encoder.SetQuery("max-keys").Integer(v.MaxKeys) + if v.MaxKeys != nil { + encoder.SetQuery("max-keys").Integer(*v.MaxKeys) } if v.OptionalObjectAttributes != nil { locationName := "X-Amz-Optional-Object-Attributes" + if len(v.OptionalObjectAttributes) == 0 { + encoder.AddHeader(locationName).String("") + } for i := range v.OptionalObjectAttributes { if len(v.OptionalObjectAttributes[i]) > 0 { escaped := string(v.OptionalObjectAttributes[i]) @@ -4888,6 +5735,10 @@ func (*awsRestxml_serializeOpListParts) ID() string { func (m *awsRestxml_serializeOpListParts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -4924,6 +5775,8 @@ func (m *awsRestxml_serializeOpListParts) HandleSerialize(ctx context.Context, i } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder *httpbinding.Encoder) error { @@ -4931,7 +5784,7 @@ func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -4945,8 +5798,8 @@ func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder } } - if v.MaxParts != 0 { - encoder.SetQuery("max-parts").Integer(v.MaxParts) + if v.MaxParts != nil { + encoder.SetQuery("max-parts").Integer(*v.MaxParts) } if v.PartNumberMarker != nil { @@ -4958,17 +5811,17 @@ func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -4990,6 +5843,10 @@ func (*awsRestxml_serializeOpPutBucketAccelerateConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5050,6 +5907,8 @@ func (m *awsRestxml_serializeOpPutBucketAccelerateConfiguration) HandleSerialize } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(v *PutBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5062,7 +5921,7 @@ func awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(v * encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5080,6 +5939,10 @@ func (*awsRestxml_serializeOpPutBucketAcl) ID() string { func (m *awsRestxml_serializeOpPutBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5140,6 +6003,8 @@ func (m *awsRestxml_serializeOpPutBucketAcl) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketAclInput(v *PutBucketAclInput, encoder *httpbinding.Encoder) error { @@ -5157,37 +6022,37 @@ func awsRestxml_serializeOpHttpBindingsPutBucketAclInput(v *PutBucketAclInput, e encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { + if v.GrantWrite != nil { locationName := "X-Amz-Grant-Write" encoder.SetHeader(locationName).String(*v.GrantWrite) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } @@ -5205,6 +6070,10 @@ func (*awsRestxml_serializeOpPutBucketAnalyticsConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5265,6 +6134,8 @@ func (m *awsRestxml_serializeOpPutBucketAnalyticsConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(v *PutBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5272,7 +6143,7 @@ func awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(v *P return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5294,6 +6165,10 @@ func (*awsRestxml_serializeOpPutBucketCors) ID() string { func (m *awsRestxml_serializeOpPutBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5354,6 +6229,8 @@ func (m *awsRestxml_serializeOpPutBucketCors) HandleSerialize(ctx context.Contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(v *PutBucketCorsInput, encoder *httpbinding.Encoder) error { @@ -5366,12 +6243,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(v *PutBucketCorsInput, encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5389,6 +6266,10 @@ func (*awsRestxml_serializeOpPutBucketEncryption) ID() string { func (m *awsRestxml_serializeOpPutBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5449,6 +6330,8 @@ func (m *awsRestxml_serializeOpPutBucketEncryption) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(v *PutBucketEncryptionInput, encoder *httpbinding.Encoder) error { @@ -5461,12 +6344,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(v *PutBucketEncr encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5484,6 +6367,10 @@ func (*awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) ID() stri func (m *awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5544,6 +6431,8 @@ func (m *awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) HandleS } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketIntelligentTieringConfigurationInput(v *PutBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5568,6 +6457,10 @@ func (*awsRestxml_serializeOpPutBucketInventoryConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5628,6 +6521,8 @@ func (m *awsRestxml_serializeOpPutBucketInventoryConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(v *PutBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5635,7 +6530,7 @@ func awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(v *P return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5657,6 +6552,10 @@ func (*awsRestxml_serializeOpPutBucketLifecycleConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5717,6 +6616,8 @@ func (m *awsRestxml_serializeOpPutBucketLifecycleConfiguration) HandleSerialize( } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(v *PutBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5729,11 +6630,16 @@ func awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(v *P encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if len(v.TransitionDefaultMinimumObjectSize) > 0 { + locationName := "X-Amz-Transition-Default-Minimum-Object-Size" + encoder.SetHeader(locationName).String(string(v.TransitionDefaultMinimumObjectSize)) + } + return nil } @@ -5747,6 +6653,10 @@ func (*awsRestxml_serializeOpPutBucketLogging) ID() string { func (m *awsRestxml_serializeOpPutBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5807,6 +6717,8 @@ func (m *awsRestxml_serializeOpPutBucketLogging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(v *PutBucketLoggingInput, encoder *httpbinding.Encoder) error { @@ -5819,12 +6731,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(v *PutBucketLogging encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5842,6 +6754,10 @@ func (*awsRestxml_serializeOpPutBucketMetricsConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5902,6 +6818,8 @@ func (m *awsRestxml_serializeOpPutBucketMetricsConfiguration) HandleSerialize(ct } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(v *PutBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5909,7 +6827,7 @@ func awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(v *Put return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -5931,6 +6849,10 @@ func (*awsRestxml_serializeOpPutBucketNotificationConfiguration) ID() string { func (m *awsRestxml_serializeOpPutBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -5991,6 +6913,8 @@ func (m *awsRestxml_serializeOpPutBucketNotificationConfiguration) HandleSeriali } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(v *PutBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error { @@ -5998,14 +6922,14 @@ func awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(v return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.SkipDestinationValidation { + if v.SkipDestinationValidation != nil { locationName := "X-Amz-Skip-Destination-Validation" - encoder.SetHeader(locationName).Boolean(v.SkipDestinationValidation) + encoder.SetHeader(locationName).Boolean(*v.SkipDestinationValidation) } return nil @@ -6021,6 +6945,10 @@ func (*awsRestxml_serializeOpPutBucketOwnershipControls) ID() string { func (m *awsRestxml_serializeOpPutBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6081,6 +7009,8 @@ func (m *awsRestxml_serializeOpPutBucketOwnershipControls) HandleSerialize(ctx c } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(v *PutBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { @@ -6088,12 +7018,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(v *PutBuc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6111,6 +7041,10 @@ func (*awsRestxml_serializeOpPutBucketPolicy) ID() string { func (m *awsRestxml_serializeOpPutBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6159,6 +7093,8 @@ func (m *awsRestxml_serializeOpPutBucketPolicy) HandleSerialize(ctx context.Cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(v *PutBucketPolicyInput, encoder *httpbinding.Encoder) error { @@ -6171,17 +7107,17 @@ func awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(v *PutBucketPolicyIn encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ConfirmRemoveSelfBucketAccess { + if v.ConfirmRemoveSelfBucketAccess != nil { locationName := "X-Amz-Confirm-Remove-Self-Bucket-Access" - encoder.SetHeader(locationName).Boolean(v.ConfirmRemoveSelfBucketAccess) + encoder.SetHeader(locationName).Boolean(*v.ConfirmRemoveSelfBucketAccess) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6199,6 +7135,10 @@ func (*awsRestxml_serializeOpPutBucketReplication) ID() string { func (m *awsRestxml_serializeOpPutBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6259,6 +7199,8 @@ func (m *awsRestxml_serializeOpPutBucketReplication) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(v *PutBucketReplicationInput, encoder *httpbinding.Encoder) error { @@ -6271,17 +7213,17 @@ func awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(v *PutBucketRep encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.Token != nil && len(*v.Token) > 0 { + if v.Token != nil { locationName := "X-Amz-Bucket-Object-Lock-Token" encoder.SetHeader(locationName).String(*v.Token) } @@ -6299,6 +7241,10 @@ func (*awsRestxml_serializeOpPutBucketRequestPayment) ID() string { func (m *awsRestxml_serializeOpPutBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6359,6 +7305,8 @@ func (m *awsRestxml_serializeOpPutBucketRequestPayment) HandleSerialize(ctx cont } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(v *PutBucketRequestPaymentInput, encoder *httpbinding.Encoder) error { @@ -6371,12 +7319,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(v *PutBucket encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6394,6 +7342,10 @@ func (*awsRestxml_serializeOpPutBucketTagging) ID() string { func (m *awsRestxml_serializeOpPutBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6454,6 +7406,8 @@ func (m *awsRestxml_serializeOpPutBucketTagging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(v *PutBucketTaggingInput, encoder *httpbinding.Encoder) error { @@ -6466,12 +7420,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(v *PutBucketTagging encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6489,6 +7443,10 @@ func (*awsRestxml_serializeOpPutBucketVersioning) ID() string { func (m *awsRestxml_serializeOpPutBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6549,6 +7507,8 @@ func (m *awsRestxml_serializeOpPutBucketVersioning) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(v *PutBucketVersioningInput, encoder *httpbinding.Encoder) error { @@ -6561,17 +7521,17 @@ func awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(v *PutBucketVers encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.MFA != nil && len(*v.MFA) > 0 { + if v.MFA != nil { locationName := "X-Amz-Mfa" encoder.SetHeader(locationName).String(*v.MFA) } @@ -6589,6 +7549,10 @@ func (*awsRestxml_serializeOpPutBucketWebsite) ID() string { func (m *awsRestxml_serializeOpPutBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6649,6 +7613,8 @@ func (m *awsRestxml_serializeOpPutBucketWebsite) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(v *PutBucketWebsiteInput, encoder *httpbinding.Encoder) error { @@ -6661,12 +7627,12 @@ func awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(v *PutBucketWebsite encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6684,6 +7650,10 @@ func (*awsRestxml_serializeOpPutObject) ID() string { func (m *awsRestxml_serializeOpPutObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6732,6 +7702,8 @@ func (m *awsRestxml_serializeOpPutObject) HandleSerialize(ctx context.Context, i } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder *httpbinding.Encoder) error { @@ -6744,12 +7716,12 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(string(v.ACL)) } - if v.BucketKeyEnabled { + if v.BucketKeyEnabled != nil { locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" - encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) + encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled) } - if v.CacheControl != nil && len(*v.CacheControl) > 0 { + if v.CacheControl != nil { locationName := "Cache-Control" encoder.SetHeader(locationName).String(*v.CacheControl) } @@ -6759,57 +7731,57 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ChecksumCRC32 != nil && len(*v.ChecksumCRC32) > 0 { + if v.ChecksumCRC32 != nil { locationName := "X-Amz-Checksum-Crc32" encoder.SetHeader(locationName).String(*v.ChecksumCRC32) } - if v.ChecksumCRC32C != nil && len(*v.ChecksumCRC32C) > 0 { + if v.ChecksumCRC32C != nil { locationName := "X-Amz-Checksum-Crc32c" encoder.SetHeader(locationName).String(*v.ChecksumCRC32C) } - if v.ChecksumSHA1 != nil && len(*v.ChecksumSHA1) > 0 { + if v.ChecksumSHA1 != nil { locationName := "X-Amz-Checksum-Sha1" encoder.SetHeader(locationName).String(*v.ChecksumSHA1) } - if v.ChecksumSHA256 != nil && len(*v.ChecksumSHA256) > 0 { + if v.ChecksumSHA256 != nil { locationName := "X-Amz-Checksum-Sha256" encoder.SetHeader(locationName).String(*v.ChecksumSHA256) } - if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { + if v.ContentDisposition != nil { locationName := "Content-Disposition" encoder.SetHeader(locationName).String(*v.ContentDisposition) } - if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { + if v.ContentEncoding != nil { locationName := "Content-Encoding" encoder.SetHeader(locationName).String(*v.ContentEncoding) } - if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { + if v.ContentLanguage != nil { locationName := "Content-Language" encoder.SetHeader(locationName).String(*v.ContentLanguage) } - if v.ContentLength != 0 { + if v.ContentLength != nil { locationName := "Content-Length" - encoder.SetHeader(locationName).Long(v.ContentLength) + encoder.SetHeader(locationName).Long(*v.ContentLength) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ContentType != nil && len(*v.ContentType) > 0 { + if v.ContentType != nil { locationName := "Content-Type" encoder.SetHeader(locationName).String(*v.ContentType) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -6819,26 +7791,36 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.IfNoneMatch != nil { + locationName := "If-None-Match" + encoder.SetHeader(locationName).String(*v.IfNoneMatch) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -6851,9 +7833,7 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder if v.Metadata != nil { hv := encoder.Headers("X-Amz-Meta-") for mapKey, mapVal := range v.Metadata { - if len(mapVal) > 0 { - hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) - } + hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) } } @@ -6882,27 +7862,27 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } - if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { + if v.SSEKMSEncryptionContext != nil { locationName := "X-Amz-Server-Side-Encryption-Context" encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) } - if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { + if v.SSEKMSKeyId != nil { locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) } @@ -6912,16 +7892,21 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(string(v.StorageClass)) } - if v.Tagging != nil && len(*v.Tagging) > 0 { + if v.Tagging != nil { locationName := "X-Amz-Tagging" encoder.SetHeader(locationName).String(*v.Tagging) } - if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { + if v.WebsiteRedirectLocation != nil { locationName := "X-Amz-Website-Redirect-Location" encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) } + if v.WriteOffsetBytes != nil { + locationName := "X-Amz-Write-Offset-Bytes" + encoder.SetHeader(locationName).Long(*v.WriteOffsetBytes) + } + return nil } @@ -6935,6 +7920,10 @@ func (*awsRestxml_serializeOpPutObjectAcl) ID() string { func (m *awsRestxml_serializeOpPutObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -6995,6 +7984,8 @@ func (m *awsRestxml_serializeOpPutObjectAcl) HandleSerialize(ctx context.Context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectAclInput(v *PutObjectAclInput, encoder *httpbinding.Encoder) error { @@ -7012,37 +8003,37 @@ func awsRestxml_serializeOpHttpBindingsPutObjectAclInput(v *PutObjectAclInput, e encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { + if v.GrantFullControl != nil { locationName := "X-Amz-Grant-Full-Control" encoder.SetHeader(locationName).String(*v.GrantFullControl) } - if v.GrantRead != nil && len(*v.GrantRead) > 0 { + if v.GrantRead != nil { locationName := "X-Amz-Grant-Read" encoder.SetHeader(locationName).String(*v.GrantRead) } - if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { + if v.GrantReadACP != nil { locationName := "X-Amz-Grant-Read-Acp" encoder.SetHeader(locationName).String(*v.GrantReadACP) } - if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { + if v.GrantWrite != nil { locationName := "X-Amz-Grant-Write" encoder.SetHeader(locationName).String(*v.GrantWrite) } - if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { + if v.GrantWriteACP != nil { locationName := "X-Amz-Grant-Write-Acp" encoder.SetHeader(locationName).String(*v.GrantWriteACP) } @@ -7078,6 +8069,10 @@ func (*awsRestxml_serializeOpPutObjectLegalHold) ID() string { func (m *awsRestxml_serializeOpPutObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7138,6 +8133,8 @@ func (m *awsRestxml_serializeOpPutObjectLegalHold) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(v *PutObjectLegalHoldInput, encoder *httpbinding.Encoder) error { @@ -7150,12 +8147,12 @@ func awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(v *PutObjectLegal encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7191,6 +8188,10 @@ func (*awsRestxml_serializeOpPutObjectLockConfiguration) ID() string { func (m *awsRestxml_serializeOpPutObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7251,6 +8252,8 @@ func (m *awsRestxml_serializeOpPutObjectLockConfiguration) HandleSerialize(ctx c } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(v *PutObjectLockConfigurationInput, encoder *httpbinding.Encoder) error { @@ -7263,12 +8266,12 @@ func awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(v *PutObj encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7278,7 +8281,7 @@ func awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(v *PutObj encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.Token != nil && len(*v.Token) > 0 { + if v.Token != nil { locationName := "X-Amz-Bucket-Object-Lock-Token" encoder.SetHeader(locationName).String(*v.Token) } @@ -7296,6 +8299,10 @@ func (*awsRestxml_serializeOpPutObjectRetention) ID() string { func (m *awsRestxml_serializeOpPutObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7356,6 +8363,8 @@ func (m *awsRestxml_serializeOpPutObjectRetention) HandleSerialize(ctx context.C } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(v *PutObjectRetentionInput, encoder *httpbinding.Encoder) error { @@ -7363,9 +8372,9 @@ func awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(v *PutObjectReten return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.BypassGovernanceRetention { + if v.BypassGovernanceRetention != nil { locationName := "X-Amz-Bypass-Governance-Retention" - encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) + encoder.SetHeader(locationName).Boolean(*v.BypassGovernanceRetention) } if len(v.ChecksumAlgorithm) > 0 { @@ -7373,12 +8382,12 @@ func awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(v *PutObjectReten encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7414,6 +8423,10 @@ func (*awsRestxml_serializeOpPutObjectTagging) ID() string { func (m *awsRestxml_serializeOpPutObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7474,6 +8487,8 @@ func (m *awsRestxml_serializeOpPutObjectTagging) HandleSerialize(ctx context.Con } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(v *PutObjectTaggingInput, encoder *httpbinding.Encoder) error { @@ -7486,12 +8501,12 @@ func awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(v *PutObjectTagging encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7527,6 +8542,10 @@ func (*awsRestxml_serializeOpPutPublicAccessBlock) ID() string { func (m *awsRestxml_serializeOpPutPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7587,6 +8606,8 @@ func (m *awsRestxml_serializeOpPutPublicAccessBlock) HandleSerialize(ctx context } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(v *PutPublicAccessBlockInput, encoder *httpbinding.Encoder) error { @@ -7599,12 +8620,12 @@ func awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(v *PutPublicAcc encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7622,6 +8643,10 @@ func (*awsRestxml_serializeOpRestoreObject) ID() string { func (m *awsRestxml_serializeOpRestoreObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7633,7 +8658,7 @@ func (m *awsRestxml_serializeOpRestoreObject) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/{Key+}?restore&x-id=RestoreObject") + opPath, opQuery := httpbinding.SplitURI("/{Key+}?restore") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -7682,6 +8707,8 @@ func (m *awsRestxml_serializeOpRestoreObject) HandleSerialize(ctx context.Contex } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsRestoreObjectInput(v *RestoreObjectInput, encoder *httpbinding.Encoder) error { @@ -7694,7 +8721,7 @@ func awsRestxml_serializeOpHttpBindingsRestoreObjectInput(v *RestoreObjectInput, encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7730,6 +8757,10 @@ func (*awsRestxml_serializeOpSelectObjectContent) ID() string { func (m *awsRestxml_serializeOpSelectObjectContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7741,7 +8772,7 @@ func (m *awsRestxml_serializeOpSelectObjectContent) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/{Key+}?select&select-type=2&x-id=SelectObjectContent") + opPath, opQuery := httpbinding.SplitURI("/{Key+}?select&select-type=2") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -7784,6 +8815,8 @@ func (m *awsRestxml_serializeOpSelectObjectContent) HandleSerialize(ctx context. } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsSelectObjectContentInput(v *SelectObjectContentInput, encoder *httpbinding.Encoder) error { @@ -7791,7 +8824,7 @@ func awsRestxml_serializeOpHttpBindingsSelectObjectContentInput(v *SelectObjectC return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -7805,17 +8838,17 @@ func awsRestxml_serializeOpHttpBindingsSelectObjectContentInput(v *SelectObjectC } } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -7912,6 +8945,10 @@ func (*awsRestxml_serializeOpUploadPart) ID() string { func (m *awsRestxml_serializeOpUploadPart) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -7960,6 +8997,8 @@ func (m *awsRestxml_serializeOpUploadPart) HandleSerialize(ctx context.Context, } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encoder *httpbinding.Encoder) error { @@ -7972,37 +9011,37 @@ func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encod encoder.SetHeader(locationName).String(string(v.ChecksumAlgorithm)) } - if v.ChecksumCRC32 != nil && len(*v.ChecksumCRC32) > 0 { + if v.ChecksumCRC32 != nil { locationName := "X-Amz-Checksum-Crc32" encoder.SetHeader(locationName).String(*v.ChecksumCRC32) } - if v.ChecksumCRC32C != nil && len(*v.ChecksumCRC32C) > 0 { + if v.ChecksumCRC32C != nil { locationName := "X-Amz-Checksum-Crc32c" encoder.SetHeader(locationName).String(*v.ChecksumCRC32C) } - if v.ChecksumSHA1 != nil && len(*v.ChecksumSHA1) > 0 { + if v.ChecksumSHA1 != nil { locationName := "X-Amz-Checksum-Sha1" encoder.SetHeader(locationName).String(*v.ChecksumSHA1) } - if v.ChecksumSHA256 != nil && len(*v.ChecksumSHA256) > 0 { + if v.ChecksumSHA256 != nil { locationName := "X-Amz-Checksum-Sha256" encoder.SetHeader(locationName).String(*v.ChecksumSHA256) } - if v.ContentLength != 0 { + if v.ContentLength != nil { locationName := "Content-Length" - encoder.SetHeader(locationName).Long(v.ContentLength) + encoder.SetHeader(locationName).Long(*v.ContentLength) } - if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { + if v.ContentMD5 != nil { locationName := "Content-Md5" encoder.SetHeader(locationName).String(*v.ContentMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } @@ -8016,8 +9055,8 @@ func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encod } } - { - encoder.SetQuery("partNumber").Integer(v.PartNumber) + if v.PartNumber != nil { + encoder.SetQuery("partNumber").Integer(*v.PartNumber) } if len(v.RequestPayer) > 0 { @@ -8025,17 +9064,17 @@ func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encod encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -8057,6 +9096,10 @@ func (*awsRestxml_serializeOpUploadPartCopy) ID() string { func (m *awsRestxml_serializeOpUploadPartCopy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -8093,6 +9136,8 @@ func (m *awsRestxml_serializeOpUploadPartCopy) HandleSerialize(ctx context.Conte } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInput, encoder *httpbinding.Encoder) error { @@ -8100,12 +9145,12 @@ func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInpu return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.CopySource != nil && len(*v.CopySource) > 0 { + if v.CopySource != nil { locationName := "X-Amz-Copy-Source" encoder.SetHeader(locationName).String(*v.CopySource) } - if v.CopySourceIfMatch != nil && len(*v.CopySourceIfMatch) > 0 { + if v.CopySourceIfMatch != nil { locationName := "X-Amz-Copy-Source-If-Match" encoder.SetHeader(locationName).String(*v.CopySourceIfMatch) } @@ -8115,7 +9160,7 @@ func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInpu encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince)) } - if v.CopySourceIfNoneMatch != nil && len(*v.CopySourceIfNoneMatch) > 0 { + if v.CopySourceIfNoneMatch != nil { locationName := "X-Amz-Copy-Source-If-None-Match" encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch) } @@ -8125,32 +9170,32 @@ func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInpu encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince)) } - if v.CopySourceRange != nil && len(*v.CopySourceRange) > 0 { + if v.CopySourceRange != nil { locationName := "X-Amz-Copy-Source-Range" encoder.SetHeader(locationName).String(*v.CopySourceRange) } - if v.CopySourceSSECustomerAlgorithm != nil && len(*v.CopySourceSSECustomerAlgorithm) > 0 { + if v.CopySourceSSECustomerAlgorithm != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm) } - if v.CopySourceSSECustomerKey != nil && len(*v.CopySourceSSECustomerKey) > 0 { + if v.CopySourceSSECustomerKey != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey) } - if v.CopySourceSSECustomerKeyMD5 != nil && len(*v.CopySourceSSECustomerKeyMD5) > 0 { + if v.CopySourceSSECustomerKeyMD5 != nil { locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5) } - if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { + if v.ExpectedBucketOwner != nil { locationName := "X-Amz-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } - if v.ExpectedSourceBucketOwner != nil && len(*v.ExpectedSourceBucketOwner) > 0 { + if v.ExpectedSourceBucketOwner != nil { locationName := "X-Amz-Source-Expected-Bucket-Owner" encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner) } @@ -8164,8 +9209,8 @@ func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInpu } } - { - encoder.SetQuery("partNumber").Integer(v.PartNumber) + if v.PartNumber != nil { + encoder.SetQuery("partNumber").Integer(*v.PartNumber) } if len(v.RequestPayer) > 0 { @@ -8173,17 +9218,17 @@ func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInpu encoder.SetHeader(locationName).String(string(v.RequestPayer)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { + if v.SSECustomerKey != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key" encoder.SetHeader(locationName).String(*v.SSECustomerKey) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } @@ -8205,6 +9250,10 @@ func (*awsRestxml_serializeOpWriteGetObjectResponse) ID() string { func (m *awsRestxml_serializeOpWriteGetObjectResponse) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} @@ -8216,7 +9265,7 @@ func (m *awsRestxml_serializeOpWriteGetObjectResponse) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/WriteGetObjectResponse?x-id=WriteGetObjectResponse") + opPath, opQuery := httpbinding.SplitURI("/WriteGetObjectResponse") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -8253,6 +9302,8 @@ func (m *awsRestxml_serializeOpWriteGetObjectResponse) HandleSerialize(ctx conte } in.Request = request + endTimer() + span.End() return next.HandleSerialize(ctx, in) } func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetObjectResponseInput, encoder *httpbinding.Encoder) error { @@ -8260,92 +9311,92 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AcceptRanges != nil && len(*v.AcceptRanges) > 0 { + if v.AcceptRanges != nil { locationName := "X-Amz-Fwd-Header-Accept-Ranges" encoder.SetHeader(locationName).String(*v.AcceptRanges) } - if v.BucketKeyEnabled { + if v.BucketKeyEnabled != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" - encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) + encoder.SetHeader(locationName).Boolean(*v.BucketKeyEnabled) } - if v.CacheControl != nil && len(*v.CacheControl) > 0 { + if v.CacheControl != nil { locationName := "X-Amz-Fwd-Header-Cache-Control" encoder.SetHeader(locationName).String(*v.CacheControl) } - if v.ChecksumCRC32 != nil && len(*v.ChecksumCRC32) > 0 { + if v.ChecksumCRC32 != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Crc32" encoder.SetHeader(locationName).String(*v.ChecksumCRC32) } - if v.ChecksumCRC32C != nil && len(*v.ChecksumCRC32C) > 0 { + if v.ChecksumCRC32C != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Crc32c" encoder.SetHeader(locationName).String(*v.ChecksumCRC32C) } - if v.ChecksumSHA1 != nil && len(*v.ChecksumSHA1) > 0 { + if v.ChecksumSHA1 != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Sha1" encoder.SetHeader(locationName).String(*v.ChecksumSHA1) } - if v.ChecksumSHA256 != nil && len(*v.ChecksumSHA256) > 0 { + if v.ChecksumSHA256 != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Checksum-Sha256" encoder.SetHeader(locationName).String(*v.ChecksumSHA256) } - if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { + if v.ContentDisposition != nil { locationName := "X-Amz-Fwd-Header-Content-Disposition" encoder.SetHeader(locationName).String(*v.ContentDisposition) } - if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { + if v.ContentEncoding != nil { locationName := "X-Amz-Fwd-Header-Content-Encoding" encoder.SetHeader(locationName).String(*v.ContentEncoding) } - if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { + if v.ContentLanguage != nil { locationName := "X-Amz-Fwd-Header-Content-Language" encoder.SetHeader(locationName).String(*v.ContentLanguage) } - if v.ContentLength != 0 { + if v.ContentLength != nil { locationName := "Content-Length" - encoder.SetHeader(locationName).Long(v.ContentLength) + encoder.SetHeader(locationName).Long(*v.ContentLength) } - if v.ContentRange != nil && len(*v.ContentRange) > 0 { + if v.ContentRange != nil { locationName := "X-Amz-Fwd-Header-Content-Range" encoder.SetHeader(locationName).String(*v.ContentRange) } - if v.ContentType != nil && len(*v.ContentType) > 0 { + if v.ContentType != nil { locationName := "X-Amz-Fwd-Header-Content-Type" encoder.SetHeader(locationName).String(*v.ContentType) } - if v.DeleteMarker { + if v.DeleteMarker != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Delete-Marker" - encoder.SetHeader(locationName).Boolean(v.DeleteMarker) + encoder.SetHeader(locationName).Boolean(*v.DeleteMarker) } - if v.ErrorCode != nil && len(*v.ErrorCode) > 0 { + if v.ErrorCode != nil { locationName := "X-Amz-Fwd-Error-Code" encoder.SetHeader(locationName).String(*v.ErrorCode) } - if v.ErrorMessage != nil && len(*v.ErrorMessage) > 0 { + if v.ErrorMessage != nil { locationName := "X-Amz-Fwd-Error-Message" encoder.SetHeader(locationName).String(*v.ErrorMessage) } - if v.ETag != nil && len(*v.ETag) > 0 { + if v.ETag != nil { locationName := "X-Amz-Fwd-Header-Etag" encoder.SetHeader(locationName).String(*v.ETag) } - if v.Expiration != nil && len(*v.Expiration) > 0 { + if v.Expiration != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Expiration" encoder.SetHeader(locationName).String(*v.Expiration) } @@ -8363,15 +9414,13 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb if v.Metadata != nil { hv := encoder.Headers("X-Amz-Meta-") for mapKey, mapVal := range v.Metadata { - if len(mapVal) > 0 { - hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) - } + hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) } } - if v.MissingMeta != 0 { + if v.MissingMeta != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Missing-Meta" - encoder.SetHeader(locationName).Integer(v.MissingMeta) + encoder.SetHeader(locationName).Integer(*v.MissingMeta) } if len(v.ObjectLockLegalHoldStatus) > 0 { @@ -8389,9 +9438,9 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate)) } - if v.PartsCount != 0 { + if v.PartsCount != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Mp-Parts-Count" - encoder.SetHeader(locationName).Integer(v.PartsCount) + encoder.SetHeader(locationName).Integer(*v.PartsCount) } if len(v.ReplicationStatus) > 0 { @@ -8404,17 +9453,17 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb encoder.SetHeader(locationName).String(string(v.RequestCharged)) } - if v.RequestRoute != nil && len(*v.RequestRoute) > 0 { + if v.RequestRoute != nil { locationName := "X-Amz-Request-Route" encoder.SetHeader(locationName).String(*v.RequestRoute) } - if v.RequestToken != nil && len(*v.RequestToken) > 0 { + if v.RequestToken != nil { locationName := "X-Amz-Request-Token" encoder.SetHeader(locationName).String(*v.RequestToken) } - if v.Restore != nil && len(*v.Restore) > 0 { + if v.Restore != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Restore" encoder.SetHeader(locationName).String(*v.Restore) } @@ -8424,24 +9473,24 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) } - if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { + if v.SSECustomerAlgorithm != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Customer-Algorithm" encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) } - if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { + if v.SSECustomerKeyMD5 != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Customer-Key-Md5" encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) } - if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { + if v.SSEKMSKeyId != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) } - if v.StatusCode != 0 { + if v.StatusCode != nil { locationName := "X-Amz-Fwd-Status" - encoder.SetHeader(locationName).Integer(v.StatusCode) + encoder.SetHeader(locationName).Integer(*v.StatusCode) } if len(v.StorageClass) > 0 { @@ -8449,12 +9498,12 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb encoder.SetHeader(locationName).String(string(v.StorageClass)) } - if v.TagCount != 0 { + if v.TagCount != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Tagging-Count" - encoder.SetHeader(locationName).Integer(v.TagCount) + encoder.SetHeader(locationName).Integer(*v.TagCount) } - if v.VersionId != nil && len(*v.VersionId) > 0 { + if v.VersionId != nil { locationName := "X-Amz-Fwd-Header-X-Amz-Version-Id" encoder.SetHeader(locationName).String(*v.VersionId) } @@ -8464,7 +9513,7 @@ func awsRestxml_serializeOpHttpBindingsWriteGetObjectResponseInput(v *WriteGetOb func awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v *types.AbortIncompleteMultipartUpload, value smithyxml.Value) error { defer value.Close() - if v.DaysAfterInitiation != 0 { + if v.DaysAfterInitiation != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -8473,7 +9522,7 @@ func awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v *types.AbortIn Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.DaysAfterInitiation) + el.Integer(*v.DaysAfterInitiation) } return nil } @@ -8765,6 +9814,33 @@ func awsRestxml_serializeDocumentAnalyticsS3BucketDestination(v *types.Analytics return nil } +func awsRestxml_serializeDocumentBucketInfo(v *types.BucketInfo, value smithyxml.Value) error { + defer value.Close() + if len(v.DataRedundancy) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "DataRedundancy", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.DataRedundancy)) + } + if len(v.Type) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Type", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.Type)) + } + return nil +} + func awsRestxml_serializeDocumentBucketLifecycleConfiguration(v *types.BucketLifecycleConfiguration, value smithyxml.Value) error { defer value.Close() if v.Rules != nil { @@ -8876,7 +9952,7 @@ func awsRestxml_serializeDocumentCompletedPart(v *types.CompletedPart, value smi el := value.MemberElement(root) el.String(*v.ETag) } - if v.PartNumber != 0 { + if v.PartNumber != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -8885,7 +9961,7 @@ func awsRestxml_serializeDocumentCompletedPart(v *types.CompletedPart, value smi Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.PartNumber) + el.Integer(*v.PartNumber) } return nil } @@ -9015,37 +10091,63 @@ func awsRestxml_serializeDocumentCORSRule(v *types.CORSRule, value smithyxml.Val el := value.MemberElement(root) el.String(*v.ID) } - if v.MaxAgeSeconds != 0 { + if v.MaxAgeSeconds != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "MaxAgeSeconds", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.MaxAgeSeconds) + } + return nil +} + +func awsRestxml_serializeDocumentCORSRules(v []types.CORSRule, value smithyxml.Value) error { + var array *smithyxml.Array + if !value.IsFlattened() { + defer value.Close() + } + array = value.Array() + for i := range v { + am := array.Member() + if err := awsRestxml_serializeDocumentCORSRule(&v[i], am); err != nil { + return err + } + } + return nil +} + +func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucketConfiguration, value smithyxml.Value) error { + defer value.Close() + if v.Bucket != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Bucket", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentBucketInfo(v.Bucket, el); err != nil { + return err + } + } + if v.Location != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "MaxAgeSeconds", + Local: "Location", }, Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.MaxAgeSeconds) - } - return nil -} - -func awsRestxml_serializeDocumentCORSRules(v []types.CORSRule, value smithyxml.Value) error { - var array *smithyxml.Array - if !value.IsFlattened() { - defer value.Close() - } - array = value.Array() - for i := range v { - am := array.Member() - if err := awsRestxml_serializeDocumentCORSRule(&v[i], am); err != nil { + if err := awsRestxml_serializeDocumentLocationInfo(v.Location, el); err != nil { return err } } - return nil -} - -func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucketConfiguration, value smithyxml.Value) error { - defer value.Close() if len(v.LocationConstraint) > 0 { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -9062,7 +10164,7 @@ func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucket func awsRestxml_serializeDocumentCSVInput(v *types.CSVInput, value smithyxml.Value) error { defer value.Close() - if v.AllowQuotedRecordDelimiter { + if v.AllowQuotedRecordDelimiter != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -9071,7 +10173,7 @@ func awsRestxml_serializeDocumentCSVInput(v *types.CSVInput, value smithyxml.Val Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.AllowQuotedRecordDelimiter) + el.Boolean(*v.AllowQuotedRecordDelimiter) } if v.Comments != nil { rootAttr := []smithyxml.Attr{} @@ -9204,7 +10306,7 @@ func awsRestxml_serializeDocumentCSVOutput(v *types.CSVOutput, value smithyxml.V func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, value smithyxml.Value) error { defer value.Close() - if v.Days != 0 { + if v.Days != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -9213,7 +10315,7 @@ func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, val Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Days) + el.Integer(*v.Days) } if len(v.Mode) > 0 { rootAttr := []smithyxml.Attr{} @@ -9226,7 +10328,7 @@ func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, val el := value.MemberElement(root) el.String(string(v.Mode)) } - if v.Years != 0 { + if v.Years != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -9235,7 +10337,7 @@ func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, val Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Years) + el.Integer(*v.Years) } return nil } @@ -9255,7 +10357,7 @@ func awsRestxml_serializeDocumentDelete(v *types.Delete, value smithyxml.Value) return err } } - if v.Quiet { + if v.Quiet != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -9264,7 +10366,7 @@ func awsRestxml_serializeDocumentDelete(v *types.Delete, value smithyxml.Value) Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.Quiet) + el.Boolean(*v.Quiet) } return nil } @@ -9901,7 +11003,7 @@ func awsRestxml_serializeDocumentInventoryConfiguration(v *types.InventoryConfig el := value.MemberElement(root) el.String(string(v.IncludedObjectVersions)) } - { + if v.IsEnabled != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -9910,7 +11012,7 @@ func awsRestxml_serializeDocumentInventoryConfiguration(v *types.InventoryConfig Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.IsEnabled) + el.Boolean(*v.IsEnabled) } if v.OptionalFields != nil { rootAttr := []smithyxml.Attr{} @@ -10217,7 +11319,7 @@ func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiratio el := value.MemberElement(root) el.String(smithytime.FormatDateTime(*v.Date)) } - if v.Days != 0 { + if v.Days != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10226,9 +11328,9 @@ func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiratio Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Days) + el.Integer(*v.Days) } - if v.ExpiredObjectDeleteMarker { + if v.ExpiredObjectDeleteMarker != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10237,7 +11339,7 @@ func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiratio Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.ExpiredObjectDeleteMarker) + el.Boolean(*v.ExpiredObjectDeleteMarker) } return nil } @@ -10360,7 +11462,7 @@ func awsRestxml_serializeDocumentLifecycleRule(v *types.LifecycleRule, value smi func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator, value smithyxml.Value) error { defer value.Close() - if v.ObjectSizeGreaterThan != 0 { + if v.ObjectSizeGreaterThan != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10369,9 +11471,9 @@ func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRule Attr: rootAttr, } el := value.MemberElement(root) - el.Long(v.ObjectSizeGreaterThan) + el.Long(*v.ObjectSizeGreaterThan) } - if v.ObjectSizeLessThan != 0 { + if v.ObjectSizeLessThan != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10380,7 +11482,7 @@ func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRule Attr: rootAttr, } el := value.MemberElement(root) - el.Long(v.ObjectSizeLessThan) + el.Long(*v.ObjectSizeLessThan) } if v.Prefix != nil { rootAttr := []smithyxml.Attr{} @@ -10409,71 +11511,66 @@ func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRule return nil } -func awsRestxml_serializeDocumentLifecycleRuleFilter(v types.LifecycleRuleFilter, value smithyxml.Value) error { +func awsRestxml_serializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFilter, value smithyxml.Value) error { defer value.Close() - switch uv := v.(type) { - case *types.LifecycleRuleFilterMemberAnd: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + if v.And != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "And", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - if err := awsRestxml_serializeDocumentLifecycleRuleAndOperator(&uv.Value, av); err != nil { + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentLifecycleRuleAndOperator(v.And, el); err != nil { return err } - - case *types.LifecycleRuleFilterMemberObjectSizeGreaterThan: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + } + if v.ObjectSizeGreaterThan != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "ObjectSizeGreaterThan", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - av.Long(uv.Value) - - case *types.LifecycleRuleFilterMemberObjectSizeLessThan: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + el := value.MemberElement(root) + el.Long(*v.ObjectSizeGreaterThan) + } + if v.ObjectSizeLessThan != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "ObjectSizeLessThan", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - av.Long(uv.Value) - - case *types.LifecycleRuleFilterMemberPrefix: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + el := value.MemberElement(root) + el.Long(*v.ObjectSizeLessThan) + } + if v.Prefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "Prefix", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - av.String(uv.Value) - - case *types.LifecycleRuleFilterMemberTag: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + el := value.MemberElement(root) + el.String(*v.Prefix) + } + if v.Tag != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "Tag", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil { return err } - - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - } return nil } @@ -10493,6 +11590,33 @@ func awsRestxml_serializeDocumentLifecycleRules(v []types.LifecycleRule, value s return nil } +func awsRestxml_serializeDocumentLocationInfo(v *types.LocationInfo, value smithyxml.Value) error { + defer value.Close() + if v.Name != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Name", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Name) + } + if len(v.Type) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Type", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.Type)) + } + return nil +} + func awsRestxml_serializeDocumentLoggingEnabled(v *types.LoggingEnabled, value smithyxml.Value) error { defer value.Close() if v.TargetBucket != nil { @@ -10519,6 +11643,19 @@ func awsRestxml_serializeDocumentLoggingEnabled(v *types.LoggingEnabled, value s return err } } + if v.TargetObjectKeyFormat != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TargetObjectKeyFormat", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTargetObjectKeyFormat(v.TargetObjectKeyFormat, el); err != nil { + return err + } + } if v.TargetPrefix != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -10560,6 +11697,24 @@ func awsRestxml_serializeDocumentMetadataEntry(v *types.MetadataEntry, value smi return nil } +func awsRestxml_serializeDocumentMetadataTableConfiguration(v *types.MetadataTableConfiguration, value smithyxml.Value) error { + defer value.Close() + if v.S3TablesDestination != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "S3TablesDestination", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentS3TablesDestination(v.S3TablesDestination, el); err != nil { + return err + } + } + return nil +} + func awsRestxml_serializeDocumentMetrics(v *types.Metrics, value smithyxml.Value) error { defer value.Close() if v.EventThreshold != nil { @@ -10718,7 +11873,7 @@ func awsRestxml_serializeDocumentMetricsFilter(v types.MetricsFilter, value smit func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.NoncurrentVersionExpiration, value smithyxml.Value) error { defer value.Close() - if v.NewerNoncurrentVersions != 0 { + if v.NewerNoncurrentVersions != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10727,9 +11882,9 @@ func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.Noncurrent Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.NewerNoncurrentVersions) + el.Integer(*v.NewerNoncurrentVersions) } - if v.NoncurrentDays != 0 { + if v.NoncurrentDays != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10738,14 +11893,14 @@ func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.Noncurrent Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.NoncurrentDays) + el.Integer(*v.NoncurrentDays) } return nil } func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.NoncurrentVersionTransition, value smithyxml.Value) error { defer value.Close() - if v.NewerNoncurrentVersions != 0 { + if v.NewerNoncurrentVersions != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10754,9 +11909,9 @@ func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.Noncurrent Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.NewerNoncurrentVersions) + el.Integer(*v.NewerNoncurrentVersions) } - if v.NoncurrentDays != 0 { + if v.NoncurrentDays != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -10765,7 +11920,7 @@ func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.Noncurrent Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.NoncurrentDays) + el.Integer(*v.NoncurrentDays) } if len(v.StorageClass) > 0 { rootAttr := []smithyxml.Attr{} @@ -10873,6 +12028,17 @@ func awsRestxml_serializeDocumentNotificationConfigurationFilter(v *types.Notifi func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, value smithyxml.Value) error { defer value.Close() + if v.ETag != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ETag", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.ETag) + } if v.Key != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -10884,6 +12050,28 @@ func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, val el := value.MemberElement(root) el.String(*v.Key) } + if v.LastModifiedTime != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "LastModifiedTime", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(smithytime.FormatHTTPDate(*v.LastModifiedTime)) + } + if v.Size != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Size", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Long(*v.Size) + } if v.VersionId != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -11133,9 +12321,25 @@ func awsRestxml_serializeDocumentParquetInput(v *types.ParquetInput, value smith return nil } +func awsRestxml_serializeDocumentPartitionedPrefix(v *types.PartitionedPrefix, value smithyxml.Value) error { + defer value.Close() + if len(v.PartitionDateSource) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "PartitionDateSource", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.PartitionDateSource)) + } + return nil +} + func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicAccessBlockConfiguration, value smithyxml.Value) error { defer value.Close() - if v.BlockPublicAcls { + if v.BlockPublicAcls != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11144,9 +12348,9 @@ func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicA Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.BlockPublicAcls) + el.Boolean(*v.BlockPublicAcls) } - if v.BlockPublicPolicy { + if v.BlockPublicPolicy != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11155,9 +12359,9 @@ func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicA Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.BlockPublicPolicy) + el.Boolean(*v.BlockPublicPolicy) } - if v.IgnorePublicAcls { + if v.IgnorePublicAcls != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11166,9 +12370,9 @@ func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicA Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.IgnorePublicAcls) + el.Boolean(*v.IgnorePublicAcls) } - if v.RestrictPublicBuckets { + if v.RestrictPublicBuckets != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11177,7 +12381,7 @@ func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicA Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.RestrictPublicBuckets) + el.Boolean(*v.RestrictPublicBuckets) } return nil } @@ -11458,7 +12662,7 @@ func awsRestxml_serializeDocumentReplicationRule(v *types.ReplicationRule, value el := value.MemberElement(root) el.String(*v.Prefix) } - if v.Priority != 0 { + if v.Priority != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11467,7 +12671,7 @@ func awsRestxml_serializeDocumentReplicationRule(v *types.ReplicationRule, value Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Priority) + el.Integer(*v.Priority) } if v.SourceSelectionCriteria != nil { rootAttr := []smithyxml.Attr{} @@ -11525,49 +12729,44 @@ func awsRestxml_serializeDocumentReplicationRuleAndOperator(v *types.Replication return nil } -func awsRestxml_serializeDocumentReplicationRuleFilter(v types.ReplicationRuleFilter, value smithyxml.Value) error { +func awsRestxml_serializeDocumentReplicationRuleFilter(v *types.ReplicationRuleFilter, value smithyxml.Value) error { defer value.Close() - switch uv := v.(type) { - case *types.ReplicationRuleFilterMemberAnd: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + if v.And != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "And", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - if err := awsRestxml_serializeDocumentReplicationRuleAndOperator(&uv.Value, av); err != nil { + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentReplicationRuleAndOperator(v.And, el); err != nil { return err } - - case *types.ReplicationRuleFilterMemberPrefix: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + } + if v.Prefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "Prefix", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - av.String(uv.Value) - - case *types.ReplicationRuleFilterMemberTag: - customMemberNameAttr := []smithyxml.Attr{} - customMemberName := smithyxml.StartElement{ + el := value.MemberElement(root) + el.String(*v.Prefix) + } + if v.Tag != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ Name: smithyxml.Name{ Local: "Tag", }, - Attr: customMemberNameAttr, + Attr: rootAttr, } - av := value.MemberElement(customMemberName) - if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil { return err } - - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - } return nil } @@ -11618,7 +12817,7 @@ func awsRestxml_serializeDocumentReplicationTime(v *types.ReplicationTime, value func awsRestxml_serializeDocumentReplicationTimeValue(v *types.ReplicationTimeValue, value smithyxml.Value) error { defer value.Close() - if v.Minutes != 0 { + if v.Minutes != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11627,7 +12826,7 @@ func awsRestxml_serializeDocumentReplicationTimeValue(v *types.ReplicationTimeVa Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Minutes) + el.Integer(*v.Minutes) } return nil } @@ -11650,7 +12849,7 @@ func awsRestxml_serializeDocumentRequestPaymentConfiguration(v *types.RequestPay func awsRestxml_serializeDocumentRequestProgress(v *types.RequestProgress, value smithyxml.Value) error { defer value.Close() - if v.Enabled { + if v.Enabled != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11659,14 +12858,14 @@ func awsRestxml_serializeDocumentRequestProgress(v *types.RequestProgress, value Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.Enabled) + el.Boolean(*v.Enabled) } return nil } func awsRestxml_serializeDocumentRestoreRequest(v *types.RestoreRequest, value smithyxml.Value) error { defer value.Close() - if v.Days != 0 { + if v.Days != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11675,7 +12874,7 @@ func awsRestxml_serializeDocumentRestoreRequest(v *types.RestoreRequest, value s Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Days) + el.Integer(*v.Days) } if v.Description != nil { rootAttr := []smithyxml.Attr{} @@ -11924,9 +13123,36 @@ func awsRestxml_serializeDocumentS3Location(v *types.S3Location, value smithyxml return nil } +func awsRestxml_serializeDocumentS3TablesDestination(v *types.S3TablesDestination, value smithyxml.Value) error { + defer value.Close() + if v.TableBucketArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TableBucketArn", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.TableBucketArn) + } + if v.TableName != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TableName", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.TableName) + } + return nil +} + func awsRestxml_serializeDocumentScanRange(v *types.ScanRange, value smithyxml.Value) error { defer value.Close() - if v.End != 0 { + if v.End != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11935,9 +13161,9 @@ func awsRestxml_serializeDocumentScanRange(v *types.ScanRange, value smithyxml.V Attr: rootAttr, } el := value.MemberElement(root) - el.Long(v.End) + el.Long(*v.End) } - if v.Start != 0 { + if v.Start != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -11946,7 +13172,7 @@ func awsRestxml_serializeDocumentScanRange(v *types.ScanRange, value smithyxml.V Attr: rootAttr, } el := value.MemberElement(root) - el.Long(v.Start) + el.Long(*v.Start) } return nil } @@ -12064,7 +13290,7 @@ func awsRestxml_serializeDocumentServerSideEncryptionRule(v *types.ServerSideEnc return err } } - if v.BucketKeyEnabled { + if v.BucketKeyEnabled != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -12073,7 +13299,7 @@ func awsRestxml_serializeDocumentServerSideEncryptionRule(v *types.ServerSideEnc Attr: rootAttr, } el := value.MemberElement(root) - el.Boolean(v.BucketKeyEnabled) + el.Boolean(*v.BucketKeyEnabled) } return nil } @@ -12093,6 +13319,11 @@ func awsRestxml_serializeDocumentServerSideEncryptionRules(v []types.ServerSideE return nil } +func awsRestxml_serializeDocumentSimplePrefix(v *types.SimplePrefix, value smithyxml.Value) error { + defer value.Close() + return nil +} + func awsRestxml_serializeDocumentSourceSelectionCriteria(v *types.SourceSelectionCriteria, value smithyxml.Value) error { defer value.Close() if v.ReplicaModifications != nil { @@ -12332,6 +13563,37 @@ func awsRestxml_serializeDocumentTargetGrants(v []types.TargetGrant, value smith return nil } +func awsRestxml_serializeDocumentTargetObjectKeyFormat(v *types.TargetObjectKeyFormat, value smithyxml.Value) error { + defer value.Close() + if v.PartitionedPrefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "PartitionedPrefix", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentPartitionedPrefix(v.PartitionedPrefix, el); err != nil { + return err + } + } + if v.SimplePrefix != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SimplePrefix", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentSimplePrefix(v.SimplePrefix, el); err != nil { + return err + } + } + return nil +} + func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value) error { defer value.Close() if len(v.AccessTier) > 0 { @@ -12345,7 +13607,7 @@ func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value el := value.MemberElement(root) el.String(string(v.AccessTier)) } - { + if v.Days != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -12354,7 +13616,7 @@ func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Days) + el.Integer(*v.Days) } return nil } @@ -12455,7 +13717,7 @@ func awsRestxml_serializeDocumentTransition(v *types.Transition, value smithyxml el := value.MemberElement(root) el.String(smithytime.FormatDateTime(*v.Date)) } - if v.Days != 0 { + if v.Days != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ Name: smithyxml.Name{ @@ -12464,7 +13726,7 @@ func awsRestxml_serializeDocumentTransition(v *types.Transition, value smithyxml Attr: rootAttr, } el := value.MemberElement(root) - el.Integer(v.Days) + el.Integer(*v.Days) } if len(v.StorageClass) > 0 { rootAttr := []smithyxml.Attr{} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go index 613da169..c9b4350f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go @@ -11,6 +11,7 @@ const ( // Values returns all known values for AnalyticsS3ExportFileFormat. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (AnalyticsS3ExportFileFormat) Values() []AnalyticsS3ExportFileFormat { return []AnalyticsS3ExportFileFormat{ @@ -27,8 +28,9 @@ const ( ) // Values returns all known values for ArchiveStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ArchiveStatus) Values() []ArchiveStatus { return []ArchiveStatus{ "ARCHIVE_ACCESS", @@ -45,8 +47,9 @@ const ( ) // Values returns all known values for BucketAccelerateStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (BucketAccelerateStatus) Values() []BucketAccelerateStatus { return []BucketAccelerateStatus{ "Enabled", @@ -65,8 +68,9 @@ const ( ) // Values returns all known values for BucketCannedACL. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (BucketCannedACL) Values() []BucketCannedACL { return []BucketCannedACL{ "private", @@ -86,6 +90,7 @@ const ( BucketLocationConstraintApNortheast2 BucketLocationConstraint = "ap-northeast-2" BucketLocationConstraintApNortheast3 BucketLocationConstraint = "ap-northeast-3" BucketLocationConstraintApSouth1 BucketLocationConstraint = "ap-south-1" + BucketLocationConstraintApSouth2 BucketLocationConstraint = "ap-south-2" BucketLocationConstraintApSoutheast1 BucketLocationConstraint = "ap-southeast-1" BucketLocationConstraintApSoutheast2 BucketLocationConstraint = "ap-southeast-2" BucketLocationConstraintApSoutheast3 BucketLocationConstraint = "ap-southeast-3" @@ -96,6 +101,7 @@ const ( BucketLocationConstraintEuCentral1 BucketLocationConstraint = "eu-central-1" BucketLocationConstraintEuNorth1 BucketLocationConstraint = "eu-north-1" BucketLocationConstraintEuSouth1 BucketLocationConstraint = "eu-south-1" + BucketLocationConstraintEuSouth2 BucketLocationConstraint = "eu-south-2" BucketLocationConstraintEuWest1 BucketLocationConstraint = "eu-west-1" BucketLocationConstraintEuWest2 BucketLocationConstraint = "eu-west-2" BucketLocationConstraintEuWest3 BucketLocationConstraint = "eu-west-3" @@ -106,12 +112,11 @@ const ( BucketLocationConstraintUsGovWest1 BucketLocationConstraint = "us-gov-west-1" BucketLocationConstraintUsWest1 BucketLocationConstraint = "us-west-1" BucketLocationConstraintUsWest2 BucketLocationConstraint = "us-west-2" - BucketLocationConstraintApSouth2 BucketLocationConstraint = "ap-south-2" - BucketLocationConstraintEuSouth2 BucketLocationConstraint = "eu-south-2" ) // Values returns all known values for BucketLocationConstraint. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (BucketLocationConstraint) Values() []BucketLocationConstraint { return []BucketLocationConstraint{ @@ -121,6 +126,7 @@ func (BucketLocationConstraint) Values() []BucketLocationConstraint { "ap-northeast-2", "ap-northeast-3", "ap-south-1", + "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", @@ -131,6 +137,7 @@ func (BucketLocationConstraint) Values() []BucketLocationConstraint { "eu-central-1", "eu-north-1", "eu-south-1", + "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", @@ -141,8 +148,6 @@ func (BucketLocationConstraint) Values() []BucketLocationConstraint { "us-gov-west-1", "us-west-1", "us-west-2", - "ap-south-2", - "eu-south-2", } } @@ -156,8 +161,9 @@ const ( ) // Values returns all known values for BucketLogsPermission. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (BucketLogsPermission) Values() []BucketLogsPermission { return []BucketLogsPermission{ "FULL_CONTROL", @@ -166,6 +172,23 @@ func (BucketLogsPermission) Values() []BucketLogsPermission { } } +type BucketType string + +// Enum values for BucketType +const ( + BucketTypeDirectory BucketType = "Directory" +) + +// Values returns all known values for BucketType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (BucketType) Values() []BucketType { + return []BucketType{ + "Directory", + } +} + type BucketVersioningStatus string // Enum values for BucketVersioningStatus @@ -175,8 +198,9 @@ const ( ) // Values returns all known values for BucketVersioningStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (BucketVersioningStatus) Values() []BucketVersioningStatus { return []BucketVersioningStatus{ "Enabled", @@ -195,8 +219,9 @@ const ( ) // Values returns all known values for ChecksumAlgorithm. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ChecksumAlgorithm) Values() []ChecksumAlgorithm { return []ChecksumAlgorithm{ "CRC32", @@ -214,8 +239,9 @@ const ( ) // Values returns all known values for ChecksumMode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ChecksumMode) Values() []ChecksumMode { return []ChecksumMode{ "ENABLED", @@ -232,8 +258,9 @@ const ( ) // Values returns all known values for CompressionType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (CompressionType) Values() []CompressionType { return []CompressionType{ "NONE", @@ -242,6 +269,25 @@ func (CompressionType) Values() []CompressionType { } } +type DataRedundancy string + +// Enum values for DataRedundancy +const ( + DataRedundancySingleAvailabilityZone DataRedundancy = "SingleAvailabilityZone" + DataRedundancySingleLocalZone DataRedundancy = "SingleLocalZone" +) + +// Values returns all known values for DataRedundancy. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DataRedundancy) Values() []DataRedundancy { + return []DataRedundancy{ + "SingleAvailabilityZone", + "SingleLocalZone", + } +} + type DeleteMarkerReplicationStatus string // Enum values for DeleteMarkerReplicationStatus @@ -252,8 +298,9 @@ const ( // Values returns all known values for DeleteMarkerReplicationStatus. Note that // this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (DeleteMarkerReplicationStatus) Values() []DeleteMarkerReplicationStatus { return []DeleteMarkerReplicationStatus{ "Enabled", @@ -269,8 +316,9 @@ const ( ) // Values returns all known values for EncodingType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (EncodingType) Values() []EncodingType { return []EncodingType{ "url", @@ -311,8 +359,9 @@ const ( ) // Values returns all known values for Event. Note that this can be expanded in -// the future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Event) Values() []Event { return []Event{ "s3:ReducedRedundancyLostObject", @@ -355,8 +404,9 @@ const ( // Values returns all known values for ExistingObjectReplicationStatus. Note that // this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ExistingObjectReplicationStatus) Values() []ExistingObjectReplicationStatus { return []ExistingObjectReplicationStatus{ "Enabled", @@ -373,8 +423,9 @@ const ( ) // Values returns all known values for ExpirationStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ExpirationStatus) Values() []ExpirationStatus { return []ExpirationStatus{ "Enabled", @@ -390,8 +441,9 @@ const ( ) // Values returns all known values for ExpressionType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ExpressionType) Values() []ExpressionType { return []ExpressionType{ "SQL", @@ -408,8 +460,9 @@ const ( ) // Values returns all known values for FileHeaderInfo. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (FileHeaderInfo) Values() []FileHeaderInfo { return []FileHeaderInfo{ "USE", @@ -427,8 +480,9 @@ const ( ) // Values returns all known values for FilterRuleName. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (FilterRuleName) Values() []FilterRuleName { return []FilterRuleName{ "prefix", @@ -446,8 +500,9 @@ const ( // Values returns all known values for IntelligentTieringAccessTier. Note that // this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (IntelligentTieringAccessTier) Values() []IntelligentTieringAccessTier { return []IntelligentTieringAccessTier{ "ARCHIVE_ACCESS", @@ -465,6 +520,7 @@ const ( // Values returns all known values for IntelligentTieringStatus. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (IntelligentTieringStatus) Values() []IntelligentTieringStatus { return []IntelligentTieringStatus{ @@ -483,8 +539,9 @@ const ( ) // Values returns all known values for InventoryFormat. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (InventoryFormat) Values() []InventoryFormat { return []InventoryFormat{ "CSV", @@ -502,8 +559,9 @@ const ( ) // Values returns all known values for InventoryFrequency. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (InventoryFrequency) Values() []InventoryFrequency { return []InventoryFrequency{ "Daily", @@ -521,8 +579,9 @@ const ( // Values returns all known values for InventoryIncludedObjectVersions. Note that // this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (InventoryIncludedObjectVersions) Values() []InventoryIncludedObjectVersions { return []InventoryIncludedObjectVersions{ "All", @@ -552,8 +611,9 @@ const ( ) // Values returns all known values for InventoryOptionalField. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (InventoryOptionalField) Values() []InventoryOptionalField { return []InventoryOptionalField{ "Size", @@ -583,8 +643,9 @@ const ( ) // Values returns all known values for JSONType. Note that this can be expanded in -// the future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (JSONType) Values() []JSONType { return []JSONType{ "DOCUMENT", @@ -592,6 +653,25 @@ func (JSONType) Values() []JSONType { } } +type LocationType string + +// Enum values for LocationType +const ( + LocationTypeAvailabilityZone LocationType = "AvailabilityZone" + LocationTypeLocalZone LocationType = "LocalZone" +) + +// Values returns all known values for LocationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (LocationType) Values() []LocationType { + return []LocationType{ + "AvailabilityZone", + "LocalZone", + } +} + type MetadataDirective string // Enum values for MetadataDirective @@ -601,8 +681,9 @@ const ( ) // Values returns all known values for MetadataDirective. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (MetadataDirective) Values() []MetadataDirective { return []MetadataDirective{ "COPY", @@ -619,8 +700,9 @@ const ( ) // Values returns all known values for MetricsStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (MetricsStatus) Values() []MetricsStatus { return []MetricsStatus{ "Enabled", @@ -637,8 +719,9 @@ const ( ) // Values returns all known values for MFADelete. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (MFADelete) Values() []MFADelete { return []MFADelete{ "Enabled", @@ -655,8 +738,9 @@ const ( ) // Values returns all known values for MFADeleteStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (MFADeleteStatus) Values() []MFADeleteStatus { return []MFADeleteStatus{ "Enabled", @@ -676,8 +760,9 @@ const ( ) // Values returns all known values for ObjectAttributes. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectAttributes) Values() []ObjectAttributes { return []ObjectAttributes{ "ETag", @@ -702,8 +787,9 @@ const ( ) // Values returns all known values for ObjectCannedACL. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectCannedACL) Values() []ObjectCannedACL { return []ObjectCannedACL{ "private", @@ -724,8 +810,9 @@ const ( ) // Values returns all known values for ObjectLockEnabled. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectLockEnabled) Values() []ObjectLockEnabled { return []ObjectLockEnabled{ "Enabled", @@ -742,6 +829,7 @@ const ( // Values returns all known values for ObjectLockLegalHoldStatus. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (ObjectLockLegalHoldStatus) Values() []ObjectLockLegalHoldStatus { return []ObjectLockLegalHoldStatus{ @@ -759,8 +847,9 @@ const ( ) // Values returns all known values for ObjectLockMode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectLockMode) Values() []ObjectLockMode { return []ObjectLockMode{ "GOVERNANCE", @@ -777,8 +866,9 @@ const ( ) // Values returns all known values for ObjectLockRetentionMode. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectLockRetentionMode) Values() []ObjectLockRetentionMode { return []ObjectLockRetentionMode{ "GOVERNANCE", @@ -796,8 +886,9 @@ const ( ) // Values returns all known values for ObjectOwnership. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectOwnership) Values() []ObjectOwnership { return []ObjectOwnership{ "BucketOwnerPreferred", @@ -820,11 +911,13 @@ const ( ObjectStorageClassOutposts ObjectStorageClass = "OUTPOSTS" ObjectStorageClassGlacierIr ObjectStorageClass = "GLACIER_IR" ObjectStorageClassSnow ObjectStorageClass = "SNOW" + ObjectStorageClassExpressOnezone ObjectStorageClass = "EXPRESS_ONEZONE" ) // Values returns all known values for ObjectStorageClass. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ObjectStorageClass) Values() []ObjectStorageClass { return []ObjectStorageClass{ "STANDARD", @@ -837,6 +930,7 @@ func (ObjectStorageClass) Values() []ObjectStorageClass { "OUTPOSTS", "GLACIER_IR", "SNOW", + "EXPRESS_ONEZONE", } } @@ -849,6 +943,7 @@ const ( // Values returns all known values for ObjectVersionStorageClass. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (ObjectVersionStorageClass) Values() []ObjectVersionStorageClass { return []ObjectVersionStorageClass{ @@ -865,6 +960,7 @@ const ( // Values returns all known values for OptionalObjectAttributes. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (OptionalObjectAttributes) Values() []OptionalObjectAttributes { return []OptionalObjectAttributes{ @@ -880,14 +976,34 @@ const ( ) // Values returns all known values for OwnerOverride. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (OwnerOverride) Values() []OwnerOverride { return []OwnerOverride{ "Destination", } } +type PartitionDateSource string + +// Enum values for PartitionDateSource +const ( + PartitionDateSourceEventTime PartitionDateSource = "EventTime" + PartitionDateSourceDeliveryTime PartitionDateSource = "DeliveryTime" +) + +// Values returns all known values for PartitionDateSource. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PartitionDateSource) Values() []PartitionDateSource { + return []PartitionDateSource{ + "EventTime", + "DeliveryTime", + } +} + type Payer string // Enum values for Payer @@ -897,8 +1013,9 @@ const ( ) // Values returns all known values for Payer. Note that this can be expanded in -// the future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Payer) Values() []Payer { return []Payer{ "Requester", @@ -918,8 +1035,9 @@ const ( ) // Values returns all known values for Permission. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Permission) Values() []Permission { return []Permission{ "FULL_CONTROL", @@ -939,8 +1057,9 @@ const ( ) // Values returns all known values for Protocol. Note that this can be expanded in -// the future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Protocol) Values() []Protocol { return []Protocol{ "http", @@ -957,8 +1076,9 @@ const ( ) // Values returns all known values for QuoteFields. Note that this can be expanded -// in the future, and so it is only as up to date as the client. The ordering of -// this slice is not guaranteed to be stable across updates. +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (QuoteFields) Values() []QuoteFields { return []QuoteFields{ "ALWAYS", @@ -976,6 +1096,7 @@ const ( // Values returns all known values for ReplicaModificationsStatus. Note that this // can be expanded in the future, and so it is only as up to date as the client. +// // The ordering of this slice is not guaranteed to be stable across updates. func (ReplicaModificationsStatus) Values() []ReplicaModificationsStatus { return []ReplicaModificationsStatus{ @@ -993,8 +1114,9 @@ const ( ) // Values returns all known values for ReplicationRuleStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ReplicationRuleStatus) Values() []ReplicationRuleStatus { return []ReplicationRuleStatus{ "Enabled", @@ -1014,8 +1136,9 @@ const ( ) // Values returns all known values for ReplicationStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ReplicationStatus) Values() []ReplicationStatus { return []ReplicationStatus{ "COMPLETE", @@ -1035,8 +1158,9 @@ const ( ) // Values returns all known values for ReplicationTimeStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ReplicationTimeStatus) Values() []ReplicationTimeStatus { return []ReplicationTimeStatus{ "Enabled", @@ -1052,8 +1176,9 @@ const ( ) // Values returns all known values for RequestCharged. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (RequestCharged) Values() []RequestCharged { return []RequestCharged{ "requester", @@ -1068,8 +1193,9 @@ const ( ) // Values returns all known values for RequestPayer. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (RequestPayer) Values() []RequestPayer { return []RequestPayer{ "requester", @@ -1084,8 +1210,9 @@ const ( ) // Values returns all known values for RestoreRequestType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (RestoreRequestType) Values() []RestoreRequestType { return []RestoreRequestType{ "SELECT", @@ -1102,8 +1229,9 @@ const ( ) // Values returns all known values for ServerSideEncryption. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (ServerSideEncryption) Values() []ServerSideEncryption { return []ServerSideEncryption{ "AES256", @@ -1112,6 +1240,25 @@ func (ServerSideEncryption) Values() []ServerSideEncryption { } } +type SessionMode string + +// Enum values for SessionMode +const ( + SessionModeReadOnly SessionMode = "ReadOnly" + SessionModeReadWrite SessionMode = "ReadWrite" +) + +// Values returns all known values for SessionMode. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SessionMode) Values() []SessionMode { + return []SessionMode{ + "ReadOnly", + "ReadWrite", + } +} + type SseKmsEncryptedObjectsStatus string // Enum values for SseKmsEncryptedObjectsStatus @@ -1122,8 +1269,9 @@ const ( // Values returns all known values for SseKmsEncryptedObjectsStatus. Note that // this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (SseKmsEncryptedObjectsStatus) Values() []SseKmsEncryptedObjectsStatus { return []SseKmsEncryptedObjectsStatus{ "Enabled", @@ -1145,11 +1293,13 @@ const ( StorageClassOutposts StorageClass = "OUTPOSTS" StorageClassGlacierIr StorageClass = "GLACIER_IR" StorageClassSnow StorageClass = "SNOW" + StorageClassExpressOnezone StorageClass = "EXPRESS_ONEZONE" ) // Values returns all known values for StorageClass. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (StorageClass) Values() []StorageClass { return []StorageClass{ "STANDARD", @@ -1162,6 +1312,7 @@ func (StorageClass) Values() []StorageClass { "OUTPOSTS", "GLACIER_IR", "SNOW", + "EXPRESS_ONEZONE", } } @@ -1174,8 +1325,9 @@ const ( // Values returns all known values for StorageClassAnalysisSchemaVersion. Note // that this can be expanded in the future, and so it is only as up to date as the -// client. The ordering of this slice is not guaranteed to be stable across -// updates. +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (StorageClassAnalysisSchemaVersion) Values() []StorageClassAnalysisSchemaVersion { return []StorageClassAnalysisSchemaVersion{ "V_1", @@ -1191,8 +1343,9 @@ const ( ) // Values returns all known values for TaggingDirective. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (TaggingDirective) Values() []TaggingDirective { return []TaggingDirective{ "COPY", @@ -1210,8 +1363,9 @@ const ( ) // Values returns all known values for Tier. Note that this can be expanded in the -// future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Tier) Values() []Tier { return []Tier{ "Standard", @@ -1220,6 +1374,26 @@ func (Tier) Values() []Tier { } } +type TransitionDefaultMinimumObjectSize string + +// Enum values for TransitionDefaultMinimumObjectSize +const ( + TransitionDefaultMinimumObjectSizeVariesByStorageClass TransitionDefaultMinimumObjectSize = "varies_by_storage_class" + TransitionDefaultMinimumObjectSizeAllStorageClasses128k TransitionDefaultMinimumObjectSize = "all_storage_classes_128K" +) + +// Values returns all known values for TransitionDefaultMinimumObjectSize. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TransitionDefaultMinimumObjectSize) Values() []TransitionDefaultMinimumObjectSize { + return []TransitionDefaultMinimumObjectSize{ + "varies_by_storage_class", + "all_storage_classes_128K", + } +} + type TransitionStorageClass string // Enum values for TransitionStorageClass @@ -1233,8 +1407,9 @@ const ( ) // Values returns all known values for TransitionStorageClass. Note that this can -// be expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (TransitionStorageClass) Values() []TransitionStorageClass { return []TransitionStorageClass{ "GLACIER", @@ -1256,8 +1431,9 @@ const ( ) // Values returns all known values for Type. Note that this can be expanded in the -// future, and so it is only as up to date as the client. The ordering of this -// slice is not guaranteed to be stable across updates. +// future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. func (Type) Values() []Type { return []Type{ "CanonicalUser", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/errors.go index f3837866..1070573a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/errors.go @@ -64,7 +64,46 @@ func (e *BucketAlreadyOwnedByYou) ErrorCode() string { } func (e *BucketAlreadyOwnedByYou) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The existing object was created with a different encryption type. Subsequent +// +// write requests must include the appropriate encryption parameters in the request +// or while creating the session. +type EncryptionTypeMismatch struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionTypeMismatch) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionTypeMismatch) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionTypeMismatch) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionTypeMismatch" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionTypeMismatch) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Object is archived and inaccessible until restored. +// +// If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval +// storage class, the S3 Glacier Deep Archive storage class, the S3 +// Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep +// Archive Access tier, before you can retrieve the object you must first restore a +// copy using [RestoreObject]. Otherwise, this operation returns an InvalidObjectState error. For +// information about restoring archived objects, see [Restoring Archived Objects]in the Amazon S3 User Guide. +// +// [RestoreObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html +// [Restoring Archived Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html type InvalidObjectState struct { Message *string @@ -93,6 +132,69 @@ func (e *InvalidObjectState) ErrorCode() string { } func (e *InvalidObjectState) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You may receive this error in multiple cases. Depending on the reason for the +// error, you may receive one of the messages below: +// +// - Cannot specify both a write offset value and user-defined object metadata +// for existing objects. +// +// - Checksum Type mismatch occurred, expected checksum Type: sha1, actual +// checksum Type: crc32c. +// +// - Request body cannot be empty when 'write offset' is specified. +type InvalidRequest struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequest) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequest) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequest) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequest" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The write offset value that you specified does not match the current object +// +// size. +type InvalidWriteOffset struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidWriteOffset) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidWriteOffset) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidWriteOffset) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidWriteOffset" + } + return *e.ErrorCodeOverride +} +func (e *InvalidWriteOffset) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified bucket does not exist. type NoSuchBucket struct { Message *string @@ -249,3 +351,32 @@ func (e *ObjectNotInActiveTierError) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ObjectNotInActiveTierError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You have attempted to add more parts than the maximum of 10000 that are +// +// allowed for this object. You can use the CopyObject operation to copy this +// object to another and then add more data to the newly copied object. +type TooManyParts struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyParts) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyParts) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyParts) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyParts" + } + return *e.ErrorCodeOverride +} +func (e *TooManyParts) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go index 3ddea0a2..5cc2420c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go @@ -9,21 +9,22 @@ import ( // Specifies the days since the initiation of an incomplete multipart upload that // Amazon S3 will wait before permanently removing all parts of the upload. For -// more information, see Aborting Incomplete Multipart Uploads Using a Bucket -// Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) -// in the Amazon S3 User Guide. +// more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. +// +// [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config type AbortIncompleteMultipartUpload struct { // Specifies the number of days after which Amazon S3 aborts an incomplete // multipart upload. - DaysAfterInitiation int32 + DaysAfterInitiation *int32 noSmithyDocumentSerde } // Configures the transfer acceleration state for an Amazon S3 bucket. For more -// information, see Amazon S3 Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon S3 User Guide. +// information, see [Amazon S3 Transfer Acceleration]in the Amazon S3 User Guide. +// +// [Amazon S3 Transfer Acceleration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html type AccelerateConfiguration struct { // Specifies the transfer acceleration status of the bucket. @@ -47,9 +48,10 @@ type AccessControlPolicy struct { // A container for information about access control for replicas. type AccessControlTranslation struct { - // Specifies the replica ownership. For default and valid values, see PUT bucket - // replication (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) - // in the Amazon S3 API Reference. + // Specifies the replica ownership. For default and valid values, see [PUT bucket replication] in the + // Amazon S3 API Reference. + // + // [PUT bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html // // This member is required. Owner OwnerOverride @@ -82,7 +84,7 @@ type AnalyticsConfiguration struct { // This member is required. Id *string - // Contains data related to access patterns to be collected and made available to + // Contains data related to access patterns to be collected and made available to // analyze the tradeoffs between different storage classes. // // This member is required. @@ -162,9 +164,10 @@ type AnalyticsS3BucketDestination struct { Format AnalyticsS3ExportFileFormat // The account ID that owns the destination S3 bucket. If no account ID is - // provided, the owner is not validated before exporting data. Although this value - // is optional, we strongly recommend that you set it to help prevent problems if - // the destination bucket ownership changes. + // provided, the owner is not validated before exporting data. + // + // Although this value is optional, we strongly recommend that you set it to help + // prevent problems if the destination bucket ownership changes. BucketAccountId *string // The prefix to use when exporting data. The prefix is prepended to all results. @@ -173,11 +176,14 @@ type AnalyticsS3BucketDestination struct { noSmithyDocumentSerde } -// In terms of implementation, a Bucket is a resource. An Amazon S3 bucket name is -// globally unique, and the namespace is shared by all Amazon Web Services -// accounts. +// In terms of implementation, a Bucket is a resource. type Bucket struct { + // BucketRegion indicates the Amazon Web Services region where the bucket is + // located. If the request contains at least one valid parameter, it is included in + // the response. + BucketRegion *string + // Date the bucket was created. This date can change when making changes to your // bucket, such as editing its bucket policy. CreationDate *time.Time @@ -188,9 +194,28 @@ type Bucket struct { noSmithyDocumentSerde } +// Specifies the information about the bucket that will be created. For more +// information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. +// +// This functionality is only supported by directory buckets. +// +// [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html +type BucketInfo struct { + + // The number of Zone (Availability Zone or Local Zone) that's used for redundancy + // for the bucket. + DataRedundancy DataRedundancy + + // The type of bucket. + Type BucketType + + noSmithyDocumentSerde +} + // Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For -// more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in the Amazon S3 User Guide. +// more information, see [Object Lifecycle Management]in the Amazon S3 User Guide. +// +// [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html type BucketLifecycleConfiguration struct { // A lifecycle rule for individual objects in an Amazon S3 bucket. @@ -205,8 +230,10 @@ type BucketLifecycleConfiguration struct { type BucketLoggingStatus struct { // Describes where logs are stored and the prefix that Amazon S3 assigns to all - // log object keys for a bucket. For more information, see PUT Bucket logging (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) - // in the Amazon S3 API Reference. + // log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API + // Reference. + // + // [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html LoggingEnabled *LoggingEnabled noSmithyDocumentSerde @@ -215,32 +242,48 @@ type BucketLoggingStatus struct { // Contains all the possible checksum or digest values for an object. type Checksum struct { - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string noSmithyDocumentSerde @@ -262,8 +305,10 @@ type CommonPrefix struct { // The container for the completed multipart upload details. type CompletedMultipartUpload struct { - // Array of CompletedPart data types. If you do not supply a valid Part with your - // request, the service sends back an HTTP 400 response. + // Array of CompletedPart data types. + // + // If you do not supply a valid Part with your request, the service sends back an + // HTTP 400 response. Parts []CompletedPart noSmithyDocumentSerde @@ -272,32 +317,48 @@ type CompletedMultipartUpload struct { // Details of the parts that were uploaded. type CompletedPart struct { - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Entity tag returned when the part was uploaded. @@ -305,7 +366,17 @@ type CompletedPart struct { // Part number that identifies the part. This is a positive integer between 1 and // 10,000. - PartNumber int32 + // + // - General purpose buckets - In CompleteMultipartUpload , when a additional + // checksum (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , + // x-amz-checksum-sha1 , or x-amz-checksum-sha256 ) is applied to each part, the + // PartNumber must start at 1 and the part numbers must be consecutive. + // Otherwise, Amazon S3 generates an HTTP 400 Bad Request status code and an + // InvalidPartOrder error code. + // + // - Directory buckets - In CompleteMultipartUpload , the PartNumber must start + // at 1 and the part numbers must be consecutive. + PartNumber *int32 noSmithyDocumentSerde } @@ -329,10 +400,12 @@ type Condition struct { // be /docs , which identifies all objects in the docs/ folder. Required when the // parent element Condition is specified and sibling HttpErrorCodeReturnedEquals // is not specified. If both conditions are specified, both must be true for the - // redirect to be applied. Replacement must be made for object keys containing - // special characters (such as carriage returns) when using XML requests. For more - // information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // redirect to be applied. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints KeyPrefixEquals *string noSmithyDocumentSerde @@ -345,32 +418,32 @@ type ContinuationEvent struct { // Container for all response elements. type CopyObjectResult struct { - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. For more information, see [Checking object integrity]in the + // Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string // Returns the ETag of the new object. The ETag reflects only changes to the @@ -386,32 +459,48 @@ type CopyObjectResult struct { // Container for all response elements. type CopyPartResult struct { - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32 checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // Entity tag of the object. @@ -424,8 +513,9 @@ type CopyPartResult struct { } // Describes the cross-origin access configuration for objects in an Amazon S3 -// bucket. For more information, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// in the Amazon S3 User Guide. +// bucket. For more information, see [Enabling Cross-Origin Resource Sharing]in the Amazon S3 User Guide. +// +// [Enabling Cross-Origin Resource Sharing]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html type CORSConfiguration struct { // A set of origins and methods (cross-origin access that you want to allow). You @@ -466,7 +556,7 @@ type CORSRule struct { // The time in seconds that your browser is to cache the preflight response for // the specified resource. - MaxAgeSeconds int32 + MaxAgeSeconds *int32 noSmithyDocumentSerde } @@ -474,8 +564,36 @@ type CORSRule struct { // The configuration information for the bucket. type CreateBucketConfiguration struct { - // Specifies the Region where the bucket will be created. If you don't specify a - // Region, the bucket is created in the US East (N. Virginia) Region (us-east-1). + // Specifies the information about the bucket that will be created. + // + // This functionality is only supported by directory buckets. + Bucket *BucketInfo + + // Specifies the location where the bucket will be created. + // + // Directory buckets - The location type is Availability Zone or Local Zone. When + // the location type is Local Zone, your Local Zone must be in opt-in status. + // Otherwise, you get an HTTP 400 Bad Request error with the error code Access + // denied . To learn more about opt-in Local Zones, see [Opt-in Dedicated Local Zones]in the Amazon S3 User + // Guide. + // + // This functionality is only supported by directory buckets. + // + // [Opt-in Dedicated Local Zones]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/opt-in-directory-bucket-lz.html + Location *LocationInfo + + // Specifies the Region where the bucket will be created. You might choose a + // Region to optimize latency, minimize costs, or address regulatory requirements. + // For example, if you reside in Europe, you will probably find it advantageous to + // create buckets in the Europe (Ireland) Region. For more information, see [Accessing a bucket]in the + // Amazon S3 User Guide. + // + // If you don't specify a Region, the bucket is created in the US East (N. + // Virginia) Region (us-east-1) by default. + // + // This functionality is not supported for directory buckets. + // + // [Accessing a bucket]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro LocationConstraint BucketLocationConstraint noSmithyDocumentSerde @@ -488,11 +606,13 @@ type CSVInput struct { // Specifies that CSV field values may contain quoted record delimiters and such // records should be allowed. Default value is FALSE. Setting this value to TRUE // may lower performance. - AllowQuotedRecordDelimiter bool + AllowQuotedRecordDelimiter *bool // A single character used to indicate that a row should be ignored when the // character is present at the start of that row. You can specify any character to - // indicate a comment line. The default character is # . Default: # + // indicate a comment line. The default character is # . + // + // Default: # Comments *string // A single character used to separate individual fields in a record. You can @@ -500,17 +620,26 @@ type CSVInput struct { FieldDelimiter *string // Describes the first line of input. Valid values are: + // // - NONE : First line is not a header. + // // - IGNORE : First line is a header, but you can't use the header values to // indicate the column in an expression. You can use column position (such as _1, // _2, …) to indicate the column ( SELECT s._1 FROM OBJECT s ). + // // - Use : First line is a header, and you can use the header value to identify a // column in an expression ( SELECT "name" FROM OBJECT ). FileHeaderInfo FileHeaderInfo // A single character used for escaping when the field delimiter is part of the // value. For example, if the value is a, b , Amazon S3 wraps this field value in - // quotation marks, as follows: " a , b " . Type: String Default: " Ancestors: CSV + // quotation marks, as follows: " a , b " . + // + // Type: String + // + // Default: " + // + // Ancestors: CSV QuoteCharacter *string // A single character used for escaping the quotation mark character inside an @@ -543,7 +672,9 @@ type CSVOutput struct { QuoteEscapeCharacter *string // Indicates whether to use quotation marks around output fields. + // // - ALWAYS : Always use quotation marks for output fields. + // // - ASNEEDED : Use quotation marks for output fields when needed. QuoteFields QuoteFields @@ -554,16 +685,18 @@ type CSVOutput struct { noSmithyDocumentSerde } -// The container element for specifying the default Object Lock retention settings -// for new objects placed in the specified bucket. +// The container element for optionally specifying the default Object Lock +// retention settings for new objects placed in the specified bucket. +// // - The DefaultRetention settings require both a mode and a period. +// // - The DefaultRetention period can be either Days or Years but you must select // one. You cannot specify Days and Years at the same time. type DefaultRetention struct { // The number of days that you want to specify for the default retention period. // Must be used with Mode . - Days int32 + Days *int32 // The default Object Lock retention mode you want to apply to new objects placed // in the specified bucket. Must be used with either Days or Years . @@ -571,7 +704,7 @@ type DefaultRetention struct { // The number of years that you want to specify for the default retention period. // Must be used with Mode . - Years int32 + Years *int32 noSmithyDocumentSerde } @@ -581,12 +714,17 @@ type Delete struct { // The object to delete. // + // Directory buckets - For directory buckets, an object that's composed entirely + // of whitespace characters is not supported by the DeleteObjects API operation. + // The request will receive a 400 Bad Request error and none of the objects in the + // request will be deleted. + // // This member is required. Objects []ObjectIdentifier // Element to enable quiet mode for the request. When you add this element, you - // must set its value to true. - Quiet bool + // must set its value to true . + Quiet *bool noSmithyDocumentSerde } @@ -598,17 +736,23 @@ type DeletedObject struct { // (true) or was not (false) a delete marker before deletion. In a simple DELETE, // this header indicates whether (true) or not (false) the current version of the // object is a delete marker. - DeleteMarker bool + // + // This functionality is not supported for directory buckets. + DeleteMarker *bool // The version ID of the delete marker created as a result of the DELETE // operation. If you delete a specific object version, the value returned by this // header is the version ID of the object version deleted. + // + // This functionality is not supported for directory buckets. DeleteMarkerVersionId *string // The name of the deleted object. Key *string // The version ID of the deleted object. + // + // This functionality is not supported for directory buckets. VersionId *string noSmithyDocumentSerde @@ -619,12 +763,12 @@ type DeleteMarkerEntry struct { // Specifies whether the object is (true) or is not (false) the latest version of // an object. - IsLatest bool + IsLatest *bool // The object key. Key *string - // Date and time the object was last modified. + // Date and time when the object was last modified. LastModified *time.Time // The account that created the delete marker.> @@ -641,17 +785,20 @@ type DeleteMarkerEntry struct { // DeleteMarkerReplication element. If your Filter includes a Tag element, the // DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does // not support replicating delete markers for tag-based rules. For an example -// configuration, see Basic Rule Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config) -// . For more information about delete marker replication, see Basic Rule -// Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html) -// . If you are using an earlier version of the replication configuration, Amazon -// S3 handles replication of delete markers differently. For more information, see -// Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations) -// . +// configuration, see [Basic Rule Configuration]. +// +// For more information about delete marker replication, see [Basic Rule Configuration]. +// +// If you are using an earlier version of the replication configuration, Amazon S3 +// handles replication of delete markers differently. For more information, see [Backward Compatibility]. +// +// [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html +// [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations type DeleteMarkerReplication struct { - // Indicates whether to replicate delete markers. Indicates whether to replicate - // delete markers. + // Indicates whether to replicate delete markers. + // + // Indicates whether to replicate delete markers. Status DeleteMarkerReplicationStatus noSmithyDocumentSerde @@ -661,7 +808,7 @@ type DeleteMarkerReplication struct { // for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). type Destination struct { - // The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store + // The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store // the results. // // This member is required. @@ -678,29 +825,32 @@ type Destination struct { // Amazon S3 to change replica ownership to the Amazon Web Services account that // owns the destination bucket by specifying the AccessControlTranslation // property, this is the account ID of the destination bucket owner. For more - // information, see Replication Additional Configuration: Changing the Replica - // Owner (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html) - // in the Amazon S3 User Guide. + // information, see [Replication Additional Configuration: Changing the Replica Owner]in the Amazon S3 User Guide. + // + // [Replication Additional Configuration: Changing the Replica Owner]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html Account *string // A container that provides information about encryption. If // SourceSelectionCriteria is specified, you must specify this element. EncryptionConfiguration *EncryptionConfiguration - // A container specifying replication metrics-related settings enabling + // A container specifying replication metrics-related settings enabling // replication metrics and events. Metrics *Metrics - // A container specifying S3 Replication Time Control (S3 RTC), including whether + // A container specifying S3 Replication Time Control (S3 RTC), including whether // S3 RTC is enabled and the time when all objects and operations on objects must // be replicated. Must be specified together with a Metrics block. ReplicationTime *ReplicationTime - // The storage class to use when replicating objects, such as S3 Standard or + // The storage class to use when replicating objects, such as S3 Standard or // reduced redundancy. By default, Amazon S3 uses the storage class of the source - // object to create the object replica. For valid values, see the StorageClass - // element of the PUT Bucket replication (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) - // action in the Amazon S3 API Reference. + // object to create the object replica. + // + // For valid values, see the StorageClass element of the [PUT Bucket replication] action in the Amazon S3 + // API Reference. + // + // [PUT Bucket replication]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html StorageClass StorageClass noSmithyDocumentSerde @@ -722,8 +872,9 @@ type Encryption struct { // If the encryption type is aws:kms , this optional value specifies the ID of the // symmetric encryption customer managed key to use for encryption of job results. // Amazon S3 only supports symmetric encryption KMS keys. For more information, see - // Asymmetric keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. + // [Asymmetric keys in KMS]in the Amazon Web Services Key Management Service Developer Guide. + // + // [Asymmetric keys in KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html KMSKeyId *string noSmithyDocumentSerde @@ -731,14 +882,21 @@ type Encryption struct { // Specifies encryption-related information for an Amazon S3 bucket that is a // destination for replicated objects. +// +// If you're specifying a customer managed KMS key, we recommend using a fully +// qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the +// key within the requester’s account. This behavior can result in data that's +// encrypted with a KMS key that belongs to the requester, and not the bucket +// owner. type EncryptionConfiguration struct { // Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web // Services KMS key stored in Amazon Web Services Key Management Service (KMS) for // the destination bucket. Amazon S3 uses this key to encrypt replica objects. // Amazon S3 only supports symmetric encryption KMS keys. For more information, see - // Asymmetric keys in Amazon Web Services KMS (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. + // [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. + // + // [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html ReplicaKmsKeyID *string noSmithyDocumentSerde @@ -757,414 +915,766 @@ type Error struct { // The error code is a string that uniquely identifies an error condition. It is // meant to be read and understood by programs that detect and handle errors by // type. The following is a list of Amazon S3 error codes. For more information, - // see Error responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - // . + // see [Error responses]. + // // - Code: AccessDenied + // // - Description: Access Denied + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: AccountProblem + // // - Description: There is a problem with your Amazon Web Services account that // prevents the action from completing successfully. Contact Amazon Web Services // Support for further assistance. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: AllAccessDisabled + // // - Description: All access to this Amazon S3 resource has been disabled. // Contact Amazon Web Services Support for further assistance. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: AmbiguousGrantByEmailAddress + // // - Description: The email address you provided is associated with more than // one account. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: AuthorizationHeaderMalformed + // // - Description: The authorization header you provided is invalid. + // // - HTTP Status Code: 400 Bad Request + // // - HTTP Status Code: N/A + // // - Code: BadDigest + // // - Description: The Content-MD5 you specified did not match what we received. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: BucketAlreadyExists + // // - Description: The requested bucket name is not available. The bucket // namespace is shared by all users of the system. Please select a different name // and try again. + // // - HTTP Status Code: 409 Conflict + // // - SOAP Fault Code Prefix: Client + // // - Code: BucketAlreadyOwnedByYou + // // - Description: The bucket you tried to create already exists, and you own it. // Amazon S3 returns this error in all Amazon Web Services Regions except in the // North Virginia Region. For legacy compatibility, if you re-create an existing // bucket that you already own in the North Virginia Region, Amazon S3 returns 200 // OK and resets the bucket access control lists (ACLs). + // // - Code: 409 Conflict (in all Regions except the North Virginia Region) + // // - SOAP Fault Code Prefix: Client + // // - Code: BucketNotEmpty + // // - Description: The bucket you tried to delete is not empty. + // // - HTTP Status Code: 409 Conflict + // // - SOAP Fault Code Prefix: Client + // // - Code: CredentialsNotSupported + // // - Description: This request does not support credentials. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: CrossLocationLoggingProhibited + // // - Description: Cross-location logging not allowed. Buckets in one geographic // location cannot log information to a bucket in another location. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: EntityTooSmall + // // - Description: Your proposed upload is smaller than the minimum allowed // object size. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: EntityTooLarge + // // - Description: Your proposed upload exceeds the maximum allowed object size. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: ExpiredToken + // // - Description: The provided token has expired. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: IllegalVersioningConfigurationException + // // - Description: Indicates that the versioning configuration specified in the // request is invalid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: IncompleteBody + // // - Description: You did not provide the number of bytes specified by the // Content-Length HTTP header + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: IncorrectNumberOfFilesInPostRequest + // // - Description: POST requires exactly one file upload per request. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InlineDataTooLarge + // // - Description: Inline data exceeds the maximum allowed size. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InternalError + // // - Description: We encountered an internal error. Please try again. + // // - HTTP Status Code: 500 Internal Server Error + // // - SOAP Fault Code Prefix: Server + // // - Code: InvalidAccessKeyId + // // - Description: The Amazon Web Services access key ID you provided does not // exist in our records. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidAddressingHeader + // // - Description: You must specify the Anonymous role. + // // - HTTP Status Code: N/A + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidArgument + // // - Description: Invalid Argument + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidBucketName + // // - Description: The specified bucket is not valid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidBucketState + // // - Description: The request is not valid with the current state of the bucket. + // // - HTTP Status Code: 409 Conflict + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidDigest + // // - Description: The Content-MD5 you specified is not valid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidEncryptionAlgorithmError + // // - Description: The encryption request you specified is not valid. The valid // value is AES256. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidLocationConstraint + // // - Description: The specified location constraint is not valid. For more - // information about Regions, see How to Select a Region for Your Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro) - // . + // information about Regions, see [How to Select a Region for Your Buckets]. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidObjectState + // // - Description: The action is not valid for the current state of the object. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidPart + // // - Description: One or more of the specified parts could not be found. The // part might not have been uploaded, or the specified entity tag might not have // matched the part's entity tag. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidPartOrder + // // - Description: The list of parts was not in ascending order. Parts list must // be specified in order by part number. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidPayer + // // - Description: All access to this object has been disabled. Please contact // Amazon Web Services Support for further assistance. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidPolicyDocument + // // - Description: The content of the form does not meet the conditions specified // in the policy document. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidRange + // // - Description: The requested range cannot be satisfied. + // // - HTTP Status Code: 416 Requested Range Not Satisfiable + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidRequest + // // - Description: Please use AWS4-HMAC-SHA256 . + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: SOAP requests must be made over an HTTPS connection. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Acceleration is not supported for buckets // with non-DNS compliant names. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Acceleration is not supported for buckets // with periods (.) in their names. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Accelerate endpoint only supports virtual // style requests. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest - // - Description: Amazon S3 Transfer Accelerate is not configured on this - // bucket. + // + // - Description: Amazon S3 Transfer Accelerate is not configured on this bucket. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Accelerate is disabled on this bucket. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Acceleration is not supported on this // bucket. Contact Amazon Web Services Support for more information. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidRequest + // // - Description: Amazon S3 Transfer Acceleration cannot be enabled on this // bucket. Contact Amazon Web Services Support for more information. + // // - HTTP Status Code: 400 Bad Request + // // - Code: N/A + // // - Code: InvalidSecurity + // // - Description: The provided security credentials are not valid. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidSOAPRequest + // // - Description: The SOAP request body is invalid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidStorageClass + // // - Description: The storage class you specified is not valid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidTargetBucketForLogging + // // - Description: The target bucket for logging does not exist, is not owned by // you, or does not have the appropriate grants for the log-delivery group. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidToken + // // - Description: The provided token is malformed or otherwise invalid. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: InvalidURI + // // - Description: Couldn't parse the specified URI. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: KeyTooLongError + // // - Description: Your key is too long. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MalformedACLError + // // - Description: The XML you provided was not well-formed or did not validate // against our published schema. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MalformedPOSTRequest + // // - Description: The body of your POST request is not well-formed // multipart/form-data. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MalformedXML + // // - Description: This happens when the user sends malformed XML (XML that // doesn't conform to the published XSD) for the configuration. The error message // is, "The XML you provided was not well-formed or did not validate against our // published schema." + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MaxMessageLengthExceeded + // // - Description: Your request was too big. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MaxPostPreDataLengthExceededError + // // - Description: Your POST request fields preceding the upload file were too // large. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MetadataTooLarge - // - Description: Your metadata headers exceed the maximum allowed metadata - // size. + // + // - Description: Your metadata headers exceed the maximum allowed metadata size. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MethodNotAllowed + // // - Description: The specified method is not allowed against this resource. + // // - HTTP Status Code: 405 Method Not Allowed + // // - SOAP Fault Code Prefix: Client + // // - Code: MissingAttachment + // // - Description: A SOAP attachment was expected, but none were found. + // // - HTTP Status Code: N/A + // // - SOAP Fault Code Prefix: Client + // // - Code: MissingContentLength + // // - Description: You must provide the Content-Length HTTP header. + // // - HTTP Status Code: 411 Length Required + // // - SOAP Fault Code Prefix: Client + // // - Code: MissingRequestBodyError + // // - Description: This happens when the user sends an empty XML document as a // request. The error message is, "Request body is empty." + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MissingSecurityElement + // // - Description: The SOAP 1.1 request is missing a security element. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: MissingSecurityHeader + // // - Description: Your request is missing a required header. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: NoLoggingStatusForKey + // // - Description: There is no such thing as a logging status subresource for a // key. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchBucket + // // - Description: The specified bucket does not exist. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchBucketPolicy + // // - Description: The specified bucket does not have a bucket policy. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchKey + // // - Description: The specified key does not exist. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchLifecycleConfiguration + // // - Description: The lifecycle configuration does not exist. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchUpload + // // - Description: The specified multipart upload does not exist. The upload ID // might be invalid, or the multipart upload might have been aborted or completed. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NoSuchVersion + // // - Description: Indicates that the version ID specified in the request does // not match an existing version. + // // - HTTP Status Code: 404 Not Found + // // - SOAP Fault Code Prefix: Client + // // - Code: NotImplemented + // // - Description: A header you provided implies functionality that is not // implemented. + // // - HTTP Status Code: 501 Not Implemented + // // - SOAP Fault Code Prefix: Server + // // - Code: NotSignedUp + // // - Description: Your account is not signed up for the Amazon S3 service. You // must sign up before you can use Amazon S3. You can sign up at the following URL: - // Amazon S3 (http://aws.amazon.com/s3) + // [Amazon S3] + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: OperationAborted + // // - Description: A conflicting conditional action is currently in progress // against this resource. Try again. + // // - HTTP Status Code: 409 Conflict + // // - SOAP Fault Code Prefix: Client + // // - Code: PermanentRedirect + // // - Description: The bucket you are attempting to access must be addressed // using the specified endpoint. Send all future requests to this endpoint. + // // - HTTP Status Code: 301 Moved Permanently + // // - SOAP Fault Code Prefix: Client + // // - Code: PreconditionFailed + // // - Description: At least one of the preconditions you specified did not hold. + // // - HTTP Status Code: 412 Precondition Failed + // // - SOAP Fault Code Prefix: Client + // // - Code: Redirect + // // - Description: Temporary redirect. + // // - HTTP Status Code: 307 Moved Temporarily + // // - SOAP Fault Code Prefix: Client + // // - Code: RestoreAlreadyInProgress + // // - Description: Object restore is already in progress. + // // - HTTP Status Code: 409 Conflict + // // - SOAP Fault Code Prefix: Client + // // - Code: RequestIsNotMultiPartContent + // // - Description: Bucket POST must be of the enclosure-type multipart/form-data. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: RequestTimeout + // // - Description: Your socket connection to the server was not read from or // written to within the timeout period. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: RequestTimeTooSkewed + // // - Description: The difference between the request time and the server's time // is too large. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: RequestTorrentOfBucketError + // // - Description: Requesting the torrent file of a bucket is not permitted. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: SignatureDoesNotMatch + // // - Description: The request signature we calculated does not match the // signature you provided. Check your Amazon Web Services secret access key and - // signing method. For more information, see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // and SOAP Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html) - // for details. + // signing method. For more information, see [REST Authentication]and [SOAP Authentication]for details. + // // - HTTP Status Code: 403 Forbidden + // // - SOAP Fault Code Prefix: Client + // // - Code: ServiceUnavailable + // // - Description: Service is unable to handle request. + // // - HTTP Status Code: 503 Service Unavailable + // // - SOAP Fault Code Prefix: Server + // // - Code: SlowDown + // // - Description: Reduce your request rate. + // // - HTTP Status Code: 503 Slow Down + // // - SOAP Fault Code Prefix: Server + // // - Code: TemporaryRedirect + // // - Description: You are being redirected to the bucket while DNS updates. + // // - HTTP Status Code: 307 Moved Temporarily + // // - SOAP Fault Code Prefix: Client + // // - Code: TokenRefreshRequired + // // - Description: The provided token must be refreshed. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: TooManyBuckets + // // - Description: You have attempted to create more buckets than allowed. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: UnexpectedContent + // // - Description: This request does not support content. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: UnresolvableGrantByEmailAddress + // // - Description: The email address you provided does not match any account on // record. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // // - Code: UserKeyMustBeSpecified + // // - Description: The bucket POST must contain the specified field name. If it // is specified, check the order of the fields. + // // - HTTP Status Code: 400 Bad Request + // // - SOAP Fault Code Prefix: Client + // + // [How to Select a Region for Your Buckets]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro + // [Error responses]: https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html + // [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html + // [Amazon S3]: http://aws.amazon.com/s3 + // [SOAP Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html Code *string // The error key. @@ -1179,19 +1689,103 @@ type Error struct { Message *string // The version ID of the error. + // + // This functionality is not supported for directory buckets. VersionId *string noSmithyDocumentSerde } +// If the CreateBucketMetadataTableConfiguration request succeeds, but S3 +// +// Metadata was unable to create the table, this structure contains the error code +// and error message. +type ErrorDetails struct { + + // If the CreateBucketMetadataTableConfiguration request succeeds, but S3 + // Metadata was unable to create the table, this structure contains the error code. + // The possible error codes and error messages are as follows: + // + // - AccessDeniedCreatingResources - You don't have sufficient permissions to + // create the required resources. Make sure that you have + // s3tables:CreateNamespace , s3tables:CreateTable , s3tables:GetTable and + // s3tables:PutTablePolicy permissions, and then try again. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - AccessDeniedWritingToTable - Unable to write to the metadata table because + // of missing resource permissions. To fix the resource policy, Amazon S3 needs to + // create a new metadata table. To create a new metadata table, you must delete the + // metadata configuration for this bucket, and then create a new metadata + // configuration. + // + // - DestinationTableNotFound - The destination table doesn't exist. To create a + // new metadata table, you must delete the metadata configuration for this bucket, + // and then create a new metadata configuration. + // + // - ServerInternalError - An internal error has occurred. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - TableAlreadyExists - The table that you specified already exists in the + // table bucket's namespace. Specify a different table name. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - TableBucketNotFound - The table bucket that you specified doesn't exist in + // this Amazon Web Services Region and account. Create or choose a different table + // bucket. To create a new metadata table, you must delete the metadata + // configuration for this bucket, and then create a new metadata configuration. + ErrorCode *string + + // If the CreateBucketMetadataTableConfiguration request succeeds, but S3 + // Metadata was unable to create the table, this structure contains the error + // message. The possible error codes and error messages are as follows: + // + // - AccessDeniedCreatingResources - You don't have sufficient permissions to + // create the required resources. Make sure that you have + // s3tables:CreateNamespace , s3tables:CreateTable , s3tables:GetTable and + // s3tables:PutTablePolicy permissions, and then try again. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - AccessDeniedWritingToTable - Unable to write to the metadata table because + // of missing resource permissions. To fix the resource policy, Amazon S3 needs to + // create a new metadata table. To create a new metadata table, you must delete the + // metadata configuration for this bucket, and then create a new metadata + // configuration. + // + // - DestinationTableNotFound - The destination table doesn't exist. To create a + // new metadata table, you must delete the metadata configuration for this bucket, + // and then create a new metadata configuration. + // + // - ServerInternalError - An internal error has occurred. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - TableAlreadyExists - The table that you specified already exists in the + // table bucket's namespace. Specify a different table name. To create a new + // metadata table, you must delete the metadata configuration for this bucket, and + // then create a new metadata configuration. + // + // - TableBucketNotFound - The table bucket that you specified doesn't exist in + // this Amazon Web Services Region and account. Create or choose a different table + // bucket. To create a new metadata table, you must delete the metadata + // configuration for this bucket, and then create a new metadata configuration. + ErrorMessage *string + + noSmithyDocumentSerde +} + // The error information. type ErrorDocument struct { - // The object key name to use when a 4XX class error occurs. Replacement must be - // made for object keys containing special characters (such as carriage returns) - // when using XML requests. For more information, see XML related object key - // constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // The object key name to use when a 4XX class error occurs. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints // // This member is required. Key *string @@ -1204,9 +1798,12 @@ type EventBridgeConfiguration struct { noSmithyDocumentSerde } -// Optional configuration to replicate existing source bucket objects. For more -// information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) -// in the Amazon S3 User Guide. +// Optional configuration to replicate existing source bucket objects. +// +// This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in +// the Amazon S3 User Guide. +// +// [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html type ExistingObjectReplication struct { // Specifies whether Amazon S3 replicates existing source bucket objects. @@ -1217,15 +1814,23 @@ type ExistingObjectReplication struct { noSmithyDocumentSerde } -// Specifies the Amazon S3 object key name to filter on and whether to filter on -// the suffix or prefix of the key name. +// Specifies the Amazon S3 object key name to filter on. An object key name is the +// name assigned to an object in your Amazon S3 bucket. You specify whether to +// filter on the suffix or prefix of the object key name. A prefix is a specific +// string of characters at the beginning of an object key name, which you can use +// to organize objects. For example, you can start the key names of related objects +// with a prefix, such as 2023- or engineering/ . Then, you can use FilterRule to +// find objects in a bucket with key names that have the same prefix. A suffix is +// similar to a prefix, but it is at the end of the object key name instead of at +// the beginning. type FilterRule struct { // The object key name prefix or suffix identifying one or more objects to which // the filtering rule applies. The maximum length is 1,024 characters. Overlapping - // prefixes and suffixes are not supported. For more information, see Configuring - // Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. + // prefixes and suffixes are not supported. For more information, see [Configuring Event Notifications]in the + // Amazon S3 User Guide. + // + // [Configuring Event Notifications]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html Name FilterRuleName // The value that the filter searches for in object key names. @@ -1234,16 +1839,46 @@ type FilterRule struct { noSmithyDocumentSerde } +// The metadata table configuration for a general purpose bucket. +type GetBucketMetadataTableConfigurationResult struct { + + // The metadata table configuration for a general purpose bucket. + // + // This member is required. + MetadataTableConfigurationResult *MetadataTableConfigurationResult + + // The status of the metadata table. The status values are: + // + // - CREATING - The metadata table is in the process of being created in the + // specified table bucket. + // + // - ACTIVE - The metadata table has been created successfully and records are + // being delivered to the table. + // + // - FAILED - Amazon S3 is unable to create the metadata table, or Amazon S3 is + // unable to deliver records. See ErrorDetails for details. + // + // This member is required. + Status *string + + // If the CreateBucketMetadataTableConfiguration request succeeds, but S3 + // Metadata was unable to create the table, this structure contains the error code + // and error message. + Error *ErrorDetails + + noSmithyDocumentSerde +} + // A collection of parts associated with a multipart upload. type GetObjectAttributesParts struct { // Indicates whether the returned list of parts is truncated. A value of true // indicates that the list was truncated. A list can be truncated if the number of // parts exceeds the limit returned in the MaxParts element. - IsTruncated bool + IsTruncated *bool // The maximum number of parts allowed in the response. - MaxParts int32 + MaxParts *int32 // When a list is truncated, this element specifies the last part in the list, as // well as the value to use for the PartNumberMarker request parameter in a @@ -1255,10 +1890,19 @@ type GetObjectAttributesParts struct { // A container for elements related to a particular part. A response can contain // zero or more Parts elements. + // + // - General purpose buckets - For GetObjectAttributes , if a additional checksum + // (including x-amz-checksum-crc32 , x-amz-checksum-crc32c , x-amz-checksum-sha1 + // , or x-amz-checksum-sha256 ) isn't applied to the object specified in the + // request, the response doesn't return Part . + // + // - Directory buckets - For GetObjectAttributes , no matter whether a additional + // checksum is applied to the object specified in the request, the response returns + // Part . Parts []ObjectPart // The total number of parts. - TotalPartsCount int32 + TotalPartsCount *int32 noSmithyDocumentSerde } @@ -1297,19 +1941,31 @@ type Grantee struct { // Screen name of the grantee. DisplayName *string - // Email address of the grantee. Using email addresses to specify a grantee is - // only supported in the following Amazon Web Services Regions: + // Email address of the grantee. + // + // Using email addresses to specify a grantee is only supported in the following + // Amazon Web Services Regions: + // // - US East (N. Virginia) + // // - US West (N. California) + // // - US West (Oregon) + // // - Asia Pacific (Singapore) + // // - Asia Pacific (Sydney) + // // - Asia Pacific (Tokyo) + // // - Europe (Ireland) + // // - South America (São Paulo) - // For a list of all the Amazon S3 supported Regions and endpoints, see Regions - // and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) - // in the Amazon Web Services General Reference. + // + // For a list of all the Amazon S3 supported Regions and endpoints, see [Regions and Endpoints] in the + // Amazon Web Services General Reference. + // + // [Regions and Endpoints]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region EmailAddress *string // The canonical user ID of the grantee. @@ -1325,13 +1981,15 @@ type Grantee struct { type IndexDocument struct { // A suffix that is appended to a request that is for a directory on the website - // endpoint (for example,if the suffix is index.html and you make a request to - // samplebucket/images/ the data that is returned will be for the object with the - // key name images/index.html) The suffix must not be empty and must not include a - // slash character. Replacement must be made for object keys containing special - // characters (such as carriage returns) when using XML requests. For more - // information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // endpoint. (For example, if the suffix is index.html and you make a request to + // samplebucket/images/ , the data that is returned will be for the object with the + // key name images/index.html .) The suffix must not be empty and must not include + // a slash character. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints // // This member is required. Suffix *string @@ -1343,10 +2001,16 @@ type IndexDocument struct { type Initiator struct { // Name of the Principal. + // + // This functionality is not supported for directory buckets. DisplayName *string // If the principal is an Amazon Web Services account, it provides the Canonical // User ID. If the principal is an IAM User, it provides a user ARN value. + // + // Directory buckets - If the principal is an Amazon Web Services account, it + // provides the Amazon Web Services account ID. If the principal is an IAM User, it + // provides a user ARN value. ID *string noSmithyDocumentSerde @@ -1386,10 +2050,11 @@ type IntelligentTieringAndOperator struct { noSmithyDocumentSerde } -// Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. For -// information about the S3 Intelligent-Tiering storage class, see Storage class -// for automatically optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) -// . +// Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. +// +// For information about the S3 Intelligent-Tiering storage class, see [Storage class for automatically optimizing frequently and infrequently accessed objects]. +// +// [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access type IntelligentTieringConfiguration struct { // The ID used to identify the S3 Intelligent-Tiering configuration. @@ -1424,10 +2089,12 @@ type IntelligentTieringFilter struct { And *IntelligentTieringAndOperator // An object key name prefix that identifies the subset of objects to which the - // rule applies. Replacement must be made for object keys containing special - // characters (such as carriage returns) when using XML requests. For more - // information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // rule applies. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints Prefix *string // A container of a key value name pair. @@ -1437,8 +2104,9 @@ type IntelligentTieringFilter struct { } // Specifies the inventory configuration for an Amazon S3 bucket. For more -// information, see GET Bucket inventory (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) -// in the Amazon S3 API Reference. +// information, see [GET Bucket inventory]in the Amazon S3 API Reference. +// +// [GET Bucket inventory]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html type InventoryConfiguration struct { // Contains information about where to publish the inventory results. @@ -1463,7 +2131,7 @@ type InventoryConfiguration struct { // inventory list is generated. If set to False , no inventory list is generated. // // This member is required. - IsEnabled bool + IsEnabled *bool // Specifies the schedule for generating inventory results. // @@ -1533,9 +2201,10 @@ type InventoryS3BucketDestination struct { Format InventoryFormat // The account ID that owns the destination S3 bucket. If no account ID is - // provided, the owner is not validated before exporting data. Although this value - // is optional, we strongly recommend that you set it to help prevent problems if - // the destination bucket ownership changes. + // provided, the owner is not validated before exporting data. + // + // Although this value is optional, we strongly recommend that you set it to help + // prevent problems if the destination bucket ownership changes. AccountId *string // Contains the type of server-side encryption used to encrypt the inventory @@ -1582,8 +2251,9 @@ type JSONOutput struct { type LambdaFunctionConfiguration struct { // The Amazon S3 bucket event for which to invoke the Lambda function. For more - // information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. + // information, see [Supported Event Types]in the Amazon S3 User Guide. + // + // [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html // // This member is required. Events []Event @@ -1595,8 +2265,9 @@ type LambdaFunctionConfiguration struct { LambdaFunctionArn *string // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring event notifications using object key name filtering (https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) - // in the Amazon S3 User Guide. + // filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + // + // [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html Filter *NotificationConfigurationFilter // An optional unique identifier for configurations in a notification @@ -1606,31 +2277,41 @@ type LambdaFunctionConfiguration struct { noSmithyDocumentSerde } -// Container for the expiration for the lifecycle of the object. For more -// information see, Managing your storage lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) -// in the Amazon S3 User Guide. +// Container for the expiration for the lifecycle of the object. +// +// For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. +// +// [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html type LifecycleExpiration struct { // Indicates at what date the object is to be moved or deleted. The date value // must conform to the ISO 8601 format. The time is always midnight UTC. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. Date *time.Time // Indicates the lifetime, in days, of the objects that are subject to the rule. // The value must be a non-zero positive integer. - Days int32 + Days *int32 // Indicates whether Amazon S3 will remove a delete marker with no noncurrent // versions. If set to true, the delete marker will be expired; if set to false the // policy takes no action. This cannot be specified with Days or Date in a // Lifecycle Expiration Policy. - ExpiredObjectDeleteMarker bool + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + ExpiredObjectDeleteMarker *bool noSmithyDocumentSerde } -// A lifecycle rule for individual objects in an Amazon S3 bucket. For more -// information see, Managing your storage lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) -// in the Amazon S3 User Guide. +// A lifecycle rule for individual objects in an Amazon S3 bucket. +// +// For more information see, [Managing your storage lifecycle] in the Amazon S3 User Guide. +// +// [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html type LifecycleRule struct { // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is @@ -1641,9 +2322,9 @@ type LifecycleRule struct { // Specifies the days since the initiation of an incomplete multipart upload that // Amazon S3 will wait before permanently removing all parts of the upload. For - // more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // in the Amazon S3 User Guide. + // more information, see [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]in the Amazon S3 User Guide. + // + // [Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload // Specifies the expiration for the lifecycle of the object in the form of date, @@ -1653,7 +2334,9 @@ type LifecycleRule struct { // The Filter is used to identify objects that a Lifecycle Rule applies to. A // Filter must have exactly one of Prefix , Tag , or And specified. Filter is // required if the LifecycleRule does not contain a Prefix element. - Filter LifecycleRuleFilter + // + // Tag filters are not supported for directory buckets. + Filter *LifecycleRuleFilter // Unique identifier for the rule. The value cannot be longer than 255 characters. ID *string @@ -1663,6 +2346,9 @@ type LifecycleRule struct { // configuration action on a bucket that has versioning enabled (or suspended) to // request that Amazon S3 delete noncurrent object versions at a specific period in // the object's lifetime. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. NoncurrentVersionExpiration *NoncurrentVersionExpiration // Specifies the transition rule for the lifecycle rule that describes when @@ -1670,18 +2356,26 @@ type LifecycleRule struct { // versioning-enabled (or versioning is suspended), you can set this action to // request that Amazon S3 transition noncurrent object versions to a specific // storage class at a set period in the object's lifetime. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. NoncurrentVersionTransitions []NoncurrentVersionTransition // Prefix identifying one or more objects to which the rule applies. This is no - // longer used; use Filter instead. Replacement must be made for object keys - // containing special characters (such as carriage returns) when using XML - // requests. For more information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // longer used; use Filter instead. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints // // Deprecated: This member has been deprecated. Prefix *string // Specifies when an Amazon S3 object transitions to a specified storage class. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. Transitions []Transition noSmithyDocumentSerde @@ -1693,10 +2387,10 @@ type LifecycleRule struct { type LifecycleRuleAndOperator struct { // Minimum object size to which the rule applies. - ObjectSizeGreaterThan int64 + ObjectSizeGreaterThan *int64 // Maximum object size to which the rule applies. - ObjectSizeLessThan int64 + ObjectSizeLessThan *int64 // Prefix identifying one or more objects to which the rule applies. Prefix *string @@ -1709,73 +2403,67 @@ type LifecycleRuleAndOperator struct { } // The Filter is used to identify objects that a Lifecycle Rule applies to. A -// Filter must have exactly one of Prefix , Tag , or And specified. -// -// The following types satisfy this interface: -// -// LifecycleRuleFilterMemberAnd -// LifecycleRuleFilterMemberObjectSizeGreaterThan -// LifecycleRuleFilterMemberObjectSizeLessThan -// LifecycleRuleFilterMemberPrefix -// LifecycleRuleFilterMemberTag -type LifecycleRuleFilter interface { - isLifecycleRuleFilter() -} - -// This is used in a Lifecycle Rule Filter to apply a logical AND to two or more -// predicates. The Lifecycle Rule will apply to any object matching all of the -// predicates configured inside the And operator. -type LifecycleRuleFilterMemberAnd struct { - Value LifecycleRuleAndOperator - - noSmithyDocumentSerde -} +// Filter can have exactly one of Prefix , Tag , ObjectSizeGreaterThan , +// ObjectSizeLessThan , or And specified. If the Filter element is left empty, the +// Lifecycle Rule applies to all objects in the bucket. +type LifecycleRuleFilter struct { -func (*LifecycleRuleFilterMemberAnd) isLifecycleRuleFilter() {} + // This is used in a Lifecycle Rule Filter to apply a logical AND to two or more + // predicates. The Lifecycle Rule will apply to any object matching all of the + // predicates configured inside the And operator. + And *LifecycleRuleAndOperator -// Minimum object size to which the rule applies. -type LifecycleRuleFilterMemberObjectSizeGreaterThan struct { - Value int64 + // Minimum object size to which the rule applies. + ObjectSizeGreaterThan *int64 - noSmithyDocumentSerde -} + // Maximum object size to which the rule applies. + ObjectSizeLessThan *int64 -func (*LifecycleRuleFilterMemberObjectSizeGreaterThan) isLifecycleRuleFilter() {} + // Prefix identifying one or more objects to which the rule applies. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + Prefix *string -// Maximum object size to which the rule applies. -type LifecycleRuleFilterMemberObjectSizeLessThan struct { - Value int64 + // This tag must exist in the object's tag set in order for the rule to apply. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + Tag *Tag noSmithyDocumentSerde } -func (*LifecycleRuleFilterMemberObjectSizeLessThan) isLifecycleRuleFilter() {} - -// Prefix identifying one or more objects to which the rule applies. Replacement -// must be made for object keys containing special characters (such as carriage -// returns) when using XML requests. For more information, see XML related object -// key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) -// . -type LifecycleRuleFilterMemberPrefix struct { - Value string - - noSmithyDocumentSerde -} +// Specifies the location where the bucket will be created. +// +// For directory buckets, the location type is Availability Zone or Local Zone. +// For more information about directory buckets, see [Directory buckets]in the Amazon S3 User Guide. +// +// This functionality is only supported by directory buckets. +// +// [Directory buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html +type LocationInfo struct { -func (*LifecycleRuleFilterMemberPrefix) isLifecycleRuleFilter() {} + // The name of the location where the bucket will be created. + // + // For directory buckets, the name of the location is the Zone ID of the + // Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An + // example AZ ID value is usw2-az1 . + Name *string -// This tag must exist in the object's tag set in order for the rule to apply. -type LifecycleRuleFilterMemberTag struct { - Value Tag + // The type of location where the bucket will be created. + Type LocationType noSmithyDocumentSerde } -func (*LifecycleRuleFilterMemberTag) isLifecycleRuleFilter() {} - // Describes where logs are stored and the prefix that Amazon S3 assigns to all -// log object keys for a bucket. For more information, see PUT Bucket logging (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) -// in the Amazon S3 API Reference. +// log object keys for a bucket. For more information, see [PUT Bucket logging]in the Amazon S3 API +// Reference. +// +// [PUT Bucket logging]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html type LoggingEnabled struct { // Specifies the bucket where you want Amazon S3 to store server access logs. You @@ -1795,37 +2483,75 @@ type LoggingEnabled struct { // This member is required. TargetPrefix *string - // Container for granting information. Buckets that use the bucket owner enforced - // setting for Object Ownership don't support target grants. For more information, - // see Permissions for server access log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) - // in the Amazon S3 User Guide. + // Container for granting information. + // + // Buckets that use the bucket owner enforced setting for Object Ownership don't + // support target grants. For more information, see [Permissions for server access log delivery]in the Amazon S3 User Guide. + // + // [Permissions for server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general TargetGrants []TargetGrant + // Amazon S3 key format for log objects. + TargetObjectKeyFormat *TargetObjectKeyFormat + + noSmithyDocumentSerde +} + +// A metadata key-value pair to store with an object. +type MetadataEntry struct { + + // Name of the object. + Name *string + + // Value of the object. + Value *string + + noSmithyDocumentSerde +} + +// The metadata table configuration for a general purpose bucket. +type MetadataTableConfiguration struct { + + // The destination information for the metadata table configuration. The + // destination table bucket must be in the same Region and Amazon Web Services + // account as the general purpose bucket. The specified metadata table name must be + // unique within the aws_s3_metadata namespace in the destination table bucket. + // + // This member is required. + S3TablesDestination *S3TablesDestination + noSmithyDocumentSerde } -// A metadata key-value pair to store with an object. -type MetadataEntry struct { - - // Name of the object. - Name *string - - // Value of the object. - Value *string +// The metadata table configuration for a general purpose bucket. The destination +// +// table bucket must be in the same Region and Amazon Web Services account as the +// general purpose bucket. The specified metadata table name must be unique within +// the aws_s3_metadata namespace in the destination table bucket. +type MetadataTableConfigurationResult struct { + + // The destination information for the metadata table configuration. The + // destination table bucket must be in the same Region and Amazon Web Services + // account as the general purpose bucket. The specified metadata table name must be + // unique within the aws_s3_metadata namespace in the destination table bucket. + // + // This member is required. + S3TablesDestinationResult *S3TablesDestinationResult noSmithyDocumentSerde } -// A container specifying replication metrics-related settings enabling +// A container specifying replication metrics-related settings enabling +// // replication metrics and events. type Metrics struct { - // Specifies whether the replication metrics are enabled. + // Specifies whether the replication metrics are enabled. // // This member is required. Status MetricsStatus - // A container specifying the time threshold for emitting the + // A container specifying the time threshold for emitting the // s3:Replication:OperationMissedThreshold event. EventThreshold *ReplicationTimeValue @@ -1853,8 +2579,9 @@ type MetricsAndOperator struct { // by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an // existing metrics configuration, note that this is a full replacement of the // existing metrics configuration. If you don't include the elements you want to -// keep, they are erased. For more information, see PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html) -// . +// keep, they are erased. For more information, see [PutBucketMetricsConfiguration]. +// +// [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html type MetricsConfiguration struct { // The ID used to identify the metrics configuration. The ID has a 64 character @@ -1874,8 +2601,7 @@ type MetricsConfiguration struct { // Specifies a metrics configuration filter. The metrics configuration only // includes objects that meet the filter's criteria. A filter must be a prefix, an // object tag, an access point ARN, or a conjunction (MetricsAndOperator). For more -// information, see PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// . +// information, see [PutBucketMetricsConfiguration]. // // The following types satisfy this interface: // @@ -1883,6 +2609,8 @@ type MetricsConfiguration struct { // MetricsFilterMemberAnd // MetricsFilterMemberPrefix // MetricsFilterMemberTag +// +// [PutBucketMetricsConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html type MetricsFilter interface { isMetricsFilter() } @@ -1941,9 +2669,15 @@ type MultipartUpload struct { Key *string // Specifies the owner of the object that is part of the multipart upload. + // + // Directory buckets - The bucket owner is returned as the object owner for all + // the objects. Owner *Owner // The class of storage used to store the object. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. StorageClass StorageClass // Upload ID that identifies the multipart upload. @@ -1957,21 +2691,32 @@ type MultipartUpload struct { // configuration action on a bucket that has versioning enabled (or suspended) to // request that Amazon S3 delete noncurrent object versions at a specific period in // the object's lifetime. +// +// This parameter applies to general purpose buckets only. It is not supported for +// directory bucket lifecycle configurations. type NoncurrentVersionExpiration struct { - // Specifies how many noncurrent versions Amazon S3 will retain. If there are this - // many more recent noncurrent versions, Amazon S3 will take the associated action. - // For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) - // in the Amazon S3 User Guide. - NewerNoncurrentVersions int32 + // Specifies how many noncurrent versions Amazon S3 will retain. You can specify + // up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any + // additional noncurrent versions beyond the specified number to retain. For more + // information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // + // [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + NewerNoncurrentVersions *int32 // Specifies the number of days an object is noncurrent before Amazon S3 can // perform the associated action. The value must be a non-zero positive integer. - // For information about the noncurrent days calculations, see How Amazon S3 - // Calculates When an Object Became Noncurrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon S3 User Guide. - NoncurrentDays int32 + // For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 + // User Guide. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // + // [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + NoncurrentDays *int32 noSmithyDocumentSerde } @@ -1985,19 +2730,21 @@ type NoncurrentVersionExpiration struct { // specific period in the object's lifetime. type NoncurrentVersionTransition struct { - // Specifies how many noncurrent versions Amazon S3 will retain. If there are this - // many more recent noncurrent versions, Amazon S3 will take the associated action. - // For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) - // in the Amazon S3 User Guide. - NewerNoncurrentVersions int32 + // Specifies how many noncurrent versions Amazon S3 will retain in the same + // storage class before transitioning objects. You can specify up to 100 noncurrent + // versions to retain. Amazon S3 will transition any additional noncurrent versions + // beyond the specified number to retain. For more information about noncurrent + // versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. + // + // [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html + NewerNoncurrentVersions *int32 // Specifies the number of days an object is noncurrent before Amazon S3 can // perform the associated action. For information about the noncurrent days - // calculations, see How Amazon S3 Calculates How Long an Object Has Been - // Noncurrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon S3 User Guide. - NoncurrentDays int32 + // calculations, see [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]in the Amazon S3 User Guide. + // + // [How Amazon S3 Calculates How Long an Object Has Been Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations + NoncurrentDays *int32 // The class of storage used to store the object. StorageClass TransitionStorageClass @@ -2028,8 +2775,9 @@ type NotificationConfiguration struct { } // Specifies object key name filtering rules. For information about key name -// filtering, see Configuring event notifications using object key name filtering (https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) -// in the Amazon S3 User Guide. +// filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. +// +// [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html type NotificationConfigurationFilter struct { // A container for object key name prefix and suffix filtering rules. @@ -2048,17 +2796,22 @@ type Object struct { // contents of an object, not its metadata. The ETag may or may not be an MD5 // digest of the object data. Whether or not it is depends on how the object was // created and how it is encrypted as described below: + // // - Objects created by the PUT Object, POST Object, or Copy operation, or // through the Amazon Web Services Management Console, and are encrypted by SSE-S3 // or plaintext, have ETags that are an MD5 digest of their object data. + // // - Objects created by the PUT Object, POST Object, or Copy operation, or // through the Amazon Web Services Management Console, and are encrypted by SSE-C // or SSE-KMS, have ETags that are not an MD5 digest of their object data. + // // - If an object is created by either the Multipart Upload or Part Copy // operation, the ETag is not an MD5 digest, regardless of the method of // encryption. If an object is larger than 16 MB, the Amazon Web Services // Management Console will upload or copy that object as a Multipart Upload, and // therefore the ETag will not be an MD5 digest. + // + // Directory buckets - MD5 is not supported by directory buckets. ETag *string // The name that you assign to an object. You use the object key to retrieve the @@ -2069,19 +2822,28 @@ type Object struct { LastModified *time.Time // The owner of the object + // + // Directory buckets - The bucket owner is returned as the object owner. Owner *Owner // Specifies the restoration status of an object. Objects in certain storage // classes must be restored before they can be retrieved. For more information - // about these storage classes and how to work with archived objects, see Working - // with archived objects (https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html) - // in the Amazon S3 User Guide. + // about these storage classes and how to work with archived objects, see [Working with archived objects]in the + // Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. Only the S3 Express + // One Zone storage class is supported by directory buckets to store objects. + // + // [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html RestoreStatus *RestoreStatus // Size in bytes of the object - Size int64 + Size *int64 // The class of storage used to store the object. + // + // Directory buckets - Only the S3 Express One Zone storage class is supported by + // directory buckets to store objects. StorageClass ObjectStorageClass noSmithyDocumentSerde @@ -2090,15 +2852,39 @@ type Object struct { // Object Identifier is unique value to identify objects. type ObjectIdentifier struct { - // Key name of the object. Replacement must be made for object keys containing - // special characters (such as carriage returns) when using XML requests. For more - // information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // Key name of the object. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints // // This member is required. Key *string - // VersionId for the specific version of the object to delete. + // An entity tag (ETag) is an identifier assigned by a web server to a specific + // version of a resource found at a URL. This header field makes the request method + // conditional on ETags . + // + // Entity tags (ETags) for S3 Express One Zone are random alphanumeric strings + // unique to the object. + ETag *string + + // If present, the objects are deleted only if its modification times matches the + // provided Timestamp . + // + // This functionality is only supported for directory buckets. + LastModifiedTime *time.Time + + // If present, the objects are deleted only if its size matches the provided size + // in bytes. + // + // This functionality is only supported for directory buckets. + Size *int64 + + // Version ID for the specific version of the object to delete. + // + // This functionality is not supported for directory buckets. VersionId *string noSmithyDocumentSerde @@ -2158,38 +2944,51 @@ type ObjectPart struct { // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32 checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // The base64-encoded, 256-bit SHA-256 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA256 *string // The part number identifying the part. This value is a positive integer between // 1 and 10,000. - PartNumber int32 + PartNumber *int32 // The size of the uploaded part in bytes. - Size int64 + Size *int64 noSmithyDocumentSerde } @@ -2205,12 +3004,12 @@ type ObjectVersion struct { // Specifies whether the object is (true) or is not (false) the latest version of // an object. - IsLatest bool + IsLatest *bool // The object key. Key *string - // Date and time the object was last modified. + // Date and time when the object was last modified. LastModified *time.Time // Specifies the owner of the object. @@ -2218,13 +3017,14 @@ type ObjectVersion struct { // Specifies the restoration status of an object. Objects in certain storage // classes must be restored before they can be retrieved. For more information - // about these storage classes and how to work with archived objects, see Working - // with archived objects (https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html) - // in the Amazon S3 User Guide. + // about these storage classes and how to work with archived objects, see [Working with archived objects]in the + // Amazon S3 User Guide. + // + // [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html RestoreStatus *RestoreStatus // Size in bytes of the object. - Size int64 + Size *int64 // The class of storage used to store the object. StorageClass ObjectVersionStorageClass @@ -2261,14 +3061,24 @@ type Owner struct { // Container for the display name of the owner. This value is only supported in // the following Amazon Web Services Regions: + // // - US East (N. Virginia) + // // - US West (N. California) + // // - US West (Oregon) + // // - Asia Pacific (Singapore) + // // - Asia Pacific (Sydney) + // // - Asia Pacific (Tokyo) + // // - Europe (Ireland) + // // - South America (São Paulo) + // + // This functionality is not supported for directory buckets. DisplayName *string // Container for the ID of the owner. @@ -2292,16 +3102,30 @@ type OwnershipControls struct { type OwnershipControlsRule struct { // The container element for object ownership for a bucket's ownership controls. + // // BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the // bucket owner if the objects are uploaded with the bucket-owner-full-control - // canned ACL. ObjectWriter - The uploading account will own the object if the - // object is uploaded with the bucket-owner-full-control canned ACL. + // canned ACL. + // + // ObjectWriter - The uploading account will own the object if the object is + // uploaded with the bucket-owner-full-control canned ACL. + // // BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer // affect permissions. The bucket owner automatically owns and has full control // over every object in the bucket. The bucket only accepts PUT requests that don't - // specify an ACL or bucket owner full control ACLs, such as the - // bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed - // in the XML format. + // specify an ACL or specify bucket owner full control ACLs (such as the predefined + // bucket-owner-full-control canned ACL or a custom ACL in XML format that grants + // the same permissions). + // + // By default, ObjectOwnership is set to BucketOwnerEnforced and ACLs are + // disabled. We recommend keeping ACLs disabled, except in uncommon use cases where + // you must control access for each object individually. For more information about + // S3 Object Ownership, see [Controlling ownership of objects and disabling ACLs for your bucket]in the Amazon S3 User Guide. + // + // This functionality is not supported for directory buckets. Directory buckets + // use the bucket owner enforced setting for S3 Object Ownership. + // + // [Controlling ownership of objects and disabling ACLs for your bucket]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html // // This member is required. ObjectOwnership ObjectOwnership @@ -2319,30 +3143,40 @@ type Part struct { // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 32-bit CRC32 checksum of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 32-bit CRC-32 checksum of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumCRC32 *string - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // The base64-encoded, 32-bit CRC-32C checksum of the object. This will only be + // present if it was uploaded with the object. When you use an API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumCRC32C *string // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this may not - // be a checksum value of the object. For more information about how checksums are - // calculated with multipart uploads, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. + // present if it was uploaded with the object. When you use the API operation on an + // object that was uploaded using multipart uploads, this value may not be a direct + // checksum value of the full object. Instead, it's a calculation based on the + // checksum values of each individual part. For more information about how + // checksums are calculated with multipart uploads, see [Checking object integrity]in the Amazon S3 User + // Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums ChecksumSHA1 *string // This header can be used as a data integrity check to verify that the data // received is the same data that was originally sent. This header specifies the - // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see - // Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) + // base64-encoded, 256-bit SHA-256 digest of the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. + // + // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html ChecksumSHA256 *string // Entity tag returned when the part was uploaded. @@ -2353,10 +3187,32 @@ type Part struct { // Part number identifying the part. This is a positive integer between 1 and // 10,000. - PartNumber int32 + PartNumber *int32 // Size in bytes of the uploaded part data. - Size int64 + Size *int64 + + noSmithyDocumentSerde +} + +// Amazon S3 keys for log objects are partitioned in the following format: +// +// [DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] +// +// PartitionedPrefix defaults to EventTime delivery when server access logs are +// delivered. +type PartitionedPrefix struct { + + // Specifies the partition date source for the partitioned prefix. + // PartitionDateSource can be EventTime or DeliveryTime . + // + // For DeliveryTime , the time in the log file names corresponds to the delivery + // time for the log files. + // + // For EventTime , The logs delivered are for a specific day only. The year, month, + // and day correspond to the day on which the event occurred, and the hour, minutes + // and seconds are set to 00 in the key. + PartitionDateSource PartitionDateSource noSmithyDocumentSerde } @@ -2366,7 +3222,7 @@ type PolicyStatus struct { // The policy status for this bucket. TRUE indicates that this bucket is public. // FALSE indicates that the bucket is not public. - IsPublic bool + IsPublic *bool noSmithyDocumentSerde } @@ -2375,13 +3231,13 @@ type PolicyStatus struct { type Progress struct { // The current number of uncompressed object bytes processed. - BytesProcessed int64 + BytesProcessed *int64 // The current number of bytes of records payload data returned. - BytesReturned int64 + BytesReturned *int64 // The current number of object bytes scanned. - BytesScanned int64 + BytesScanned *int64 noSmithyDocumentSerde } @@ -2397,42 +3253,49 @@ type ProgressEvent struct { // The PublicAccessBlock configuration that you want to apply to this Amazon S3 // bucket. You can enable the configuration options in any combination. For more -// information about when Amazon S3 considers a bucket or object public, see The -// Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// in the Amazon S3 User Guide. +// information about when Amazon S3 considers a bucket or object public, see [The Meaning of "Public"]in +// the Amazon S3 User Guide. +// +// [The Meaning of "Public"]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status type PublicAccessBlockConfiguration struct { // Specifies whether Amazon S3 should block public access control lists (ACLs) for // this bucket and objects in this bucket. Setting this element to TRUE causes the // following behavior: - // - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is - // public. + // + // - PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + // // - PUT Object calls fail if the request includes a public ACL. + // // - PUT Bucket calls fail if the request includes a public ACL. + // // Enabling this setting doesn't affect existing policies or ACLs. - BlockPublicAcls bool + BlockPublicAcls *bool // Specifies whether Amazon S3 should block public bucket policies for this // bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT - // Bucket policy if the specified bucket policy allows public access. Enabling this - // setting doesn't affect existing bucket policies. - BlockPublicPolicy bool + // Bucket policy if the specified bucket policy allows public access. + // + // Enabling this setting doesn't affect existing bucket policies. + BlockPublicPolicy *bool // Specifies whether Amazon S3 should ignore public ACLs for this bucket and // objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore - // all public ACLs on this bucket and objects in this bucket. Enabling this setting - // doesn't affect the persistence of any existing ACLs and doesn't prevent new - // public ACLs from being set. - IgnorePublicAcls bool + // all public ACLs on this bucket and objects in this bucket. + // + // Enabling this setting doesn't affect the persistence of any existing ACLs and + // doesn't prevent new public ACLs from being set. + IgnorePublicAcls *bool // Specifies whether Amazon S3 should restrict public bucket policies for this // bucket. Setting this element to TRUE restricts access to this bucket to only - // Amazon Web Service principals and authorized users within this account if the - // bucket has a public policy. Enabling this setting doesn't affect previously - // stored bucket policies, except that public and cross-account access within any - // public bucket policy, including non-public delegation to specific accounts, is - // blocked. - RestrictPublicBuckets bool + // Amazon Web Services service principals and authorized users within this account + // if the bucket has a public policy. + // + // Enabling this setting doesn't affect previously stored bucket policies, except + // that public and cross-account access within any public bucket policy, including + // non-public delegation to specific accounts, is blocked. + RestrictPublicBuckets *bool noSmithyDocumentSerde } @@ -2453,8 +3316,9 @@ type QueueConfiguration struct { QueueArn *string // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring event notifications using object key name filtering (https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) - // in the Amazon S3 User Guide. + // filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + // + // [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html Filter *NotificationConfigurationFilter // An optional unique identifier for configurations in a notification @@ -2467,7 +3331,14 @@ type QueueConfiguration struct { // The container for the records event. type RecordsEvent struct { - // The byte array of partial, one or more result records. + // The byte array of partial, one or more result records. S3 Select doesn't + // guarantee that a record will be self-contained in one record frame. To ensure + // continuous streaming of data, S3 Select might split the same record across + // multiple record frames instead of aggregating the results in memory. Some S3 + // clients (for example, the SDK for Java) handle this behavior by creating a + // ByteStream out of the response by default. Other clients might not handle this + // behavior by default. In those cases, you must aggregate the results on the + // client side and parse the response. Payload []byte noSmithyDocumentSerde @@ -2493,18 +3364,22 @@ type Redirect struct { // documents/ , you can set a condition block with KeyPrefixEquals set to docs/ // and in the Redirect set ReplaceKeyPrefixWith to /documents . Not required if one // of the siblings is present. Can be present only if ReplaceKeyWith is not - // provided. Replacement must be made for object keys containing special characters - // (such as carriage returns) when using XML requests. For more information, see - // XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // provided. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints ReplaceKeyPrefixWith *string // The specific object key to use in the redirect request. For example, redirect // request to error.html . Not required if one of the siblings is present. Can be - // present only if ReplaceKeyPrefixWith is not provided. Replacement must be made - // for object keys containing special characters (such as carriage returns) when - // using XML requests. For more information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // present only if ReplaceKeyPrefixWith is not provided. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints ReplaceKeyWith *string noSmithyDocumentSerde @@ -2530,9 +3405,11 @@ type RedirectAllRequestsTo struct { // Amazon S3 doesn't replicate replica modifications by default. In the latest // version of replication configuration (when Filter is specified), you can // specify this element and set the status to Enabled to replicate modifications -// on replicas. If you don't specify the Filter element, Amazon S3 assumes that -// the replication configuration is the earlier version, V1. In the earlier -// version, this element is not allowed. +// on replicas. +// +// If you don't specify the Filter element, Amazon S3 assumes that the replication +// configuration is the earlier version, V1. In the earlier version, this element +// is not allowed. type ReplicaModifications struct { // Specifies whether Amazon S3 replicates modifications on replicas. @@ -2548,9 +3425,10 @@ type ReplicaModifications struct { type ReplicationConfiguration struct { // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role - // that Amazon S3 assumes when replicating objects. For more information, see How - // to Set Up Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) - // in the Amazon S3 User Guide. + // that Amazon S3 assumes when replicating objects. For more information, see [How to Set Up Replication]in + // the Amazon S3 User Guide. + // + // [How to Set Up Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html // // This member is required. Role *string @@ -2583,34 +3461,41 @@ type ReplicationRule struct { // DeleteMarkerReplication element. If your Filter includes a Tag element, the // DeleteMarkerReplication Status must be set to Disabled, because Amazon S3 does // not support replicating delete markers for tag-based rules. For an example - // configuration, see Basic Rule Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config) - // . For more information about delete marker replication, see Basic Rule - // Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html) - // . If you are using an earlier version of the replication configuration, Amazon - // S3 handles replication of delete markers differently. For more information, see - // Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations) - // . + // configuration, see [Basic Rule Configuration]. + // + // For more information about delete marker replication, see [Basic Rule Configuration]. + // + // If you are using an earlier version of the replication configuration, Amazon S3 + // handles replication of delete markers differently. For more information, see [Backward Compatibility]. + // + // [Basic Rule Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html + // [Backward Compatibility]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations DeleteMarkerReplication *DeleteMarkerReplication - // Optional configuration to replicate existing source bucket objects. For more - // information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) - // in the Amazon S3 User Guide. + // Optional configuration to replicate existing source bucket objects. + // + // This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in + // the Amazon S3 User Guide. + // + // [Replicating existing objects with S3 Batch Replication]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-batch-replication-batch.html ExistingObjectReplication *ExistingObjectReplication // A filter that identifies the subset of objects to which the replication rule // applies. A Filter must specify exactly one Prefix , Tag , or an And child // element. - Filter ReplicationRuleFilter + Filter *ReplicationRuleFilter // A unique identifier for the rule. The maximum value is 255 characters. ID *string // An object key name prefix that identifies the object or objects to which the // rule applies. The maximum prefix length is 1,024 characters. To include all - // objects in a bucket, specify an empty string. Replacement must be made for - // object keys containing special characters (such as carriage returns) when using - // XML requests. For more information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) - // . + // objects in a bucket, specify an empty string. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints // // Deprecated: This member has been deprecated. Prefix *string @@ -2620,9 +3505,11 @@ type ReplicationRule struct { // according to all replication rules. However, if there are two or more rules with // the same destination bucket, then objects will be replicated according to the // rule with the highest priority. The higher the number, the higher the priority. - // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) - // in the Amazon S3 User Guide. - Priority int32 + // + // For more information, see [Replication] in the Amazon S3 User Guide. + // + // [Replication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html + Priority *int32 // A container that describes additional filters for identifying the source // objects that you want to replicate. You can choose to enable or disable the @@ -2636,9 +3523,13 @@ type ReplicationRule struct { // A container for specifying rule filters. The filters determine the subset of // objects to which the rule applies. This element is required only if you specify -// more than one filter. For example: +// more than one filter. +// +// For example: +// // - If you specify both a Prefix and a Tag filter, wrap these filters in an And // tag. +// // - If you specify a filter based on multiple tags, wrap the Tag elements in an // And tag. type ReplicationRuleAndOperator struct { @@ -2656,67 +3547,50 @@ type ReplicationRuleAndOperator struct { // A filter that identifies the subset of objects to which the replication rule // applies. A Filter must specify exactly one Prefix , Tag , or an And child // element. -// -// The following types satisfy this interface: -// -// ReplicationRuleFilterMemberAnd -// ReplicationRuleFilterMemberPrefix -// ReplicationRuleFilterMemberTag -type ReplicationRuleFilter interface { - isReplicationRuleFilter() -} - -// A container for specifying rule filters. The filters determine the subset of -// objects to which the rule applies. This element is required only if you specify -// more than one filter. For example: -// - If you specify both a Prefix and a Tag filter, wrap these filters in an And -// tag. -// - If you specify a filter based on multiple tags, wrap the Tag elements in an -// And tag. -type ReplicationRuleFilterMemberAnd struct { - Value ReplicationRuleAndOperator - - noSmithyDocumentSerde -} - -func (*ReplicationRuleFilterMemberAnd) isReplicationRuleFilter() {} - -// An object key name prefix that identifies the subset of objects to which the -// rule applies. Replacement must be made for object keys containing special -// characters (such as carriage returns) when using XML requests. For more -// information, see XML related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints) -// . -type ReplicationRuleFilterMemberPrefix struct { - Value string +type ReplicationRuleFilter struct { - noSmithyDocumentSerde -} + // A container for specifying rule filters. The filters determine the subset of + // objects to which the rule applies. This element is required only if you specify + // more than one filter. For example: + // + // - If you specify both a Prefix and a Tag filter, wrap these filters in an And + // tag. + // + // - If you specify a filter based on multiple tags, wrap the Tag elements in an + // And tag. + And *ReplicationRuleAndOperator -func (*ReplicationRuleFilterMemberPrefix) isReplicationRuleFilter() {} + // An object key name prefix that identifies the subset of objects to which the + // rule applies. + // + // Replacement must be made for object keys containing special characters (such as + // carriage returns) when using XML requests. For more information, see [XML related object key constraints]. + // + // [XML related object key constraints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints + Prefix *string -// A container for specifying a tag key and value. The rule applies only to -// objects that have the tag in their tag set. -type ReplicationRuleFilterMemberTag struct { - Value Tag + // A container for specifying a tag key and value. + // + // The rule applies only to objects that have the tag in their tag set. + Tag *Tag noSmithyDocumentSerde } -func (*ReplicationRuleFilterMemberTag) isReplicationRuleFilter() {} - -// A container specifying S3 Replication Time Control (S3 RTC) related +// A container specifying S3 Replication Time Control (S3 RTC) related +// // information, including whether S3 RTC is enabled and the time when all objects // and operations on objects must be replicated. Must be specified together with a // Metrics block. type ReplicationTime struct { - // Specifies whether the replication time is enabled. + // Specifies whether the replication time is enabled. // // This member is required. Status ReplicationTimeStatus - // A container specifying the time by which replication should be complete for all - // objects and operations on objects. + // A container specifying the time by which replication should be complete for + // all objects and operations on objects. // // This member is required. Time *ReplicationTimeValue @@ -2724,12 +3598,15 @@ type ReplicationTime struct { noSmithyDocumentSerde } -// A container specifying the time value for S3 Replication Time Control (S3 RTC) +// A container specifying the time value for S3 Replication Time Control (S3 RTC) +// // and replication metrics EventThreshold . type ReplicationTimeValue struct { - // Contains an integer specifying time in minutes. Valid value: 15 - Minutes int32 + // Contains an integer specifying time in minutes. + // + // Valid value: 15 + Minutes *int32 noSmithyDocumentSerde } @@ -2750,7 +3627,7 @@ type RequestProgress struct { // Specifies whether periodic QueryProgress frames should be sent. Valid values: // TRUE, FALSE. Default value: FALSE. - Enabled bool + Enabled *bool noSmithyDocumentSerde } @@ -2759,9 +3636,11 @@ type RequestProgress struct { type RestoreRequest struct { // Lifetime of the active copy in days. Do not use with restores that specify - // OutputLocation . The Days element is required for regular restores, and must not - // be provided for select requests. - Days int32 + // OutputLocation . + // + // The Days element is required for regular restores, and must not be provided for + // select requests. + Days *int32 // The optional description for the job. Description *string @@ -2773,13 +3652,23 @@ type RestoreRequest struct { // Describes the location where the restore job's output is stored. OutputLocation *OutputLocation + // Amazon S3 Select is no longer available to new customers. Existing customers of + // Amazon S3 Select can continue to use the feature as usual. [Learn more] + // // Describes the parameters for Select job types. + // + // [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ SelectParameters *SelectParameters // Retrieval tier at which the restore will be processed. Tier Tier + // Amazon S3 Select is no longer available to new customers. Existing customers of + // Amazon S3 Select can continue to use the feature as usual. [Learn more] + // // Type of restore request. + // + // [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ Type RestoreRequestType noSmithyDocumentSerde @@ -2787,32 +3676,43 @@ type RestoreRequest struct { // Specifies the restoration status of an object. Objects in certain storage // classes must be restored before they can be retrieved. For more information -// about these storage classes and how to work with archived objects, see Working -// with archived objects (https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html) -// in the Amazon S3 User Guide. +// about these storage classes and how to work with archived objects, see [Working with archived objects]in the +// Amazon S3 User Guide. +// +// This functionality is not supported for directory buckets. Only the S3 Express +// One Zone storage class is supported by directory buckets to store objects. +// +// [Working with archived objects]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html type RestoreStatus struct { // Specifies whether the object is currently being restored. If the object // restoration is in progress, the header returns the value TRUE . For example: - // x-amz-optional-object-attributes: IsRestoreInProgress="true" If the object - // restoration has completed, the header returns the value FALSE . For example: - // x-amz-optional-object-attributes: IsRestoreInProgress="false", - // RestoreExpiryDate="2012-12-21T00:00:00.000Z" If the object hasn't been restored, - // there is no header response. - IsRestoreInProgress bool + // + // x-amz-optional-object-attributes: IsRestoreInProgress="true" + // + // If the object restoration has completed, the header returns the value FALSE . + // For example: + // + // x-amz-optional-object-attributes: IsRestoreInProgress="false", + // RestoreExpiryDate="2012-12-21T00:00:00.000Z" + // + // If the object hasn't been restored, there is no header response. + IsRestoreInProgress *bool // Indicates when the restored copy will expire. This value is populated only if // the object has already been restored. For example: - // x-amz-optional-object-attributes: IsRestoreInProgress="false", - // RestoreExpiryDate="2012-12-21T00:00:00.000Z" + // + // x-amz-optional-object-attributes: IsRestoreInProgress="false", + // RestoreExpiryDate="2012-12-21T00:00:00.000Z" RestoreExpiryDate *time.Time noSmithyDocumentSerde } // Specifies the redirect behavior and when a redirect is applied. For more -// information about routing rules, see Configuring advanced conditional redirects (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects) -// in the Amazon S3 User Guide. +// information about routing rules, see [Configuring advanced conditional redirects]in the Amazon S3 User Guide. +// +// [Configuring advanced conditional redirects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects type RoutingRule struct { // Container for redirect information. You can redirect requests to another host, @@ -2876,6 +3776,69 @@ type S3Location struct { noSmithyDocumentSerde } +// The destination information for the metadata table configuration. The +// +// destination table bucket must be in the same Region and Amazon Web Services +// account as the general purpose bucket. The specified metadata table name must be +// unique within the aws_s3_metadata namespace in the destination table bucket. +type S3TablesDestination struct { + + // The Amazon Resource Name (ARN) for the table bucket that's specified as the + // destination in the metadata table configuration. The destination table bucket + // must be in the same Region and Amazon Web Services account as the general + // purpose bucket. + // + // This member is required. + TableBucketArn *string + + // The name for the metadata table in your metadata table configuration. The + // specified metadata table name must be unique within the aws_s3_metadata + // namespace in the destination table bucket. + // + // This member is required. + TableName *string + + noSmithyDocumentSerde +} + +// The destination information for the metadata table configuration. The +// +// destination table bucket must be in the same Region and Amazon Web Services +// account as the general purpose bucket. The specified metadata table name must be +// unique within the aws_s3_metadata namespace in the destination table bucket. +type S3TablesDestinationResult struct { + + // The Amazon Resource Name (ARN) for the metadata table in the metadata table + // configuration. The specified metadata table name must be unique within the + // aws_s3_metadata namespace in the destination table bucket. + // + // This member is required. + TableArn *string + + // The Amazon Resource Name (ARN) for the table bucket that's specified as the + // destination in the metadata table configuration. The destination table bucket + // must be in the same Region and Amazon Web Services account as the general + // purpose bucket. + // + // This member is required. + TableBucketArn *string + + // The name for the metadata table in your metadata table configuration. The + // specified metadata table name must be unique within the aws_s3_metadata + // namespace in the destination table bucket. + // + // This member is required. + TableName *string + + // The table bucket namespace for the metadata table in your metadata table + // configuration. This value is always aws_s3_metadata . + // + // This member is required. + TableNamespace *string + + noSmithyDocumentSerde +} + // Specifies the byte range of the object to get the records from. A record is // processed when its first byte is contained by the range. This parameter is // optional, but when specified, it must not be empty. See RFC 2616, Section @@ -2886,13 +3849,13 @@ type ScanRange struct { // non-negative integers. The default value is one less than the size of the object // being queried. If only the End parameter is supplied, it is interpreted to mean // scan the last N bytes of the file. For example, 50 means scan the last 50 bytes. - End int64 + End *int64 // Specifies the start of the byte range. This parameter is optional. Valid // values: non-negative integers. The default value is 0. If only start is // supplied, it means scan from that point to the end of the file. For example, 50 // means scan from byte 50 until the end of the file. - Start int64 + Start *int64 noSmithyDocumentSerde } @@ -2955,11 +3918,26 @@ type SelectObjectContentEventStreamMemberStats struct { func (*SelectObjectContentEventStreamMemberStats) isSelectObjectContentEventStream() {} +// Amazon S3 Select is no longer available to new customers. Existing customers of +// Amazon S3 Select can continue to use the feature as usual. [Learn more] +// // Describes the parameters for Select job types. +// +// Learn [How to optimize querying your data in Amazon S3] using [Amazon Athena], [S3 Object Lambda], or client-side filtering. +// +// [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ +// [How to optimize querying your data in Amazon S3]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ +// [Amazon Athena]: https://docs.aws.amazon.com/athena/latest/ug/what-is.html +// [S3 Object Lambda]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html type SelectParameters struct { + // Amazon S3 Select is no longer available to new customers. Existing customers of + // Amazon S3 Select can continue to use the feature as usual. [Learn more] + // // The expression that is used to query the object. // + // [Learn more]: http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/ + // // This member is required. Expression *string @@ -2983,34 +3961,74 @@ type SelectParameters struct { // Describes the default server-side encryption to apply to new objects in the // bucket. If a PUT Object request doesn't specify any server-side encryption, this -// default encryption will be applied. If you don't specify a customer managed key -// at configuration, Amazon S3 automatically creates an Amazon Web Services KMS key -// in your Amazon Web Services account the first time that you add an object -// encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for -// SSE-KMS. For more information, see PUT Bucket encryption (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) -// in the Amazon S3 API Reference. +// default encryption will be applied. For more information, see [PutBucketEncryption]. +// +// - General purpose buckets - If you don't specify a customer managed key at +// configuration, Amazon S3 automatically creates an Amazon Web Services KMS key ( +// aws/s3 ) in your Amazon Web Services account the first time that you add an +// object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS +// key for SSE-KMS. +// +// - Directory buckets - Your SSE-KMS configuration can only support 1 [customer managed key]per +// directory bucket for the lifetime of the bucket. The [Amazon Web Services managed key]( aws/s3 ) isn't +// supported. +// +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: SSE-S3 and SSE-KMS. +// +// [PutBucketEncryption]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html +// [customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk +// [Amazon Web Services managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk type ServerSideEncryptionByDefault struct { // Server-side encryption algorithm to use for the default encryption. // + // For directory buckets, there are only two supported values for server-side + // encryption: AES256 and aws:kms . + // // This member is required. SSEAlgorithm ServerSideEncryption - // Amazon Web Services Key Management Service (KMS) customer Amazon Web Services - // KMS key ID to use for the default encryption. This parameter is allowed if and - // only if SSEAlgorithm is set to aws:kms . You can specify the key ID, key alias, - // or the Amazon Resource Name (ARN) of the KMS key. + // Amazon Web Services Key Management Service (KMS) customer managed key ID to use + // for the default encryption. + // + // - General purpose buckets - This parameter is allowed if and only if + // SSEAlgorithm is set to aws:kms or aws:kms:dsse . + // + // - Directory buckets - This parameter is allowed if and only if SSEAlgorithm is + // set to aws:kms . + // + // You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the + // KMS key. + // // - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // // - Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // // - Key Alias: alias/alias-name - // If you use a key ID, you can run into a LogDestination undeliverable error when - // creating a VPC flow log. If you are using encryption with cross-account or - // Amazon Web Services service operations you must use a fully qualified KMS key - // ARN. For more information, see Using encryption for cross-account operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy) - // . Amazon S3 only supports symmetric encryption KMS keys. For more information, - // see Asymmetric keys in Amazon Web Services KMS (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. + // + // If you are using encryption with cross-account or Amazon Web Services service + // operations, you must use a fully qualified KMS key ARN. For more information, + // see [Using encryption for cross-account operations]. + // + // - General purpose buckets - If you're specifying a customer managed KMS key, + // we recommend using a fully qualified KMS key ARN. If you use a KMS key alias + // instead, then KMS resolves the key within the requester’s account. This behavior + // can result in data that's encrypted with a KMS key that belongs to the + // requester, and not the bucket owner. Also, if you use a key ID, you can run into + // a LogDestination undeliverable error when creating a VPC flow log. + // + // - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory + // bucket, only use the key ID or key ARN. The key alias format of the KMS key + // isn't supported. + // + // Amazon S3 only supports symmetric encryption KMS keys. For more information, + // see [Asymmetric keys in Amazon Web Services KMS]in the Amazon Web Services Key Management Service Developer Guide. + // + // [Using encryption for cross-account operations]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy + // [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk + // [Asymmetric keys in Amazon Web Services KMS]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html KMSMasterKeyID *string noSmithyDocumentSerde @@ -3029,6 +4047,18 @@ type ServerSideEncryptionConfiguration struct { } // Specifies the default server-side encryption configuration. +// +// - General purpose buckets - If you're specifying a customer managed KMS key, +// we recommend using a fully qualified KMS key ARN. If you use a KMS key alias +// instead, then KMS resolves the key within the requester’s account. This behavior +// can result in data that's encrypted with a KMS key that belongs to the +// requester, and not the bucket owner. +// +// - Directory buckets - When you specify an [KMS customer managed key]for encryption in your directory +// bucket, only use the key ID or key ARN. The key alias format of the KMS key +// isn't supported. +// +// [KMS customer managed key]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk type ServerSideEncryptionRule struct { // Specifies the default server-side encryption to apply to new objects in the @@ -3039,11 +4069,72 @@ type ServerSideEncryptionRule struct { // Specifies whether Amazon S3 should use an S3 Bucket Key with server-side // encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects // are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 - // to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. For more - // information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) - // in the Amazon S3 User Guide. - BucketKeyEnabled bool + // to use an S3 Bucket Key. + // + // - General purpose buckets - By default, S3 Bucket Key is not enabled. For + // more information, see [Amazon S3 Bucket Keys]in the Amazon S3 User Guide. + // + // - Directory buckets - S3 Bucket Keys are always enabled for GET and PUT + // operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't + // supported, when you copy SSE-KMS encrypted objects from general purpose buckets + // to directory buckets, from directory buckets to general purpose buckets, or + // between directory buckets, through [CopyObject], [UploadPartCopy], [the Copy operation in Batch Operations], or [the import jobs]. In this case, Amazon S3 makes a + // call to KMS every time a copy request is made for a KMS-encrypted object. + // + // [Amazon S3 Bucket Keys]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html + // [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html + // [the import jobs]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job + // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html + // [the Copy operation in Batch Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops + BucketKeyEnabled *bool + + noSmithyDocumentSerde +} + +// The established temporary security credentials of the session. +// +// Directory buckets - These session credentials are only supported for the +// authentication and authorization of Zonal endpoint API operations on directory +// buckets. +type SessionCredentials struct { + + // A unique identifier that's associated with a secret access key. The access key + // ID and the secret access key are used together to sign programmatic Amazon Web + // Services requests cryptographically. + // + // This member is required. + AccessKeyId *string + + // Temporary security credentials expire after a specified interval. After + // temporary credentials expire, any calls that you make with those credentials + // will fail. So you must generate a new set of temporary credentials. Temporary + // credentials cannot be extended or refreshed beyond the original specified + // interval. + // + // This member is required. + Expiration *time.Time + + // A key that's used with the access key ID to cryptographically sign programmatic + // Amazon Web Services requests. Signing a request identifies the sender and + // prevents the request from being altered. + // + // This member is required. + SecretAccessKey *string + // A part of the temporary security credentials. The session token is used to + // validate the temporary security credentials. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +// To use simple format for S3 keys for log objects, set SimplePrefix to an empty +// object. +// +// [DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString] +type SimplePrefix struct { noSmithyDocumentSerde } @@ -3058,12 +4149,14 @@ type SourceSelectionCriteria struct { // Amazon S3 doesn't replicate replica modifications by default. In the latest // version of replication configuration (when Filter is specified), you can // specify this element and set the status to Enabled to replicate modifications - // on replicas. If you don't specify the Filter element, Amazon S3 assumes that - // the replication configuration is the earlier version, V1. In the earlier - // version, this element is not allowed + // on replicas. + // + // If you don't specify the Filter element, Amazon S3 assumes that the replication + // configuration is the earlier version, V1. In the earlier version, this element + // is not allowed ReplicaModifications *ReplicaModifications - // A container for filter information for the selection of Amazon S3 objects + // A container for filter information for the selection of Amazon S3 objects // encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria // in the replication configuration, this element is required. SseKmsEncryptedObjects *SseKmsEncryptedObjects @@ -3106,13 +4199,13 @@ type SSES3 struct { type Stats struct { // The total number of uncompressed object bytes processed. - BytesProcessed int64 + BytesProcessed *int64 // The total number of bytes of records payload data returned. - BytesReturned int64 + BytesReturned *int64 // The total number of object bytes scanned. - BytesScanned int64 + BytesScanned *int64 noSmithyDocumentSerde } @@ -3181,10 +4274,12 @@ type Tagging struct { noSmithyDocumentSerde } -// Container for granting information. Buckets that use the bucket owner enforced -// setting for Object Ownership don't support target grants. For more information, -// see Permissions server access log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) -// in the Amazon S3 User Guide. +// Container for granting information. +// +// Buckets that use the bucket owner enforced setting for Object Ownership don't +// support target grants. For more information, see [Permissions server access log delivery]in the Amazon S3 User Guide. +// +// [Permissions server access log delivery]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general type TargetGrant struct { // Container for the person being granted permissions. @@ -3196,14 +4291,29 @@ type TargetGrant struct { noSmithyDocumentSerde } +// Amazon S3 key format for log objects. Only one format, PartitionedPrefix or +// SimplePrefix, is allowed. +type TargetObjectKeyFormat struct { + + // Partitioned S3 key for log objects. + PartitionedPrefix *PartitionedPrefix + + // To use the simple format for S3 keys for log objects. To specify SimplePrefix + // format, set SimplePrefix to {}. + SimplePrefix *SimplePrefix + + noSmithyDocumentSerde +} + // The S3 Intelligent-Tiering storage class is designed to optimize storage costs // by automatically moving data to the most cost-effective storage access tier, // without additional operational overhead. type Tiering struct { - // S3 Intelligent-Tiering access tier. See Storage class for automatically - // optimizing frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) - // for a list of access tiers in the S3 Intelligent-Tiering storage class. + // S3 Intelligent-Tiering access tier. See [Storage class for automatically optimizing frequently and infrequently accessed objects] for a list of access tiers in the S3 + // Intelligent-Tiering storage class. + // + // [Storage class for automatically optimizing frequently and infrequently accessed objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access // // This member is required. AccessTier IntelligentTieringAccessTier @@ -3215,7 +4325,7 @@ type Tiering struct { // days). // // This member is required. - Days int32 + Days *int32 noSmithyDocumentSerde } @@ -3226,8 +4336,9 @@ type Tiering struct { type TopicConfiguration struct { // The Amazon S3 bucket event about which to send notifications. For more - // information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. + // information, see [Supported Event Types]in the Amazon S3 User Guide. + // + // [Supported Event Types]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html // // This member is required. Events []Event @@ -3239,8 +4350,9 @@ type TopicConfiguration struct { TopicArn *string // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring event notifications using object key name filtering (https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) - // in the Amazon S3 User Guide. + // filtering, see [Configuring event notifications using object key name filtering]in the Amazon S3 User Guide. + // + // [Configuring event notifications using object key name filtering]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html Filter *NotificationConfigurationFilter // An optional unique identifier for configurations in a notification @@ -3251,9 +4363,10 @@ type TopicConfiguration struct { } // Specifies when an object transitions to a specified storage class. For more -// information about Amazon S3 lifecycle configuration rules, see Transitioning -// Objects Using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) -// in the Amazon S3 User Guide. +// information about Amazon S3 lifecycle configuration rules, see [Transitioning Objects Using Amazon S3 Lifecycle]in the Amazon S3 +// User Guide. +// +// [Transitioning Objects Using Amazon S3 Lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html type Transition struct { // Indicates when objects are transitioned to the specified storage class. The @@ -3262,7 +4375,7 @@ type Transition struct { // Indicates the number of days after creation when objects are transitioned to // the specified storage class. The value must be a positive integer. - Days int32 + Days *int32 // The storage class to which you want the object to transition. StorageClass TransitionStorageClass @@ -3271,8 +4384,9 @@ type Transition struct { } // Describes the versioning state of an Amazon S3 bucket. For more information, -// see PUT Bucket versioning (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) -// in the Amazon S3 API Reference. +// see [PUT Bucket versioning]in the Amazon S3 API Reference. +// +// [PUT Bucket versioning]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html type VersioningConfiguration struct { // Specifies whether MFA delete is enabled in the bucket versioning configuration. @@ -3295,8 +4409,9 @@ type WebsiteConfiguration struct { // The name of the index document for the website. IndexDocument *IndexDocument - // The redirect behavior for every request to this bucket's website endpoint. If - // you specify this property, you can't specify any other property. + // The redirect behavior for every request to this bucket's website endpoint. + // + // If you specify this property, you can't specify any other property. RedirectAllRequestsTo *RedirectAllRequestsTo // Rules that define when a redirect is applied and the redirect behavior. @@ -3317,7 +4432,5 @@ type UnknownUnionMember struct { } func (*UnknownUnionMember) isAnalyticsFilter() {} -func (*UnknownUnionMember) isLifecycleRuleFilter() {} func (*UnknownUnionMember) isMetricsFilter() {} -func (*UnknownUnionMember) isReplicationRuleFilter() {} func (*UnknownUnionMember) isSelectObjectContentEventStream() {} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/uri_context.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/uri_context.go new file mode 100644 index 00000000..0e664c59 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/uri_context.go @@ -0,0 +1,23 @@ +package s3 + +// This contains helper methods to set resolver URI into the context object. If they are ever used for +// something other than S3, they should be moved to internal/context/context.go + +import ( + "context" + + "github.com/aws/smithy-go/middleware" +) + +type s3resolvedURI struct{} + +// setS3ResolvedURI sets the URI as resolved by the EndpointResolverV2 +func setS3ResolvedURI(ctx context.Context, value string) context.Context { + return middleware.WithStackValue(ctx, s3resolvedURI{}, value) +} + +// getS3ResolvedURI gets the URI as resolved by EndpointResolverV2 +func getS3ResolvedURI(ctx context.Context) string { + v, _ := middleware.GetStackValue(ctx, s3resolvedURI{}).(string) + return v +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/validators.go index ccd845a7..97a56bd3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateBucket) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpCreateBucketMetadataTableConfiguration struct { +} + +func (*validateOpCreateBucketMetadataTableConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateBucketMetadataTableConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateBucketMetadataTableConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateBucketMetadataTableConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateMultipartUpload struct { } @@ -110,6 +130,26 @@ func (m *validateOpCreateMultipartUpload) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateSession struct { +} + +func (*validateOpCreateSession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteBucketAnalyticsConfiguration struct { } @@ -250,6 +290,26 @@ func (m *validateOpDeleteBucketLifecycle) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDeleteBucketMetadataTableConfiguration struct { +} + +func (*validateOpDeleteBucketMetadataTableConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteBucketMetadataTableConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteBucketMetadataTableConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteBucketMetadataTableConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteBucketMetricsConfiguration struct { } @@ -650,6 +710,26 @@ func (m *validateOpGetBucketLogging) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetBucketMetadataTableConfiguration struct { +} + +func (*validateOpGetBucketMetadataTableConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetBucketMetadataTableConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetBucketMetadataTableConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetBucketMetadataTableConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetBucketMetricsConfiguration struct { } @@ -1866,10 +1946,18 @@ func addOpCreateBucketValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateBucket{}, middleware.After) } +func addOpCreateBucketMetadataTableConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateBucketMetadataTableConfiguration{}, middleware.After) +} + func addOpCreateMultipartUploadValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMultipartUpload{}, middleware.After) } +func addOpCreateSessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSession{}, middleware.After) +} + func addOpDeleteBucketAnalyticsConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteBucketAnalyticsConfiguration{}, middleware.After) } @@ -1898,6 +1986,10 @@ func addOpDeleteBucketLifecycleValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpDeleteBucketLifecycle{}, middleware.After) } +func addOpDeleteBucketMetadataTableConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteBucketMetadataTableConfiguration{}, middleware.After) +} + func addOpDeleteBucketMetricsConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteBucketMetricsConfiguration{}, middleware.After) } @@ -1978,6 +2070,10 @@ func addOpGetBucketLoggingValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetBucketLogging{}, middleware.After) } +func addOpGetBucketMetadataTableConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetBucketMetadataTableConfiguration{}, middleware.After) +} + func addOpGetBucketMetricsConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetBucketMetricsConfiguration{}, middleware.After) } @@ -2699,6 +2795,9 @@ func validateInventoryConfiguration(v *types.InventoryConfiguration) error { invalidParams.AddNested("Destination", err.(smithy.InvalidParamsError)) } } + if v.IsEnabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("IsEnabled")) + } if v.Filter != nil { if err := validateInventoryFilter(v.Filter); err != nil { invalidParams.AddNested("Filter", err.(smithy.InvalidParamsError)) @@ -2885,22 +2984,20 @@ func validateLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator) error { } } -func validateLifecycleRuleFilter(v types.LifecycleRuleFilter) error { +func validateLifecycleRuleFilter(v *types.LifecycleRuleFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LifecycleRuleFilter"} - switch uv := v.(type) { - case *types.LifecycleRuleFilterMemberAnd: - if err := validateLifecycleRuleAndOperator(&uv.Value); err != nil { - invalidParams.AddNested("[And]", err.(smithy.InvalidParamsError)) + if v.Tag != nil { + if err := validateTag(v.Tag); err != nil { + invalidParams.AddNested("Tag", err.(smithy.InvalidParamsError)) } - - case *types.LifecycleRuleFilterMemberTag: - if err := validateTag(&uv.Value); err != nil { - invalidParams.AddNested("[Tag]", err.(smithy.InvalidParamsError)) + } + if v.And != nil { + if err := validateLifecycleRuleAndOperator(v.And); err != nil { + invalidParams.AddNested("And", err.(smithy.InvalidParamsError)) } - } if invalidParams.Len() > 0 { return invalidParams @@ -2949,6 +3046,25 @@ func validateLoggingEnabled(v *types.LoggingEnabled) error { } } +func validateMetadataTableConfiguration(v *types.MetadataTableConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MetadataTableConfiguration"} + if v.S3TablesDestination == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3TablesDestination")) + } else if v.S3TablesDestination != nil { + if err := validateS3TablesDestination(v.S3TablesDestination); err != nil { + invalidParams.AddNested("S3TablesDestination", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateMetrics(v *types.Metrics) error { if v == nil { return nil @@ -3293,22 +3409,20 @@ func validateReplicationRuleAndOperator(v *types.ReplicationRuleAndOperator) err } } -func validateReplicationRuleFilter(v types.ReplicationRuleFilter) error { +func validateReplicationRuleFilter(v *types.ReplicationRuleFilter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReplicationRuleFilter"} - switch uv := v.(type) { - case *types.ReplicationRuleFilterMemberAnd: - if err := validateReplicationRuleAndOperator(&uv.Value); err != nil { - invalidParams.AddNested("[And]", err.(smithy.InvalidParamsError)) + if v.Tag != nil { + if err := validateTag(v.Tag); err != nil { + invalidParams.AddNested("Tag", err.(smithy.InvalidParamsError)) } - - case *types.ReplicationRuleFilterMemberTag: - if err := validateTag(&uv.Value); err != nil { - invalidParams.AddNested("[Tag]", err.(smithy.InvalidParamsError)) + } + if v.And != nil { + if err := validateReplicationRuleAndOperator(v.And); err != nil { + invalidParams.AddNested("And", err.(smithy.InvalidParamsError)) } - } if invalidParams.Len() > 0 { return invalidParams @@ -3459,6 +3573,24 @@ func validateS3Location(v *types.S3Location) error { } } +func validateS3TablesDestination(v *types.S3TablesDestination) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "S3TablesDestination"} + if v.TableBucketArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableBucketArn")) + } + if v.TableName == nil { + invalidParams.Add(smithy.NewErrParamRequired("TableName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSelectParameters(v *types.SelectParameters) error { if v == nil { return nil @@ -3735,6 +3867,9 @@ func validateTiering(v *types.Tiering) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tiering"} + if v.Days == nil { + invalidParams.Add(smithy.NewErrParamRequired("Days")) + } if len(v.AccessTier) == 0 { invalidParams.Add(smithy.NewErrParamRequired("AccessTier")) } @@ -3907,6 +4042,28 @@ func validateOpCreateBucketInput(v *CreateBucketInput) error { } } +func validateOpCreateBucketMetadataTableConfigurationInput(v *CreateBucketMetadataTableConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateBucketMetadataTableConfigurationInput"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if v.MetadataTableConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetadataTableConfiguration")) + } else if v.MetadataTableConfiguration != nil { + if err := validateMetadataTableConfiguration(v.MetadataTableConfiguration); err != nil { + invalidParams.AddNested("MetadataTableConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateMultipartUploadInput(v *CreateMultipartUploadInput) error { if v == nil { return nil @@ -3925,6 +4082,21 @@ func validateOpCreateMultipartUploadInput(v *CreateMultipartUploadInput) error { } } +func validateOpCreateSessionInput(v *CreateSessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSessionInput"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteBucketAnalyticsConfigurationInput(v *DeleteBucketAnalyticsConfigurationInput) error { if v == nil { return nil @@ -4039,6 +4211,21 @@ func validateOpDeleteBucketLifecycleInput(v *DeleteBucketLifecycleInput) error { } } +func validateOpDeleteBucketMetadataTableConfigurationInput(v *DeleteBucketMetadataTableConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketMetadataTableConfigurationInput"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteBucketMetricsConfigurationInput(v *DeleteBucketMetricsConfigurationInput) error { if v == nil { return nil @@ -4364,6 +4551,21 @@ func validateOpGetBucketLoggingInput(v *GetBucketLoggingInput) error { } } +func validateOpGetBucketMetadataTableConfigurationInput(v *GetBucketMetadataTableConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetBucketMetadataTableConfigurationInput"} + if v.Bucket == nil { + invalidParams.Add(smithy.NewErrParamRequired("Bucket")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetBucketMetricsConfigurationInput(v *GetBucketMetricsConfigurationInput) error { if v == nil { return nil @@ -5444,6 +5646,9 @@ func validateOpUploadPartCopyInput(v *UploadPartCopyInput) error { if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } + if v.PartNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartNumber")) + } if v.UploadId == nil { invalidParams.Add(smithy.NewErrParamRequired("UploadId")) } @@ -5465,6 +5670,9 @@ func validateOpUploadPartInput(v *UploadPartInput) error { if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } + if v.PartNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartNumber")) + } if v.UploadId == nil { invalidParams.Add(smithy.NewErrParamRequired("UploadId")) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md new file mode 100644 index 00000000..95b2d47a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -0,0 +1,551 @@ +# v1.24.8 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.7 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.6 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.5 (2024-11-07) + +* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses + +# v1.24.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.4 (2024-10-03) + +* No change notes available for this release. + +# v1.23.3 (2024-09-27) + +* No change notes available for this release. + +# v1.23.2 (2024-09-25) + +* No change notes available for this release. + +# v1.23.1 (2024-09-23) + +* No change notes available for this release. + +# v1.23.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + +# v1.22.7 (2024-09-04) + +* No change notes available for this release. + +# v1.22.6 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.5 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.4 (2024-07-18) + +* No change notes available for this release. + +# v1.22.3 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.2 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.21.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.12 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.11 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.10 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.9 (2024-05-23) + +* No change notes available for this release. + +# v1.20.8 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.7 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.6 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.20.5 (2024-04-05) + +* No change notes available for this release. + +# v1.20.4 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.19.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.19.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2024-01-18) + +* No change notes available for this release. + +# v1.18.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.18.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.18.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.4 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.17.3 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-10-02) + +* **Feature**: Fix FIPS Endpoints in aws-us-gov. + +# v1.14.1 (2023-09-22) + +* No change notes available for this release. + +# v1.14.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.13.6 (2023-08-31) + +* No change notes available for this release. + +# v1.13.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2023-08-01) + +* No change notes available for this release. + +# v1.13.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.14 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2023-06-15) + +* No change notes available for this release. + +# v1.12.11 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2023-05-04) + +* No change notes available for this release. + +# v1.12.9 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2023-04-10) + +* No change notes available for this release. + +# v1.12.7 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.5 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.12.3 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.12.1 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.11.28 (2022-12-20) + +* No change notes available for this release. + +# v1.11.27 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.26 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.25 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.24 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.23 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.22 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.21 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.20 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.19 (2022-08-30) + +* **Documentation**: Documentation updates for the AWS IAM Identity Center Portal CLI Reference. + +# v1.11.18 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.17 (2022-08-15) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) + +# v1.11.16 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.15 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.14 (2022-08-08) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.13 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.12 (2022-07-11) + +* No change notes available for this release. + +# v1.11.11 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.10 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.9 (2022-06-16) + +* No change notes available for this release. + +# v1.11.8 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.7 (2022-05-26) + +* No change notes available for this release. + +# v1.11.6 (2022-05-25) + +* No change notes available for this release. + +# v1.11.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: Updated API models +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-12-21) + +* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. + +# v1.6.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Feature**: Updated service to latest API model. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go new file mode 100644 index 00000000..644ee1e0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -0,0 +1,912 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "SSO" +const ServiceAPIVersion = "2019-06-10" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sso") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/sso") +} + +// Client provides the API client to make operations call for AWS Single Sign-On. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sso") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sso", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sso") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go new file mode 100644 index 00000000..a6560202 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sso/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the STS short-term credentials for a given role name that is assigned +// to the user. +func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredentialsInput, optFns ...func(*Options)) (*GetRoleCredentialsOutput, error) { + if params == nil { + params = &GetRoleCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRoleCredentials", params, optFns, c.addOperationGetRoleCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRoleCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRoleCredentialsInput struct { + + // The token issued by the CreateToken API call. For more information, see [CreateToken] in the + // IAM Identity Center OIDC API Reference Guide. + // + // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // + // This member is required. + AccessToken *string + + // The identifier for the AWS account that is assigned to the user. + // + // This member is required. + AccountId *string + + // The friendly name of the role that is assigned to the user. + // + // This member is required. + RoleName *string + + noSmithyDocumentSerde +} + +type GetRoleCredentialsOutput struct { + + // The credentials for the role that is assigned to the user. + RoleCredentials *types.RoleCredentials + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRoleCredentials{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRoleCredentials"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoleCredentials(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRoleCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRoleCredentials", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go new file mode 100644 index 00000000..315526ef --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sso/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all roles that are assigned to the user for a given AWS account. +func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesInput, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { + if params == nil { + params = &ListAccountRolesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccountRoles", params, optFns, c.addOperationListAccountRolesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccountRolesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccountRolesInput struct { + + // The token issued by the CreateToken API call. For more information, see [CreateToken] in the + // IAM Identity Center OIDC API Reference Guide. + // + // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // + // This member is required. + AccessToken *string + + // The identifier for the AWS account that is assigned to the user. + // + // This member is required. + AccountId *string + + // The number of items that clients can request per page. + MaxResults *int32 + + // The page token from the previous response output when you request subsequent + // pages. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAccountRolesOutput struct { + + // The page token client that is used to retrieve the list of accounts. + NextToken *string + + // A paginated response with the list of roles and the next token if more results + // are available. + RoleList []types.RoleInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccountRoles{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountRoles"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListAccountRolesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountRoles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAccountRolesPaginatorOptions is the paginator options for ListAccountRoles +type ListAccountRolesPaginatorOptions struct { + // The number of items that clients can request per page. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAccountRolesPaginator is a paginator for ListAccountRoles +type ListAccountRolesPaginator struct { + options ListAccountRolesPaginatorOptions + client ListAccountRolesAPIClient + params *ListAccountRolesInput + nextToken *string + firstPage bool +} + +// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator +func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { + if params == nil { + params = &ListAccountRolesInput{} + } + + options := ListAccountRolesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccountRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountRolesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccountRoles page. +func (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListAccountRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListAccountRolesAPIClient is a client that implements the ListAccountRoles +// operation. +type ListAccountRolesAPIClient interface { + ListAccountRoles(context.Context, *ListAccountRolesInput, ...func(*Options)) (*ListAccountRolesOutput, error) +} + +var _ ListAccountRolesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAccountRoles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccountRoles", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go new file mode 100644 index 00000000..d867b78a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sso/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all AWS accounts assigned to the user. These AWS accounts are assigned by +// the administrator of the account. For more information, see [Assign User Access]in the IAM Identity +// Center User Guide. This operation returns a paginated response. +// +// [Assign User Access]: https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers +func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if params == nil { + params = &ListAccountsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, c.addOperationListAccountsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccountsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccountsInput struct { + + // The token issued by the CreateToken API call. For more information, see [CreateToken] in the + // IAM Identity Center OIDC API Reference Guide. + // + // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // + // This member is required. + AccessToken *string + + // This is the number of items clients can request per page. + MaxResults *int32 + + // (Optional) When requesting subsequent pages, this is the page token from the + // previous response output. + NextToken *string + + noSmithyDocumentSerde +} + +type ListAccountsOutput struct { + + // A paginated response with the list of account information and the next token if + // more results are available. + AccountList []types.AccountInfo + + // The page token client that is used to retrieve the list of accounts. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccounts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccounts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListAccountsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // This is the number of items clients can request per page. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAccountsPaginator is a paginator for ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + if params == nil { + params = &ListAccountsInput{} + } + + options := ListAccountsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListAccounts", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go new file mode 100644 index 00000000..434b4308 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes the locally stored SSO tokens from the client-side cache and sends an +// API call to the IAM Identity Center service to invalidate the corresponding +// server-side IAM Identity Center sign in session. +// +// If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM +// Identity Center sign in session is used to obtain an IAM session, as specified +// in the corresponding IAM Identity Center permission set. More specifically, IAM +// Identity Center assumes an IAM role in the target account on behalf of the user, +// and the corresponding temporary AWS credentials are returned to the client. +// +// After user logout, any existing IAM role sessions that were created by using +// IAM Identity Center permission sets continue based on the duration configured in +// the permission set. For more information, see [User authentications]in the IAM Identity Center User +// Guide. +// +// [User authentications]: https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html +func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) { + if params == nil { + params = &LogoutInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "Logout", params, optFns, c.addOperationLogoutMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*LogoutOutput) + out.ResultMetadata = metadata + return out, nil +} + +type LogoutInput struct { + + // The token issued by the CreateToken API call. For more information, see [CreateToken] in the + // IAM Identity Center OIDC API Reference Guide. + // + // [CreateToken]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html + // + // This member is required. + AccessToken *string + + noSmithyDocumentSerde +} + +type LogoutOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpLogout{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "Logout"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpLogoutValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLogout(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opLogout(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "Logout", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go new file mode 100644 index 00000000..366963b4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go @@ -0,0 +1,337 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "GetRoleCredentials": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "ListAccountRoles": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "ListAccounts": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "Logout": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "awsssoportal") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go new file mode 100644 index 00000000..ec23c36f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.go @@ -0,0 +1,1182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/sso/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpGetRoleCredentials struct { +} + +func (*awsRestjson1_deserializeOpGetRoleCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRoleCredentials) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorGetRoleCredentials(response, &metadata) + } + output := &GetRoleCredentialsOutput{} + 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_deserializeOpDocumentGetRoleCredentialsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetRoleCredentials(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("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetRoleCredentialsOutput(v **GetRoleCredentialsOutput, 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 *GetRoleCredentialsOutput + if *v == nil { + sv = &GetRoleCredentialsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "roleCredentials": + if err := awsRestjson1_deserializeDocumentRoleCredentials(&sv.RoleCredentials, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAccountRoles struct { +} + +func (*awsRestjson1_deserializeOpListAccountRoles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAccountRoles) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListAccountRoles(response, &metadata) + } + output := &ListAccountRolesOutput{} + 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_deserializeOpDocumentListAccountRolesOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAccountRoles(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("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAccountRolesOutput(v **ListAccountRolesOutput, 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 *ListAccountRolesOutput + if *v == nil { + sv = &ListAccountRolesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "roleList": + if err := awsRestjson1_deserializeDocumentRoleListType(&sv.RoleList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAccounts struct { +} + +func (*awsRestjson1_deserializeOpListAccounts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAccounts) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorListAccounts(response, &metadata) + } + output := &ListAccountsOutput{} + 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_deserializeOpDocumentListAccountsOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAccounts(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("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAccountsOutput(v **ListAccountsOutput, 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 *ListAccountsOutput + if *v == nil { + sv = &ListAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountList": + if err := awsRestjson1_deserializeDocumentAccountListType(&sv.AccountList, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpLogout struct { +} + +func (*awsRestjson1_deserializeOpLogout) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpLogout) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorLogout(response, &metadata) + } + output := &LogoutOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorLogout(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("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + 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_deserializeDocumentResourceNotFoundException(&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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRequestsException{} + 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_deserializeDocumentTooManyRequestsException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedException{} + 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_deserializeDocumentUnauthorizedException(&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_deserializeDocumentAccountInfo(v **types.AccountInfo, 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.AccountInfo + if *v == nil { + sv = &types.AccountInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountIdType to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "accountName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountNameType to be of type string, got %T instead", value) + } + sv.AccountName = ptr.String(jtv) + } + + case "emailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailAddressType to be of type string, got %T instead", value) + } + sv.EmailAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccountListType(v *[]types.AccountInfo, 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 []types.AccountInfo + if *v == nil { + cv = []types.AccountInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentAccountInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoleCredentials(v **types.RoleCredentials, 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.RoleCredentials + if *v == nil { + sv = &types.RoleCredentials{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessKeyType to be of type string, got %T instead", value) + } + sv.AccessKeyId = ptr.String(jtv) + } + + case "expiration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpirationTimestampType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Expiration = i64 + } + + case "secretAccessKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecretAccessKeyType to be of type string, got %T instead", value) + } + sv.SecretAccessKey = ptr.String(jtv) + } + + case "sessionToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SessionTokenType to be of type string, got %T instead", value) + } + sv.SessionToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoleInfo(v **types.RoleInfo, 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.RoleInfo + if *v == nil { + sv = &types.RoleInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountIdType to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "roleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleNameType to be of type string, got %T instead", value) + } + sv.RoleName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRoleListType(v *[]types.RoleInfo, 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 []types.RoleInfo + if *v == nil { + cv = []types.RoleInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RoleInfo + destAddr := &col + if err := awsRestjson1_deserializeDocumentRoleInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, 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.TooManyRequestsException + if *v == nil { + sv = &types.TooManyRequestsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, 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.UnauthorizedException + if *v == nil { + sv = &types.UnauthorizedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go new file mode 100644 index 00000000..7f6e429f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go @@ -0,0 +1,27 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package sso provides the API client, operations, and parameter types for AWS +// Single Sign-On. +// +// AWS IAM Identity Center (successor to AWS Single Sign-On) Portal is a web +// service that makes it easy for you to assign user access to IAM Identity Center +// resources such as the AWS access portal. Users can get AWS account applications +// and roles assigned to them and get federated into the application. +// +// Although AWS Single Sign-On was renamed, the sso and identitystore API +// namespaces will continue to retain their original name for backward +// compatibility purposes. For more information, see [IAM Identity Center rename]. +// +// This reference guide describes the IAM Identity Center Portal operations that +// you can call programatically and includes detailed information on data types and +// errors. +// +// AWS provides SDKs that consist of libraries and sample code for various +// programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android. +// The SDKs provide a convenient way to create programmatic access to IAM Identity +// Center and other AWS services. For more information about the AWS SDKs, +// including how to download and install them, see [Tools for Amazon Web Services]. +// +// [Tools for Amazon Web Services]: http://aws.amazon.com/tools/ +// [IAM Identity Center rename]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed +package sso diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go new file mode 100644 index 00000000..53c6bc75 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -0,0 +1,556 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "awsssoportal" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json new file mode 100644 index 00000000..936253d7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -0,0 +1,35 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_GetRoleCredentials.go", + "api_op_ListAccountRoles.go", + "api_op_ListAccounts.go", + "api_op_Logout.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/sso", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go new file mode 100644 index 00000000..46dacd1e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package sso + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.24.8" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go new file mode 100644 index 00000000..081867b3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -0,0 +1,566 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver SSO endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "portal.sso-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "portal.sso.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go new file mode 100644 index 00000000..aa744f15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go new file mode 100644 index 00000000..a7a5b57d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go @@ -0,0 +1,309 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpGetRoleCredentials struct { +} + +func (*awsRestjson1_serializeOpGetRoleCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRoleCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/federation/credentials") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(v *GetRoleCredentialsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessToken != nil { + locationName := "X-Amz-Sso_bearer_token" + encoder.SetHeader(locationName).String(*v.AccessToken) + } + + if v.AccountId != nil { + encoder.SetQuery("account_id").String(*v.AccountId) + } + + if v.RoleName != nil { + encoder.SetQuery("role_name").String(*v.RoleName) + } + + return nil +} + +type awsRestjson1_serializeOpListAccountRoles struct { +} + +func (*awsRestjson1_serializeOpListAccountRoles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAccountRolesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assignment/roles") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(v *ListAccountRolesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessToken != nil { + locationName := "X-Amz-Sso_bearer_token" + encoder.SetHeader(locationName).String(*v.AccessToken) + } + + if v.AccountId != nil { + encoder.SetQuery("account_id").String(*v.AccountId) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_result").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next_token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListAccounts struct { +} + +func (*awsRestjson1_serializeOpListAccounts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAccountsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/assignment/accounts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListAccountsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAccountsInput(v *ListAccountsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessToken != nil { + locationName := "X-Amz-Sso_bearer_token" + encoder.SetHeader(locationName).String(*v.AccessToken) + } + + if v.MaxResults != nil { + encoder.SetQuery("max_result").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next_token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpLogout struct { +} + +func (*awsRestjson1_serializeOpLogout) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*LogoutInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/logout") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsLogoutInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsLogoutInput(v *LogoutInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AccessToken != nil { + locationName := "X-Amz-Sso_bearer_token" + encoder.SetHeader(locationName).String(*v.AccessToken) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go new file mode 100644 index 00000000..e97a126e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Indicates that a problem occurred with the input to the request. For example, a +// required parameter might be missing or out of range. +type InvalidRequestException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource doesn't exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the request is being made too frequently and is more than what +// the server can handle. +type TooManyRequestsException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyRequestsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyRequestsException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyRequestsException" + } + return *e.ErrorCodeOverride +} +func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the request is not authorized. This can happen due to an invalid +// access token in the request. +type UnauthorizedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnauthorizedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnauthorizedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnauthorizedException" + } + return *e.ErrorCodeOverride +} +func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go new file mode 100644 index 00000000..07ac468e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go @@ -0,0 +1,63 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// Provides information about your AWS account. +type AccountInfo struct { + + // The identifier of the AWS account that is assigned to the user. + AccountId *string + + // The display name of the AWS account that is assigned to the user. + AccountName *string + + // The email address of the AWS account that is assigned to the user. + EmailAddress *string + + noSmithyDocumentSerde +} + +// Provides information about the role credentials that are assigned to the user. +type RoleCredentials struct { + + // The identifier used for the temporary security credentials. For more + // information, see [Using Temporary Security Credentials to Request Access to AWS Resources]in the AWS IAM User Guide. + // + // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + AccessKeyId *string + + // The date on which temporary security credentials expire. + Expiration int64 + + // The key that is used to sign the request. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS + // IAM User Guide. + // + // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + SecretAccessKey *string + + // The token used for temporary credentials. For more information, see [Using Temporary Security Credentials to Request Access to AWS Resources] in the AWS + // IAM User Guide. + // + // [Using Temporary Security Credentials to Request Access to AWS Resources]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html + SessionToken *string + + noSmithyDocumentSerde +} + +// Provides information about the role that is assigned to the user. +type RoleInfo struct { + + // The identifier of the AWS account assigned to the user. + AccountId *string + + // The friendly name of the role that is assigned to the user. + RoleName *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go new file mode 100644 index 00000000..f6bf461f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.go @@ -0,0 +1,175 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpGetRoleCredentials struct { +} + +func (*validateOpGetRoleCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRoleCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRoleCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRoleCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccountRoles struct { +} + +func (*validateOpListAccountRoles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccountRoles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccountRolesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccountRolesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccounts struct { +} + +func (*validateOpListAccounts) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccounts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccountsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccountsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpLogout struct { +} + +func (*validateOpLogout) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpLogout) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*LogoutInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpLogoutInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpGetRoleCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRoleCredentials{}, middleware.After) +} + +func addOpListAccountRolesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccountRoles{}, middleware.After) +} + +func addOpListAccountsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccounts{}, middleware.After) +} + +func addOpLogoutValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpLogout{}, middleware.After) +} + +func validateOpGetRoleCredentialsInput(v *GetRoleCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRoleCredentialsInput"} + if v.RoleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleName")) + } + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if v.AccessToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccountRolesInput(v *ListAccountRolesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccountRolesInput"} + if v.AccessToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) + } + if v.AccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccountsInput(v *ListAccountsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccountsInput"} + if v.AccessToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpLogoutInput(v *LogoutInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LogoutInput"} + if v.AccessToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md new file mode 100644 index 00000000..8fbaed84 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -0,0 +1,541 @@ +# v1.28.7 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.6 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.5 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.4 (2024-10-03) + +* No change notes available for this release. + +# v1.27.3 (2024-09-27) + +* No change notes available for this release. + +# v1.27.2 (2024-09-25) + +* No change notes available for this release. + +# v1.27.1 (2024-09-23) + +* No change notes available for this release. + +# v1.27.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + +# v1.26.7 (2024-09-04) + +* No change notes available for this release. + +# v1.26.6 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.5 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.4 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.2 (2024-07-03) + +* No change notes available for this release. + +# v1.26.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.25.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.6 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.5 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.4 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.3 (2024-05-23) + +* No change notes available for this release. + +# v1.24.2 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.1 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2024-05-10) + +* **Feature**: Updated request parameters for PKCE support. + +# v1.23.5 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.23.4 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.3 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.22.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.22.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.7 (2024-01-16) + +* No change notes available for this release. + +# v1.21.6 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.21.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. + +# v1.21.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.3 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.2 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.20.1 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-11-17) + +* **Feature**: Adding support for `sso-oauth:CreateTokenWithIAM`. + +# v1.19.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2023-09-22) + +* No change notes available for this release. + +# v1.17.0 (2023-09-20) + +* **Feature**: Update FIPS endpoints in aws-us-gov. + +# v1.16.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.15.6 (2023-09-05) + +* No change notes available for this release. + +# v1.15.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-08-01) + +* No change notes available for this release. + +# v1.15.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.14 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.13 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.12 (2023-06-15) + +* No change notes available for this release. + +# v1.14.11 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.10 (2023-05-04) + +* No change notes available for this release. + +# v1.14.9 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.8 (2023-04-10) + +* No change notes available for this release. + +# v1.14.7 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.6 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.5 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.4 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.14.3 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.2 (2023-02-15) + +* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. +* **Bug Fix**: Correct error type parsing for restJson services. + +# v1.14.1 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.13.11 (2022-12-19) + +* No change notes available for this release. + +# v1.13.10 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.8 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.7 (2022-10-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.6 (2022-09-30) + +* **Documentation**: Documentation updates for the IAM Identity Center OIDC CLI Reference. + +# v1.13.5 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.2 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.1 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-08-25) + +* **Feature**: Updated required request parameters on IAM Identity Center's OIDC CreateToken action. + +# v1.12.14 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.13 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.12 (2022-08-08) + +* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.11 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.10 (2022-07-11) + +* No change notes available for this release. + +# v1.12.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.6 (2022-05-27) + +* No change notes available for this release. + +# v1.12.5 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.0 (2022-01-07) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.2 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-10-21) + +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-10-11) + +* **Feature**: API client updated +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-09-17) + +* **Feature**: Updated API client and endpoints to latest revision. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-08-27) + +* **Feature**: Updated API model to latest revision. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.3 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.2 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.1 (2021-07-15) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.0 (2021-06-25) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go new file mode 100644 index 00000000..0b05bf6c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -0,0 +1,912 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "SSO OIDC" +const ServiceAPIVersion = "2019-06-10" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/ssooidc") +} + +// Client provides the API client to make operations call for AWS SSO OIDC. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go new file mode 100644 index 00000000..5fb8d2ab --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and returns access and refresh tokens for clients that are +// authenticated using client secrets. The access token can be used to fetch +// short-term credentials for the assigned AWS accounts or to access application +// APIs using bearer authentication. +func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) { + if params == nil { + params = &CreateTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateToken", params, optFns, c.addOperationCreateTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTokenInput struct { + + // The unique identifier string for the client or application. This value comes + // from the result of the RegisterClientAPI. + // + // This member is required. + ClientId *string + + // A secret string generated for the client. This value should come from the + // persisted result of the RegisterClientAPI. + // + // This member is required. + ClientSecret *string + + // Supports the following OAuth grant types: Device Code and Refresh Token. + // Specify either of the following values, depending on the grant type that you + // want: + // + // * Device Code - urn:ietf:params:oauth:grant-type:device_code + // + // * Refresh Token - refresh_token + // + // For information about how to obtain the device code, see the StartDeviceAuthorization topic. + // + // This member is required. + GrantType *string + + // Used only when calling this API for the Authorization Code grant type. The + // short-term code is used to identify this authorization request. This grant type + // is currently unsupported for the CreateTokenAPI. + Code *string + + // Used only when calling this API for the Authorization Code grant type. This + // value is generated by the client and presented to validate the original code + // challenge value the client passed at authorization time. + CodeVerifier *string + + // Used only when calling this API for the Device Code grant type. This short-term + // code is used to identify this authorization request. This comes from the result + // of the StartDeviceAuthorizationAPI. + DeviceCode *string + + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. + RedirectUri *string + + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the [IAM Identity Center OIDC API Reference]. + // + // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + RefreshToken *string + + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If this value is not + // specified, IAM Identity Center authorizes all scopes that are configured for the + // client during the call to RegisterClient. + Scope []string + + noSmithyDocumentSerde +} + +type CreateTokenOutput struct { + + // A bearer token to access Amazon Web Services accounts and applications assigned + // to a user. + AccessToken *string + + // Indicates the time in seconds when an access token will expire. + ExpiresIn int32 + + // The idToken is not implemented or supported. For more information about the + // features and limitations of the current IAM Identity Center OIDC implementation, + // see Considerations for Using this Guide in the [IAM Identity Center OIDC API Reference]. + // + // A JSON Web Token (JWT) that identifies who is associated with the issued access + // token. + // + // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + IdToken *string + + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. + // + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the [IAM Identity Center OIDC API Reference]. + // + // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + RefreshToken *string + + // Used to notify the client that the returned token is an access token. The + // supported token type is Bearer . + TokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go new file mode 100644 index 00000000..8abd4369 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -0,0 +1,271 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and returns access and refresh tokens for clients and applications that +// are authenticated using IAM entities. The access token can be used to fetch +// short-term credentials for the assigned Amazon Web Services accounts or to +// access application APIs using bearer authentication. +func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) { + if params == nil { + params = &CreateTokenWithIAMInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateTokenWithIAM", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateTokenWithIAMOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateTokenWithIAMInput struct { + + // The unique identifier string for the client or application. This value is an + // application ARN that has OAuth grants configured. + // + // This member is required. + ClientId *string + + // Supports the following OAuth grant types: Authorization Code, Refresh Token, + // JWT Bearer, and Token Exchange. Specify one of the following values, depending + // on the grant type that you want: + // + // * Authorization Code - authorization_code + // + // * Refresh Token - refresh_token + // + // * JWT Bearer - urn:ietf:params:oauth:grant-type:jwt-bearer + // + // * Token Exchange - urn:ietf:params:oauth:grant-type:token-exchange + // + // This member is required. + GrantType *string + + // Used only when calling this API for the JWT Bearer grant type. This value + // specifies the JSON Web Token (JWT) issued by a trusted token issuer. To + // authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the + // application. + Assertion *string + + // Used only when calling this API for the Authorization Code grant type. This + // short-term code is used to identify this authorization request. The code is + // obtained through a redirect from IAM Identity Center to a redirect URI persisted + // in the Authorization Code GrantOptions for the application. + Code *string + + // Used only when calling this API for the Authorization Code grant type. This + // value is generated by the client and presented to validate the original code + // challenge value the client passed at authorization time. + CodeVerifier *string + + // Used only when calling this API for the Authorization Code grant type. This + // value specifies the location of the client or application that has registered to + // receive the authorization code. + RedirectUri *string + + // Used only when calling this API for the Refresh Token grant type. This token is + // used to refresh short-term tokens, such as the access token, that might expire. + // + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the [IAM Identity Center OIDC API Reference]. + // + // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + RefreshToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that the requester can receive. The following values + // are supported: + // + // * Access Token - urn:ietf:params:oauth:token-type:access_token + // + // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + RequestedTokenType *string + + // The list of scopes for which authorization is requested. The access token that + // is issued is limited to the scopes that are granted. If the value is not + // specified, IAM Identity Center authorizes all scopes configured for the + // application, including the following default scopes: openid , aws , + // sts:identity_context . + Scope []string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the subject of the exchange. The value of the subject token must be an + // access token issued by IAM Identity Center to a different client or application. + // The access token must have authorized scopes that indicate the requested + // application as a target audience. + SubjectToken *string + + // Used only when calling this API for the Token Exchange grant type. This value + // specifies the type of token that is passed as the subject of the exchange. The + // following value is supported: + // + // * Access Token - urn:ietf:params:oauth:token-type:access_token + SubjectTokenType *string + + noSmithyDocumentSerde +} + +type CreateTokenWithIAMOutput struct { + + // A bearer token to access Amazon Web Services accounts and applications assigned + // to a user. + AccessToken *string + + // Indicates the time in seconds when an access token will expire. + ExpiresIn int32 + + // A JSON Web Token (JWT) that identifies the user associated with the issued + // access token. + IdToken *string + + // Indicates the type of tokens that are issued by IAM Identity Center. The + // following values are supported: + // + // * Access Token - urn:ietf:params:oauth:token-type:access_token + // + // * Refresh Token - urn:ietf:params:oauth:token-type:refresh_token + IssuedTokenType *string + + // A token that, if present, can be used to refresh a previously issued access + // token that might have expired. + // + // For more information about the features and limitations of the current IAM + // Identity Center OIDC implementation, see Considerations for Using this Guide in + // the [IAM Identity Center OIDC API Reference]. + // + // [IAM Identity Center OIDC API Reference]: https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html + RefreshToken *string + + // The list of scopes for which authorization is granted. The access token that is + // issued is limited to the scopes that are granted. + Scope []string + + // Used to notify the requester that the returned token is an access token. The + // supported token type is Bearer . + TokenType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTokenWithIAM"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateTokenWithIAM", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go new file mode 100644 index 00000000..03a3594b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Registers a client with IAM Identity Center. This allows clients to initiate +// device authorization. The output should be persisted for reuse through many +// authentication requests. +func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) { + if params == nil { + params = &RegisterClientInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterClientOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterClientInput struct { + + // The friendly name of the client. + // + // This member is required. + ClientName *string + + // The type of client. The service supports only public as a client type. Anything + // other than public will be rejected by the service. + // + // This member is required. + ClientType *string + + // This IAM Identity Center application ARN is used to define + // administrator-managed configuration for public client access to resources. At + // authorization, the scopes, grants, and redirect URI available to this client + // will be restricted by this application resource. + EntitledApplicationArn *string + + // The list of OAuth 2.0 grant types that are defined by the client. This list is + // used to restrict the token granting flows available to the client. + GrantTypes []string + + // The IAM Identity Center Issuer URL associated with an instance of IAM Identity + // Center. This value is needed for user access to resources through the client. + IssuerUrl *string + + // The list of redirect URI that are defined by the client. At completion of + // authorization, this list is used to restrict what locations the user agent can + // be redirected back to. + RedirectUris []string + + // The list of scopes that are defined by the client. Upon authorization, this + // list is used to restrict permissions when granting an access token. + Scopes []string + + noSmithyDocumentSerde +} + +type RegisterClientOutput struct { + + // An endpoint that the client can use to request authorization. + AuthorizationEndpoint *string + + // The unique identifier string for each client. This client uses this identifier + // to get authenticated by the service in subsequent calls. + ClientId *string + + // Indicates the time at which the clientId and clientSecret were issued. + ClientIdIssuedAt int64 + + // A secret string generated for the client. The client will use this string to + // get authenticated by the service in subsequent calls. + ClientSecret *string + + // Indicates the time at which the clientId and clientSecret will become invalid. + ClientSecretExpiresAt int64 + + // An endpoint that the client can use to create tokens. + TokenEndpoint *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterClient"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRegisterClientValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterClient", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go new file mode 100644 index 00000000..203ca5e6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -0,0 +1,191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Initiates device authorization by requesting a pair of verification codes from +// the authorization service. +func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDeviceAuthorizationInput, optFns ...func(*Options)) (*StartDeviceAuthorizationOutput, error) { + if params == nil { + params = &StartDeviceAuthorizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDeviceAuthorization", params, optFns, c.addOperationStartDeviceAuthorizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDeviceAuthorizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDeviceAuthorizationInput struct { + + // The unique identifier string for the client that is registered with IAM + // Identity Center. This value should come from the persisted result of the RegisterClientAPI + // operation. + // + // This member is required. + ClientId *string + + // A secret string that is generated for the client. This value should come from + // the persisted result of the RegisterClientAPI operation. + // + // This member is required. + ClientSecret *string + + // The URL for the Amazon Web Services access portal. For more information, see [Using the Amazon Web Services access portal] + // in the IAM Identity Center User Guide. + // + // [Using the Amazon Web Services access portal]: https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html + // + // This member is required. + StartUrl *string + + noSmithyDocumentSerde +} + +type StartDeviceAuthorizationOutput struct { + + // The short-lived code that is used by the device when polling for a session + // token. + DeviceCode *string + + // Indicates the number of seconds in which the verification code will become + // invalid. + ExpiresIn int32 + + // Indicates the number of seconds the client must wait between attempts when + // polling for a session. + Interval int32 + + // A one-time user verification code. This is needed to authorize an in-use device. + UserCode *string + + // The URI of the verification page that takes the userCode to authorize the + // device. + VerificationUri *string + + // An alternate URL that the client can use to automatically launch a browser. + // This process skips the manual step in which the user visits the verification + // page and enters their code. + VerificationUriComplete *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDeviceAuthorization"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeviceAuthorization(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDeviceAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDeviceAuthorization", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go new file mode 100644 index 00000000..e4b87f5b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go @@ -0,0 +1,331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "CreateToken": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "RegisterClient": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "StartDeviceAuthorization": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "sso-oauth") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go new file mode 100644 index 00000000..ae9f145e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go @@ -0,0 +1,2188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/ssooidc/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpCreateToken struct { +} + +func (*awsRestjson1_deserializeOpCreateToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateToken) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorCreateToken(response, &metadata) + } + output := &CreateTokenOutput{} + 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_deserializeOpDocumentCreateTokenOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateToken(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("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_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput, 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 *CreateTokenOutput + if *v == nil { + sv = &CreateTokenOutput{} + } 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 "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 "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_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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(), + } + } + + span.End() + 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 { +} + +func (*awsRestjson1_deserializeOpRegisterClient) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterClient) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorRegisterClient(response, &metadata) + } + output := &RegisterClientOutput{} + 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_deserializeOpDocumentRegisterClientOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRegisterClient(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientMetadataException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientMetadataException(response, errorBody) + + case strings.EqualFold("InvalidRedirectUriException", errorCode): + return awsRestjson1_deserializeErrorInvalidRedirectUriException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidScopeException", errorCode): + return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody) + + case strings.EqualFold("UnsupportedGrantTypeException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRegisterClientOutput(v **RegisterClientOutput, 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 *RegisterClientOutput + if *v == nil { + sv = &RegisterClientOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "authorizationEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.AuthorizationEndpoint = ptr.String(jtv) + } + + case "clientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientId to be of type string, got %T instead", value) + } + sv.ClientId = ptr.String(jtv) + } + + case "clientIdIssuedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClientIdIssuedAt = i64 + } + + case "clientSecret": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientSecret to be of type string, got %T instead", value) + } + sv.ClientSecret = ptr.String(jtv) + } + + case "clientSecretExpiresAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongTimeStampType to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClientSecretExpiresAt = i64 + } + + case "tokenEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.TokenEndpoint = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartDeviceAuthorization struct { +} + +func (*awsRestjson1_deserializeOpStartDeviceAuthorization) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartDeviceAuthorization) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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_deserializeOpErrorStartDeviceAuthorization(response, &metadata) + } + output := &StartDeviceAuthorizationOutput{} + 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_deserializeOpDocumentStartDeviceAuthorizationOutput(&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(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartDeviceAuthorization(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("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidClientException", errorCode): + return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("SlowDownException", errorCode): + return awsRestjson1_deserializeErrorSlowDownException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartDeviceAuthorizationOutput(v **StartDeviceAuthorizationOutput, 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 *StartDeviceAuthorizationOutput + if *v == nil { + sv = &StartDeviceAuthorizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceCode to be of type string, got %T instead", value) + } + sv.DeviceCode = 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 "interval": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IntervalInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Interval = int32(i64) + } + + case "userCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserCode to be of type string, got %T instead", value) + } + sv.UserCode = ptr.String(jtv) + } + + case "verificationUri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.VerificationUri = ptr.String(jtv) + } + + case "verificationUriComplete": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected URI to be of type string, got %T instead", value) + } + sv.VerificationUriComplete = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorAuthorizationPendingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AuthorizationPendingException{} + 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_deserializeDocumentAuthorizationPendingException(&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_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExpiredTokenException{} + 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_deserializeDocumentExpiredTokenException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + 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_deserializeDocumentInternalServerException(&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_deserializeErrorInvalidClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidClientException{} + 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_deserializeDocumentInvalidClientException(&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_deserializeErrorInvalidClientMetadataException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidClientMetadataException{} + 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_deserializeDocumentInvalidClientMetadataException(&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_deserializeErrorInvalidGrantException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidGrantException{} + 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_deserializeDocumentInvalidGrantException(&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_deserializeErrorInvalidRedirectUriException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRedirectUriException{} + 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_deserializeDocumentInvalidRedirectUriException(&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_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&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_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 + 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_deserializeDocumentInvalidScopeException(&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_deserializeErrorSlowDownException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SlowDownException{} + 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_deserializeDocumentSlowDownException(&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_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnauthorizedClientException{} + 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_deserializeDocumentUnauthorizedClientException(&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_deserializeErrorUnsupportedGrantTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.UnsupportedGrantTypeException{} + 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_deserializeDocumentUnsupportedGrantTypeException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuthorizationPendingException(v **types.AuthorizationPendingException, 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.AuthorizationPendingException + if *v == nil { + sv = &types.AuthorizationPendingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, 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.ExpiredTokenException + if *v == nil { + sv = &types.ExpiredTokenException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidClientException(v **types.InvalidClientException, 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.InvalidClientException + if *v == nil { + sv = &types.InvalidClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidClientMetadataException(v **types.InvalidClientMetadataException, 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.InvalidClientMetadataException + if *v == nil { + sv = &types.InvalidClientMetadataException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidGrantException(v **types.InvalidGrantException, 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.InvalidGrantException + if *v == nil { + sv = &types.InvalidGrantException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRedirectUriException(v **types.InvalidRedirectUriException, 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.InvalidRedirectUriException + if *v == nil { + sv = &types.InvalidRedirectUriException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidScopeException + if *v == nil { + sv = &types.InvalidScopeException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SlowDownException + if *v == nil { + sv = &types.SlowDownException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, 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.UnauthorizedClientException + if *v == nil { + sv = &types.UnauthorizedClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUnsupportedGrantTypeException(v **types.UnsupportedGrantTypeException, 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.UnsupportedGrantTypeException + if *v == nil { + sv = &types.UnsupportedGrantTypeException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go new file mode 100644 index 00000000..1d258e56 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go @@ -0,0 +1,46 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package ssooidc provides the API client, operations, and parameter types for +// AWS SSO OIDC. +// +// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a +// client (such as CLI or a native application) to register with IAM Identity +// Center. The service also enables the client to fetch the user’s access token +// upon successful authentication and authorization with IAM Identity Center. +// +// IAM Identity Center uses the sso and identitystore API namespaces. +// +// # Considerations for Using This Guide +// +// Before you begin using this guide, we recommend that you first review the +// following important information about how the IAM Identity Center OIDC service +// works. +// +// - The IAM Identity Center OIDC service currently implements only the portions +// of the OAuth 2.0 Device Authorization Grant standard ([https://tools.ietf.org/html/rfc8628] ) that are necessary to +// enable single sign-on authentication with the CLI. +// +// - With older versions of the CLI, the service only emits OIDC access tokens, +// so to obtain a new token, users must explicitly re-authenticate. To access the +// OIDC flow that supports token refresh and doesn’t require re-authentication, +// update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with +// support for OIDC token refresh and configurable IAM Identity Center session +// durations. For more information, see [Configure Amazon Web Services access portal session duration]. +// +// - The access tokens provided by this service grant access to all Amazon Web +// Services account entitlements assigned to an IAM Identity Center user, not just +// a particular application. +// +// - The documentation in this guide does not describe the mechanism to convert +// the access token into Amazon Web Services Auth (“sigv4”) credentials for use +// with IAM-protected Amazon Web Services service endpoints. For more information, +// see [GetRoleCredentials]in the IAM Identity Center Portal API Reference Guide. +// +// For general information about IAM Identity Center, see [What is IAM Identity Center?] in the IAM Identity +// Center User Guide. +// +// [Configure Amazon Web Services access portal session duration]: https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html +// [GetRoleCredentials]: https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html +// [https://tools.ietf.org/html/rfc8628]: https://tools.ietf.org/html/rfc8628 +// [What is IAM Identity Center?]: https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html +package ssooidc diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go new file mode 100644 index 00000000..6feea0c9 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -0,0 +1,556 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "sso-oauth" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO_OIDC") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO OIDC", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json new file mode 100644 index 00000000..b2a52633 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -0,0 +1,35 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateToken.go", + "api_op_CreateTokenWithIAM.go", + "api_op_RegisterClient.go", + "api_op_StartDeviceAuthorization.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/ssooidc", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go new file mode 100644 index 00000000..84251218 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package ssooidc + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.28.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go new file mode 100644 index 00000000..b4c61eba --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -0,0 +1,566 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver SSO OIDC endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "oidc.ap-southeast-4.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-4", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.ca-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-south-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.me-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "oidc.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "oidc.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "oidc.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "oidc-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "oidc.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "oidc.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go new file mode 100644 index 00000000..55dd80d0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go new file mode 100644 index 00000000..1ad103d1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go @@ -0,0 +1,512 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateToken struct { +} + +func (*awsRestjson1_serializeOpCreateToken) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/token") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTokenInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.ClientSecret != nil { + ok := object.Key("clientSecret") + ok.String(*v.ClientSecret) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.CodeVerifier != nil { + ok := object.Key("codeVerifier") + ok.String(*v.CodeVerifier) + } + + if v.DeviceCode != nil { + ok := object.Key("deviceCode") + ok.String(*v.DeviceCode) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + if v.Scope != nil { + ok := object.Key("scope") + if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateTokenWithIAM struct { +} + +func (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateTokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateTokenWithIAMInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/token?aws_iam=t") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Assertion != nil { + ok := object.Key("assertion") + ok.String(*v.Assertion) + } + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.CodeVerifier != nil { + ok := object.Key("codeVerifier") + ok.String(*v.CodeVerifier) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + if v.RequestedTokenType != nil { + ok := object.Key("requestedTokenType") + ok.String(*v.RequestedTokenType) + } + + if v.Scope != nil { + ok := object.Key("scope") + if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil { + return err + } + } + + if v.SubjectToken != nil { + ok := object.Key("subjectToken") + ok.String(*v.SubjectToken) + } + + if v.SubjectTokenType != nil { + ok := object.Key("subjectTokenType") + ok.String(*v.SubjectTokenType) + } + + return nil +} + +type awsRestjson1_serializeOpRegisterClient struct { +} + +func (*awsRestjson1_serializeOpRegisterClient) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterClientInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/client/register") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterClientInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientName != nil { + ok := object.Key("clientName") + ok.String(*v.ClientName) + } + + if v.ClientType != nil { + ok := object.Key("clientType") + ok.String(*v.ClientType) + } + + if v.EntitledApplicationArn != nil { + ok := object.Key("entitledApplicationArn") + ok.String(*v.EntitledApplicationArn) + } + + if v.GrantTypes != nil { + ok := object.Key("grantTypes") + if err := awsRestjson1_serializeDocumentGrantTypes(v.GrantTypes, ok); err != nil { + return err + } + } + + if v.IssuerUrl != nil { + ok := object.Key("issuerUrl") + ok.String(*v.IssuerUrl) + } + + if v.RedirectUris != nil { + ok := object.Key("redirectUris") + if err := awsRestjson1_serializeDocumentRedirectUris(v.RedirectUris, ok); err != nil { + return err + } + } + + if v.Scopes != nil { + ok := object.Key("scopes") + if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpStartDeviceAuthorization struct { +} + +func (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartDeviceAuthorizationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device_authorization") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.ClientSecret != nil { + ok := object.Key("clientSecret") + ok.String(*v.ClientSecret) + } + + if v.StartUrl != nil { + ok := object.Key("startUrl") + ok.String(*v.StartUrl) + } + + return nil +} + +func awsRestjson1_serializeDocumentGrantTypes(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentRedirectUris(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go new file mode 100644 index 00000000..2cfe7b48 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go @@ -0,0 +1,428 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a request to authorize a client with an access user session +// token is pending. +type AuthorizationPendingException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *AuthorizationPendingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AuthorizationPendingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AuthorizationPendingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AuthorizationPendingException" + } + return *e.ErrorCodeOverride +} +func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the token issued by the service is expired and is no longer +// valid. +type ExpiredTokenException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *ExpiredTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExpiredTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExpiredTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTokenException" + } + return *e.ErrorCodeOverride +} +func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that an error from the service occurred while trying to process a +// request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Indicates that the clientId or clientSecret in the request is invalid. For +// example, this can occur when a client sends an incorrect clientId or an expired +// clientSecret . +type InvalidClientException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidClientException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidClientException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client information sent in the request during registration +// is invalid. +type InvalidClientMetadataException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidClientMetadataException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidClientMetadataException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidClientMetadataException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidClientMetadataException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a request contains an invalid grant. This can occur if a client +// makes a CreateTokenrequest with an invalid grant type. +type InvalidGrantException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidGrantException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidGrantException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidGrantException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidGrantException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that one or more redirect URI in the request is not supported for +// this operation. +type InvalidRedirectUriException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidRedirectUriException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRedirectUriException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRedirectUriException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRedirectUriException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRedirectUriException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that something is wrong with the input to the request. For example, a +// required parameter might be missing or out of range. +type InvalidRequestException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that a token provided as input to the request was issued by and is +// only usable by calling IAM Identity Center endpoints in another region. +type InvalidRequestRegionException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + Endpoint *string + Region *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequestRegionException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestRegionException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestRegionException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequestRegionException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the scope provided in the request is invalid. +type InvalidScopeException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *InvalidScopeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidScopeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidScopeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidScopeException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client is making the request too frequently and is more than +// the service can handle. +type SlowDownException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *SlowDownException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SlowDownException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SlowDownException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SlowDownException" + } + return *e.ErrorCodeOverride +} +func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the client is not currently authorized to make the request. This +// can happen when a clientId is not issued for a public client. +type UnauthorizedClientException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *UnauthorizedClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnauthorizedClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnauthorizedClientException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnauthorizedClientException" + } + return *e.ErrorCodeOverride +} +func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Indicates that the grant type in the request is not supported by the service. +type UnsupportedGrantTypeException struct { + Message *string + + ErrorCodeOverride *string + + Error_ *string + Error_description *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedGrantTypeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedGrantTypeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedGrantTypeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedGrantTypeException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go new file mode 100644 index 00000000..0ec0789f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go @@ -0,0 +1,9 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go new file mode 100644 index 00000000..9c17e4c8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go @@ -0,0 +1,184 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateToken struct { +} + +func (*validateOpCreateToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateTokenWithIAM struct { +} + +func (*validateOpCreateTokenWithIAM) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateTokenWithIAMInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateTokenWithIAMInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterClient struct { +} + +func (*validateOpRegisterClient) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterClientInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterClientInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpStartDeviceAuthorization struct { +} + +func (*validateOpStartDeviceAuthorization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDeviceAuthorizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDeviceAuthorizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After) +} + +func addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After) +} + +func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After) +} + +func addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After) +} + +func validateOpCreateTokenInput(v *CreateTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.ClientSecret == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateTokenWithIAMInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterClientInput(v *RegisterClientInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterClientInput"} + if v.ClientName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientName")) + } + if v.ClientType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDeviceAuthorizationInput"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.ClientSecret == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientSecret")) + } + if v.StartUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartUrl")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md new file mode 100644 index 00000000..c72a4098 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -0,0 +1,573 @@ +# v1.33.3 (2024-12-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.2 (2024-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.1 (2024-11-18) + +* **Dependency Update**: Update to smithy-go v1.22.1. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.0 (2024-11-14) + +* **Feature**: This release introduces the new API 'AssumeRoot', which returns short-term credentials that you can use to perform privileged tasks. + +# v1.32.4 (2024-11-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.3 (2024-10-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.2 (2024-10-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.1 (2024-10-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.0 (2024-10-04) + +* **Feature**: Add support for HTTP client metrics. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.4 (2024-10-03) + +* No change notes available for this release. + +# v1.31.3 (2024-09-27) + +* No change notes available for this release. + +# v1.31.2 (2024-09-25) + +* No change notes available for this release. + +# v1.31.1 (2024-09-23) + +* No change notes available for this release. + +# v1.31.0 (2024-09-20) + +* **Feature**: Add tracing and metrics support to service clients. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.8 (2024-09-17) + +* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. + +# v1.30.7 (2024-09-04) + +* No change notes available for this release. + +# v1.30.6 (2024-09-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.5 (2024-08-22) + +* No change notes available for this release. + +# v1.30.4 (2024-08-15) + +* **Dependency Update**: Bump minimum Go version to 1.21. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.3 (2024-07-10.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.2 (2024-07-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.1 (2024-06-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.0 (2024-06-26) + +* **Feature**: Support list-of-string endpoint parameter. + +# v1.29.1 (2024-06-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.0 (2024-06-18) + +* **Feature**: Track usage of various AWS SDK features in user-agent string. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.13 (2024-06-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.12 (2024-06-07) + +* **Bug Fix**: Add clock skew correction on all service clients +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.11 (2024-06-03) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.10 (2024-05-23) + +* No change notes available for this release. + +# v1.28.9 (2024-05-16) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.8 (2024-05-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.7 (2024-05-08) + +* **Bug Fix**: GoDoc improvement + +# v1.28.6 (2024-03-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.5 (2024-03-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.4 (2024-03-07) + +* **Bug Fix**: Remove dependency on go-cmp. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.3 (2024-03-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.2 (2024-03-04) + +* **Bug Fix**: Update internal/presigned-url dependency for corrected API name. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.1 (2024-02-23) + +* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.28.0 (2024-02-22) + +* **Feature**: Add middleware stack snapshot tests. + +# v1.27.2 (2024-02-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.27.1 (2024-02-20) + +* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. + +# v1.27.0 (2024-02-13) + +* **Feature**: Bump minimum Go version to 1.20 per our language support policy. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.7 (2024-01-04) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.6 (2023-12-20) + +* No change notes available for this release. + +# v1.26.5 (2023-12-08) + +* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. + +# v1.26.4 (2023-12-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.3 (2023-12-06) + +* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. +* **Bug Fix**: STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication. + +# v1.26.2 (2023-12-01) + +* **Bug Fix**: Correct wrapping of errors in authentication workflow. +* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.1 (2023-11-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.26.0 (2023-11-29) + +* **Feature**: Expose Options() accessor on service clients. +* **Documentation**: Documentation updates for AWS Security Token Service. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.6 (2023-11-28.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.5 (2023-11-28) + +* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. + +# v1.25.4 (2023-11-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.3 (2023-11-17) + +* **Documentation**: API updates for the AWS Security Token Service + +# v1.25.2 (2023-11-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.1 (2023-11-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.25.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2023-10-02) + +* **Feature**: STS API updates for assumeRole + +# v1.22.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.21.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2023-08-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-08-01) + +* No change notes available for this release. + +# v1.21.0 (2023-07-31) + +* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.1 (2023-07-28) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-07-25) + +* **Feature**: API updates for the AWS Security Token Service + +# v1.19.3 (2023-07-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.2 (2023-06-15) + +* No change notes available for this release. + +# v1.19.1 (2023-06-13) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2023-05-08) + +* **Feature**: Documentation updates for AWS Security Token Service. + +# v1.18.11 (2023-05-04) + +* No change notes available for this release. + +# v1.18.10 (2023-04-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.9 (2023-04-10) + +* No change notes available for this release. + +# v1.18.8 (2023-04-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.7 (2023-03-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.6 (2023-03-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.5 (2023-02-22) + +* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. + +# v1.18.4 (2023-02-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.3 (2023-02-03) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade smithy to 1.27.2 and correct empty query list serialization. + +# v1.18.2 (2023-01-25) + +* **Documentation**: Doc only change to update wording in a key topic + +# v1.18.1 (2023-01-23) + +* No change notes available for this release. + +# v1.18.0 (2023-01-05) + +* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). + +# v1.17.7 (2022-12-15) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.6 (2022-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.5 (2022-11-22) + +* No change notes available for this release. + +# v1.17.4 (2022-11-17) + +* **Documentation**: Documentation updates for AWS Security Token Service. + +# v1.17.3 (2022-11-16) + +* No change notes available for this release. + +# v1.17.2 (2022-11-10) + +* No change notes available for this release. + +# v1.17.1 (2022-10-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.0 (2022-10-21) + +* **Feature**: Add presign functionality for sts:AssumeRole operation +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.19 (2022-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.18 (2022-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.17 (2022-09-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.16 (2022-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.15 (2022-08-30) + +* No change notes available for this release. + +# v1.16.14 (2022-08-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.13 (2022-08-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.12 (2022-08-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.11 (2022-08-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.10 (2022-08-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.9 (2022-07-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.8 (2022-06-29) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.7 (2022-06-07) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.6 (2022-05-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.5 (2022-05-16) + +* **Documentation**: Documentation updates for AWS Security Token Service. + +# v1.16.4 (2022-04-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.3 (2022-03-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.2 (2022-03-24) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.1 (2022-03-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2022-03-08) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Documentation**: Updated service client model to latest release. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2022-02-24) + +* **Feature**: API client updated +* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2022-01-14) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.0 (2022-01-07) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.12.0 (2021-12-21) + +* **Feature**: Updated to latest service endpoints + +# v1.11.1 (2021-12-02) + +* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.0 (2021-11-30) + +* **Feature**: API client updated + +# v1.10.1 (2021-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2021-11-12) + +* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. + +# v1.9.0 (2021-11-06) + +* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.8.0 (2021-10-21) + +* **Feature**: API client updated +* **Feature**: Updated to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.2 (2021-10-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.1 (2021-09-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.7.0 (2021-08-27) + +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.2 (2021-08-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.1 (2021-08-04) + +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.6.0 (2021-07-15) + +* **Feature**: The ErrorCode method on generated service error types has been corrected to match the API model. +* **Documentation**: Updated service model to latest revision. +* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.5.0 (2021-06-25) + +* **Feature**: API client updated +* **Feature**: Updated `github.com/aws/smithy-go` to latest version +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.1 (2021-05-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2021-05-14) + +* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. +* **Dependency Update**: Updated to the latest SDK module versions + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go new file mode 100644 index 00000000..4e678ce2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -0,0 +1,1064 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding" + presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "STS" +const ServiceAPIVersion = "2011-06-15" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sts") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/sts") +} + +// Client provides the API client to make operations call for AWS Security Token +// Service. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +// HTTPPresignerV4 represents presigner interface used by presign url client +type HTTPPresignerV4 interface { + PresignHTTP( + ctx context.Context, credentials aws.Credentials, r *http.Request, + payloadHash string, service string, region string, signingTime time.Time, + optFns ...func(*v4.SignerOptions), + ) (url string, signedHeader http.Header, err error) +} + +// PresignOptions represents the presign client options +type PresignOptions struct { + + // ClientOptions are list of functional options to mutate client options used by + // the presign client. + ClientOptions []func(*Options) + + // Presigner is the presigner used by the presign url client + Presigner HTTPPresignerV4 +} + +func (o PresignOptions) copy() PresignOptions { + clientOptions := make([]func(*Options), len(o.ClientOptions)) + copy(clientOptions, o.ClientOptions) + o.ClientOptions = clientOptions + return o +} + +// WithPresignClientFromClientOptions is a helper utility to retrieve a function +// that takes PresignOption as input +func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) { + return withPresignClientFromClientOptions(optFns).options +} + +type withPresignClientFromClientOptions []func(*Options) + +func (w withPresignClientFromClientOptions) options(o *PresignOptions) { + o.ClientOptions = append(o.ClientOptions, w...) +} + +// PresignClient represents the presign url client +type PresignClient struct { + client *Client + options PresignOptions +} + +// NewPresignClient generates a presign client using provided API Client and +// presign options +func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient { + var options PresignOptions + for _, fn := range optFns { + fn(&options) + } + if len(options.ClientOptions) != 0 { + c = New(c.options, options.ClientOptions...) + } + + if options.Presigner == nil { + options.Presigner = newDefaultV4Signer(c.options) + } + + return &PresignClient{ + client: c, + options: options, + } +} + +func withNopHTTPClientAPIOption(o *Options) { + o.HTTPClient = smithyhttp.NopClient{} +} + +type presignContextPolyfillMiddleware struct { +} + +func (*presignContextPolyfillMiddleware) ID() string { + return "presignContextPolyfill" +} + +func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + schemeID := rscheme.Scheme.SchemeID() + + if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" { + if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr) + } + } else if schemeID == "aws.auth#sigv4a" { + if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningName(ctx, sn) + } + if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok { + ctx = awsmiddleware.SetSigningRegion(ctx, sr[0]) + } + } + + return next.HandleFinalize(ctx, in) +} + +type presignConverter PresignOptions + +func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { + if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok { + stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { + stack.Finalize.Remove((*retry.Attempt)(nil).ID()) + } + if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { + stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) + } + stack.Deserialize.Clear() + stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) + stack.Build.Remove("UserAgent") + if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { + return err + } + + pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ + CredentialsProvider: options.Credentials, + Presigner: c.Presigner, + LogSigning: options.ClientLogMode.IsSigning(), + }) + if _, err := stack.Finalize.Swap("Signing", pmw); err != nil { + return err + } + if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { + return err + } + // convert request to a GET request + err = query.AddAsGetRequestMiddleware(stack) + if err != nil { + return err + } + err = presignedurlcust.AddAsIsPresigningMiddleware(stack) + if err != nil { + return err + } + return nil +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go new file mode 100644 index 00000000..8838f4fb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go @@ -0,0 +1,547 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of temporary security credentials that you can use to access +// Amazon Web Services resources. These temporary credentials consist of an access +// key ID, a secret access key, and a security token. Typically, you use AssumeRole +// within your account or for cross-account access. For a comparison of AssumeRole +// with other API operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the +// IAM User Guide. +// +// # Permissions +// +// The temporary security credentials created by AssumeRole can be used to make +// API calls to any Amazon Web Services service with the following exception: You +// cannot call the Amazon Web Services STS GetFederationToken or GetSessionToken +// API operations. +// +// (Optional) You can pass inline or managed session policies to this operation. +// You can pass a single JSON policy document to use as an inline session policy. +// You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use +// as managed session policies. The plaintext that you use for both inline and +// managed session policies can't exceed 2,048 characters. Passing policies to this +// operation returns new temporary credentials. The resulting session's permissions +// are the intersection of the role's identity-based policy and the session +// policies. You can use the role's temporary credentials in subsequent Amazon Web +// Services API calls to access resources in the account that owns the role. You +// cannot use session policies to grant more permissions than those allowed by the +// identity-based policy of the role that is being assumed. For more information, +// see [Session Policies]in the IAM User Guide. +// +// When you create a role, you create two policies: a role trust policy that +// specifies who can assume the role, and a permissions policy that specifies what +// can be done with the role. You specify the trusted principal that is allowed to +// assume the role in the role trust policy. +// +// To assume a role from a different account, your Amazon Web Services account +// must be trusted by the role. The trust relationship is defined in the role's +// trust policy when the role is created. That trust policy states which accounts +// are allowed to delegate that access to users in the account. +// +// A user who wants to access a role in a different account must also have +// permissions that are delegated from the account administrator. The administrator +// must attach a policy that allows the user to call AssumeRole for the ARN of the +// role in the other account. +// +// To allow a user to assume a role in the same account, you can do either of the +// following: +// +// - Attach a policy to the user that allows the user to call AssumeRole (as long +// as the role's trust policy trusts the account). +// +// - Add the user as a principal directly in the role's trust policy. +// +// You can do either because the role’s trust policy acts as an IAM resource-based +// policy. When a resource-based policy grants access to a principal in the same +// account, no additional identity-based policy is required. For more information +// about trust policies and resource-based policies, see [IAM Policies]in the IAM User Guide. +// +// # Tags +// +// (Optional) You can pass tag key-value pairs to your session. These tags are +// called session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM +// User Guide. +// +// An administrator must grant you the permissions necessary to pass session tags. +// The administrator can also create granular permissions to allow you to pass only +// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during role +// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. +// +// # Using MFA with AssumeRole +// +// (Optional) You can include multi-factor authentication (MFA) information when +// you call AssumeRole . This is useful for cross-account scenarios to ensure that +// the user that assumes the role has been authenticated with an Amazon Web +// Services MFA device. In that scenario, the trust policy of the role being +// assumed includes a condition that tests for MFA authentication. If the caller +// does not include valid MFA information, the request to assume the role is +// denied. The condition in a trust policy that tests for MFA authentication might +// look like the following example. +// +// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} +// +// For more information, see [Configuring MFA-Protected API Access] in the IAM User Guide guide. +// +// To use MFA with AssumeRole , you pass values for the SerialNumber and TokenCode +// parameters. The SerialNumber value identifies the user's hardware or virtual +// MFA device. The TokenCode is the time-based one-time password (TOTP) that the +// MFA device produces. +// +// [Configuring MFA-Protected API Access]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html +// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining +// [IAM Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html +// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html +// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) { + if params == nil { + params = &AssumeRoleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeRole", params, optFns, c.addOperationAssumeRoleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeRoleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeRoleInput struct { + + // The Amazon Resource Name (ARN) of the role to assume. + // + // This member is required. + RoleArn *string + + // An identifier for the assumed role session. + // + // Use the role session name to uniquely identify a session when the same role is + // assumed by different principals or for different reasons. In cross-account + // scenarios, the role session name is visible to, and can be logged by the account + // that owns the role. The role session name is also used in the ARN of the assumed + // role principal. This means that subsequent cross-account API requests that use + // the temporary security credentials will expose the role session name to the + // external account in their CloudTrail logs. + // + // For security purposes, administrators can view this field in [CloudTrail logs] to help identify + // who performed an action in Amazon Web Services. Your administrator might require + // that you specify your user name as the session name when you assume the role. + // For more information, see [sts:RoleSessionName]sts:RoleSessionName . + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds + // [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname + // + // This member is required. + RoleSessionName *string + + // The duration, in seconds, of the role session. The value specified can range + // from 900 seconds (15 minutes) up to the maximum session duration set for the + // role. The maximum session duration setting can have a value from 1 hour to 12 + // hours. If you specify a value higher than this setting or the administrator + // setting (whichever is lower), the operation fails. For example, if you specify a + // session duration of 12 hours, but your administrator set the maximum session + // duration to 6 hours, your operation fails. + // + // Role chaining limits your Amazon Web Services CLI or Amazon Web Services API + // role session to a maximum of one hour. When you use the AssumeRole API + // operation to assume a role, you can specify the duration of your role session + // with the DurationSeconds parameter. You can specify a parameter value of up to + // 43200 seconds (12 hours), depending on the maximum session duration setting for + // your role. However, if you assume a role using role chaining and provide a + // DurationSeconds parameter value greater than one hour, the operation fails. To + // learn how to view the maximum value for your role, see [Update the maximum session duration for a role]. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request to + // the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. + // + // [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration + // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + DurationSeconds *int32 + + // A unique identifier that might be required when you assume a role in another + // account. If the administrator of the account to which the role belongs provided + // you with an external ID, then provide that value in the ExternalId parameter. + // This value can be any string, such as a passphrase or account number. A + // cross-account role is usually set up to trust everyone in an account. Therefore, + // the administrator of the trusting account might send an external ID to the + // administrator of the trusted account. That way, only someone with the ID can + // assume the role, rather than everyone in the account. For more information about + // the external ID, see [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@:/- + // + // [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html + ExternalId *string + + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use the + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM + // User Guide. + // + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // For more information about role session permissions, see [Session policies]. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + Policy *string + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to + // use as managed session policies. The policies must exist in the same account as + // the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the + // Amazon Web Services General Reference. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's + // identity-based policy and the session policies. You can use the role's temporary + // credentials in subsequent Amazon Web Services API calls to access resources in + // the account that owns the role. You cannot use session policies to grant more + // permissions than those allowed by the identity-based policy of the role that is + // being assumed. For more information, see [Session Policies]in the IAM User Guide. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + PolicyArns []types.PolicyDescriptorType + + // A list of previously acquired trusted context assertions in the format of a + // JSON array. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. + // + // The following is an example of a ProvidedContext value that includes a single + // trusted context assertion and the ARN of the context provider from which the + // trusted context assertion was generated. + // + // [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}] + ProvidedContexts []types.ProvidedContext + + // The identification number of the MFA device that is associated with the user + // who is making the AssumeRole call. Specify this value if the trust policy of + // the role being assumed includes a condition that requires MFA authentication. + // The value is either the serial number for a hardware device (such as + // GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as + // arn:aws:iam::123456789012:mfa/user ). + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + SerialNumber *string + + // The source identity specified by the principal that is calling the AssumeRole + // operation. The source identity value persists across [chained role]sessions. + // + // You can require users to specify a source identity when they assume a role. You + // do this by using the [sts:SourceIdentity]sts:SourceIdentity condition key in a role trust policy. + // You can use source identity information in CloudTrail logs to determine who took + // actions with a role. You can use the aws:SourceIdentity condition key to + // further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the + // IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@-. You cannot use a + // value that begins with the text aws: . This prefix is reserved for Amazon Web + // Services internal use. + // + // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining + // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + // [sts:SourceIdentity]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity + SourceIdentity *string + + // A list of session tags that you want to pass. Each session tag consists of a + // key name and an associated value. For more information about session tags, see [Tagging Amazon Web Services STS Sessions] + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plaintext + // session tag keys can’t exceed 128 characters, and the values can’t exceed 256 + // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the role. When you do, session tags override a role tag with the same key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This means + // that you cannot have separate Department and department tag keys. Assume that + // the role has the Department = Marketing tag and you pass the department = + // engineering session tag. Department and department are not saved as separate + // tags, and the session tag passed in the request takes precedence over the role + // tag. + // + // Additionally, if you used temporary credentials to perform this operation, the + // new session inherits any transitive session tags from the calling session. If + // you pass a session tag with the same key as an inherited tag, the operation + // fails. To view the inherited tags for a session, see the CloudTrail logs. For + // more information, see [Viewing Session Tags in CloudTrail]in the IAM User Guide. + // + // [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html + // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // [Viewing Session Tags in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs + Tags []types.Tag + + // The value provided by the MFA device, if the trust policy of the role being + // assumed requires MFA. (In other words, if the policy includes a condition that + // tests for MFA). If the role being assumed requires MFA and if the TokenCode + // value is missing or expired, the AssumeRole call returns an "access denied" + // error. + // + // The format for this parameter, as described by its regex pattern, is a sequence + // of six numeric digits. + TokenCode *string + + // A list of keys for session tags that you want to set as transitive. If you set + // a tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. + // + // This parameter is optional. The transitive status of a session tag does not + // impact its packed binary size. + // + // If you choose not to specify a transitive tag key, then no tags are passed from + // this session to any subsequent sessions. + // + // [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining + TransitiveTagKeys []string + + noSmithyDocumentSerde +} + +// Contains the response to a successful AssumeRole request, including temporary Amazon Web +// Services credentials that can be used to make Amazon Web Services requests. +type AssumeRoleOutput struct { + + // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers + // that you can use to refer to the resulting temporary security credentials. For + // example, you can reference these credentials as a principal in a resource-based + // policy by using the ARN or assumed role ID. The ARN and ID include the + // RoleSessionName that you specified when you called AssumeRole . + AssumedRoleUser *types.AssumedRoleUser + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // A percentage value that indicates the packed size of the session policies and + // session tags combined passed in the request. The request fails if the packed + // size is greater than 100 percent, which means the policies and tags exceeded the + // allowed space. + PackedPolicySize *int32 + + // The source identity specified by the principal that is calling the AssumeRole + // operation. + // + // You can require users to specify a source identity when they assume a role. You + // do this by using the sts:SourceIdentity condition key in a role trust policy. + // You can use source identity information in CloudTrail logs to determine who took + // actions with a role. You can use the aws:SourceIdentity condition key to + // further control access to Amazon Web Services resources based on the value of + // source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the + // IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + SourceIdentity *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRole{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRole"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssumeRoleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssumeRole", + } +} + +// PresignAssumeRole is used to generate a presigned HTTP Request which contains +// presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &AssumeRoleInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "AssumeRole", params, clientOptFns, + c.client.addOperationAssumeRoleMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go new file mode 100644 index 00000000..d0e117ac --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go @@ -0,0 +1,455 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of temporary security credentials for users who have been +// authenticated via a SAML authentication response. This operation provides a +// mechanism for tying an enterprise identity store or directory to role-based +// Amazon Web Services access without user-specific credentials or configuration. +// For a comparison of AssumeRoleWithSAML with the other API operations that +// produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. +// +// The temporary security credentials returned by this operation consist of an +// access key ID, a secret access key, and a security token. Applications can use +// these temporary security credentials to sign calls to Amazon Web Services +// services. +// +// # Session Duration +// +// By default, the temporary security credentials created by AssumeRoleWithSAML +// last for one hour. However, you can use the optional DurationSeconds parameter +// to specify the duration of your session. Your role session lasts for the +// duration that you specify, or until the time specified in the SAML +// authentication response's SessionNotOnOrAfter value, whichever is shorter. You +// can provide a DurationSeconds value from 900 seconds (15 minutes) up to the +// maximum session duration setting for the role. This setting can have a value +// from 1 hour to 12 hours. To learn how to view the maximum value for your role, +// see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. The maximum session duration limit applies when you +// use the AssumeRole* API operations or the assume-role* CLI commands. However +// the limit does not apply when you use those operations to create a console URL. +// For more information, see [Using IAM Roles]in the IAM User Guide. +// +// [Role chaining]limits your CLI or Amazon Web Services API role session to a maximum of one +// hour. When you use the AssumeRole API operation to assume a role, you can +// specify the duration of your role session with the DurationSeconds parameter. +// You can specify a parameter value of up to 43200 seconds (12 hours), depending +// on the maximum session duration setting for your role. However, if you assume a +// role using role chaining and provide a DurationSeconds parameter value greater +// than one hour, the operation fails. +// +// # Permissions +// +// The temporary security credentials created by AssumeRoleWithSAML can be used to +// make API calls to any Amazon Web Services service with the following exception: +// you cannot call the STS GetFederationToken or GetSessionToken API operations. +// +// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a +// single JSON policy document to use as an inline session policy. You can also +// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed +// session policies. The plaintext that you use for both inline and managed session +// policies can't exceed 2,048 characters. Passing policies to this operation +// returns new temporary credentials. The resulting session's permissions are the +// intersection of the role's identity-based policy and the session policies. You +// can use the role's temporary credentials in subsequent Amazon Web Services API +// calls to access resources in the account that owns the role. You cannot use +// session policies to grant more permissions than those allowed by the +// identity-based policy of the role that is being assumed. For more information, +// see [Session Policies]in the IAM User Guide. +// +// Calling AssumeRoleWithSAML does not require the use of Amazon Web Services +// security credentials. The identity of the caller is validated by using keys in +// the metadata document that is uploaded for the SAML provider entity for your +// identity provider. +// +// Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. The +// entry includes the value in the NameID element of the SAML assertion. We +// recommend that you use a NameIDType that is not associated with any personally +// identifiable information (PII). For example, you could instead use the +// persistent identifier ( urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). +// +// # Tags +// +// (Optional) You can configure your IdP to pass attributes into your SAML +// assertion as session tags. Each session tag consists of a key name and an +// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User +// Guide. +// +// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed +// 128 characters and the values can’t exceed 256 characters. For these and +// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. +// +// An Amazon Web Services conversion compresses the passed inline session policy, +// managed policy ARNs, and session tags into a packed binary format that has a +// separate limit. Your request can fail for this limit even if your plaintext +// meets the other requirements. The PackedPolicySize response element indicates +// by percentage how close the policies and tags for your request are to the upper +// size limit. +// +// You can pass a session tag with the same key as a tag that is attached to the +// role. When you do, session tags override the role's tags with the same key. +// +// An administrator must grant you the permissions necessary to pass session tags. +// The administrator can also create granular permissions to allow you to pass only +// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during role +// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. +// +// # SAML Configuration +// +// Before your application can call AssumeRoleWithSAML , you must configure your +// SAML identity provider (IdP) to issue the claims required by Amazon Web +// Services. Additionally, you must use Identity and Access Management (IAM) to +// create a SAML provider entity in your Amazon Web Services account that +// represents your identity provider. You must also create an IAM role that +// specifies this SAML provider in its trust policy. +// +// For more information, see the following resources: +// +// [About SAML 2.0-based Federation] +// - in the IAM User Guide. +// +// [Creating SAML Identity Providers] +// - in the IAM User Guide. +// +// [Configuring a Relying Party and Claims] +// - in the IAM User Guide. +// +// [Creating a Role for SAML 2.0 Federation] +// - in the IAM User Guide. +// +// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session +// [Creating a Role for SAML 2.0 Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html +// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length +// [Creating SAML Identity Providers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html +// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html +// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +// [Configuring a Relying Party and Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html +// [Role chaining]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining +// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html +// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// [About SAML 2.0-based Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html +// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining +func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) { + if params == nil { + params = &AssumeRoleWithSAMLInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithSAML", params, optFns, c.addOperationAssumeRoleWithSAMLMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeRoleWithSAMLOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeRoleWithSAMLInput struct { + + // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the + // IdP. + // + // This member is required. + PrincipalArn *string + + // The Amazon Resource Name (ARN) of the role that the caller is assuming. + // + // This member is required. + RoleArn *string + + // The base64 encoded SAML authentication response provided by the IdP. + // + // For more information, see [Configuring a Relying Party and Adding Claims] in the IAM User Guide. + // + // [Configuring a Relying Party and Adding Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html + // + // This member is required. + SAMLAssertion *string + + // The duration, in seconds, of the role session. Your role session lasts for the + // duration that you specify for the DurationSeconds parameter, or until the time + // specified in the SAML authentication response's SessionNotOnOrAfter value, + // whichever is shorter. You can provide a DurationSeconds value from 900 seconds + // (15 minutes) up to the maximum session duration setting for the role. This + // setting can have a value from 1 hour to 12 hours. If you specify a value higher + // than this setting, the operation fails. For example, if you specify a session + // duration of 12 hours, but your administrator set the maximum session duration to + // 6 hours, your operation fails. To learn how to view the maximum value for your + // role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request to + // the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. + // + // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session + // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + DurationSeconds *int32 + + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use the + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM + // User Guide. + // + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. + // + // For more information about role session permissions, see [Session policies]. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + Policy *string + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to + // use as managed session policies. The policies must exist in the same account as + // the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the + // Amazon Web Services General Reference. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's + // identity-based policy and the session policies. You can use the role's temporary + // credentials in subsequent Amazon Web Services API calls to access resources in + // the account that owns the role. You cannot use session policies to grant more + // permissions than those allowed by the identity-based policy of the role that is + // being assumed. For more information, see [Session Policies]in the IAM User Guide. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + PolicyArns []types.PolicyDescriptorType + + noSmithyDocumentSerde +} + +// Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web +// Services credentials that can be used to make Amazon Web Services requests. +type AssumeRoleWithSAMLOutput struct { + + // The identifiers for the temporary security credentials that the operation + // returns. + AssumedRoleUser *types.AssumedRoleUser + + // The value of the Recipient attribute of the SubjectConfirmationData element of + // the SAML assertion. + Audience *string + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // The value of the Issuer element of the SAML assertion. + Issuer *string + + // A hash value based on the concatenation of the following: + // + // - The Issuer response value. + // + // - The Amazon Web Services account ID. + // + // - The friendly name (the last part of the ARN) of the SAML provider in IAM. + // + // The combination of NameQualifier and Subject can be used to uniquely identify a + // user. + // + // The following pseudocode shows how the hash value is calculated: + // + // BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) ) + NameQualifier *string + + // A percentage value that indicates the packed size of the session policies and + // session tags combined passed in the request. The request fails if the packed + // size is greater than 100 percent, which means the policies and tags exceeded the + // allowed space. + PackedPolicySize *int32 + + // The value in the SourceIdentity attribute in the SAML assertion. The source + // identity value persists across [chained role]sessions. + // + // You can require users to set a source identity value when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. That way, actions that are taken with the role are associated with that + // user. After the source identity is set, the value cannot be changed. It is + // present in the request for all actions that are taken by the role and persists + // across [chained role]sessions. You can configure your SAML identity provider to use an + // attribute associated with your users, like user name or email, as the source + // identity when calling AssumeRoleWithSAML . You do this by adding an attribute to + // the SAML assertion. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in + // the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts + // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + SourceIdentity *string + + // The value of the NameID element in the Subject element of the SAML assertion. + Subject *string + + // The format of the name ID, as defined by the Format attribute in the NameID + // element of the SAML assertion. Typical examples of the format are transient or + // persistent . + // + // If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format , + // that prefix is removed. For example, + // urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient . + // If the format includes any other prefix, the format is returned with no + // modifications. + SubjectType *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithSAML{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithSAML"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssumeRoleWithSAML", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go new file mode 100644 index 00000000..803cded5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go @@ -0,0 +1,474 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of temporary security credentials for users who have been +// authenticated in a mobile or web application with a web identity provider. +// Example providers include the OAuth 2.0 providers Login with Amazon and +// Facebook, or any OpenID Connect-compatible identity provider such as Google or [Amazon Cognito federated identities]. +// +// For mobile applications, we recommend that you use Amazon Cognito. You can use +// Amazon Cognito with the [Amazon Web Services SDK for iOS Developer Guide]and the [Amazon Web Services SDK for Android Developer Guide] to uniquely identify a user. You can also +// supply the user with a consistent identity throughout the lifetime of an +// application. +// +// To learn more about Amazon Cognito, see [Amazon Cognito identity pools] in Amazon Cognito Developer Guide. +// +// Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web +// Services security credentials. Therefore, you can distribute an application (for +// example, on mobile devices) that requests temporary security credentials without +// including long-term Amazon Web Services credentials in the application. You also +// don't need to deploy server-based proxy services that use long-term Amazon Web +// Services credentials. Instead, the identity of the caller is validated by using +// a token from the web identity provider. For a comparison of +// AssumeRoleWithWebIdentity with the other API operations that produce temporary +// credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. +// +// The temporary security credentials returned by this API consist of an access +// key ID, a secret access key, and a security token. Applications can use these +// temporary security credentials to sign calls to Amazon Web Services service API +// operations. +// +// # Session Duration +// +// By default, the temporary security credentials created by +// AssumeRoleWithWebIdentity last for one hour. However, you can use the optional +// DurationSeconds parameter to specify the duration of your session. You can +// provide a value from 900 seconds (15 minutes) up to the maximum session duration +// setting for the role. This setting can have a value from 1 hour to 12 hours. To +// learn how to view the maximum value for your role, see [Update the maximum session duration for a role]in the IAM User Guide. +// The maximum session duration limit applies when you use the AssumeRole* API +// operations or the assume-role* CLI commands. However the limit does not apply +// when you use those operations to create a console URL. For more information, see +// [Using IAM Roles]in the IAM User Guide. +// +// # Permissions +// +// The temporary security credentials created by AssumeRoleWithWebIdentity can be +// used to make API calls to any Amazon Web Services service with the following +// exception: you cannot call the STS GetFederationToken or GetSessionToken API +// operations. +// +// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a +// single JSON policy document to use as an inline session policy. You can also +// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed +// session policies. The plaintext that you use for both inline and managed session +// policies can't exceed 2,048 characters. Passing policies to this operation +// returns new temporary credentials. The resulting session's permissions are the +// intersection of the role's identity-based policy and the session policies. You +// can use the role's temporary credentials in subsequent Amazon Web Services API +// calls to access resources in the account that owns the role. You cannot use +// session policies to grant more permissions than those allowed by the +// identity-based policy of the role that is being assumed. For more information, +// see [Session Policies]in the IAM User Guide. +// +// # Tags +// +// (Optional) You can configure your IdP to pass attributes into your web identity +// token as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide. +// +// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed +// 128 characters and the values can’t exceed 256 characters. For these and +// additional limits, see [IAM and STS Character Limits]in the IAM User Guide. +// +// An Amazon Web Services conversion compresses the passed inline session policy, +// managed policy ARNs, and session tags into a packed binary format that has a +// separate limit. Your request can fail for this limit even if your plaintext +// meets the other requirements. The PackedPolicySize response element indicates +// by percentage how close the policies and tags for your request are to the upper +// size limit. +// +// You can pass a session tag with the same key as a tag that is attached to the +// role. When you do, the session tag overrides the role tag with the same key. +// +// An administrator must grant you the permissions necessary to pass session tags. +// The administrator can also create granular permissions to allow you to pass only +// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during role +// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide. +// +// # Identities +// +// Before your application can call AssumeRoleWithWebIdentity , you must have an +// identity token from a supported identity provider and create a role that the +// application can assume. The role that your application assumes must trust the +// identity provider that is associated with the identity token. In other words, +// the identity provider must be specified in the role's trust policy. +// +// Calling AssumeRoleWithWebIdentity can result in an entry in your CloudTrail +// logs. The entry includes the [Subject]of the provided web identity token. We recommend +// that you avoid using any personally identifiable information (PII) in this +// field. For example, you could instead use a GUID or a pairwise identifier, as [suggested in the OIDC specification]. +// +// For more information about how to use OIDC federation and the +// AssumeRoleWithWebIdentity API, see the following resources: +// +// [Using Web Identity Federation API Operations for Mobile Apps] +// - and [Federation Through a Web-based Identity Provider]. +// +// [Amazon Web Services SDK for iOS Developer Guide] +// - and [Amazon Web Services SDK for Android Developer Guide]. These toolkits contain sample apps that show how to invoke the +// identity providers. The toolkits then show how to use the information from these +// providers to get and use temporary security credentials. +// +// [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/ +// [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/ +// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length +// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html +// [Subject]: http://openid.net/specs/openid-connect-core-1_0.html#Claims +// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +// [Amazon Cognito identity pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html +// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity +// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html +// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html +// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining +// [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration +// [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html +// [suggested in the OIDC specification]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes +func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) { + if params == nil { + params = &AssumeRoleWithWebIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithWebIdentity", params, optFns, c.addOperationAssumeRoleWithWebIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeRoleWithWebIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeRoleWithWebIdentityInput struct { + + // The Amazon Resource Name (ARN) of the role that the caller is assuming. + // + // Additional considerations apply to Amazon Cognito identity pools that assume [cross-account IAM roles]. + // The trust policies of these roles must accept the cognito-identity.amazonaws.com + // service principal and must contain the cognito-identity.amazonaws.com:aud + // condition key to restrict role assumption to users from your intended identity + // pools. A policy that trusts Amazon Cognito identity pools without this condition + // creates a risk that a user from an unintended identity pool can assume the role. + // For more information, see [Trust policies for IAM roles in Basic (Classic) authentication]in the Amazon Cognito Developer Guide. + // + // [cross-account IAM roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html + // [Trust policies for IAM roles in Basic (Classic) authentication]: https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#trust-policies + // + // This member is required. + RoleArn *string + + // An identifier for the assumed role session. Typically, you pass the name or + // identifier that is associated with the user who is using your application. That + // way, the temporary security credentials that your application will use are + // associated with that user. This session name is included as part of the ARN and + // assumed role ID in the AssumedRoleUser response element. + // + // For security purposes, administrators can view this field in [CloudTrail logs] to help identify + // who performed an action in Amazon Web Services. Your administrator might require + // that you specify your user name as the session name when you assume the role. + // For more information, see [sts:RoleSessionName]sts:RoleSessionName . + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds + // [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname + // + // This member is required. + RoleSessionName *string + + // The OAuth 2.0 access token or OpenID Connect ID token that is provided by the + // identity provider. Your application must get this token by authenticating the + // user who is using your application with a web identity provider before the + // application makes an AssumeRoleWithWebIdentity call. Timestamps in the token + // must be formatted as either an integer or a long integer. Only tokens with RSA + // algorithms (RS256) are supported. + // + // This member is required. + WebIdentityToken *string + + // The duration, in seconds, of the role session. The value can range from 900 + // seconds (15 minutes) up to the maximum session duration setting for the role. + // This setting can have a value from 1 hour to 12 hours. If you specify a value + // higher than this setting, the operation fails. For example, if you specify a + // session duration of 12 hours, but your administrator set the maximum session + // duration to 6 hours, your operation fails. To learn how to view the maximum + // value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request to + // the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide. + // + // [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session + // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html + DurationSeconds *int32 + + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use the + // role's temporary credentials in subsequent Amazon Web Services API calls to + // access resources in the account that owns the role. You cannot use session + // policies to grant more permissions than those allowed by the identity-based + // policy of the role that is being assumed. For more information, see [Session Policies]in the IAM + // User Guide. + // + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. + // + // For more information about role session permissions, see [Session policies]. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + Policy *string + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to + // use as managed session policies. The policies must exist in the same account as + // the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plaintext that you use for both inline and managed session policies + // can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the + // Amazon Web Services General Reference. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's + // identity-based policy and the session policies. You can use the role's temporary + // credentials in subsequent Amazon Web Services API calls to access resources in + // the account that owns the role. You cannot use session policies to grant more + // permissions than those allowed by the identity-based policy of the role that is + // being assumed. For more information, see [Session Policies]in the IAM User Guide. + // + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + PolicyArns []types.PolicyDescriptorType + + // The fully qualified host component of the domain name of the OAuth 2.0 identity + // provider. Do not specify this value for an OpenID Connect identity provider. + // + // Currently www.amazon.com and graph.facebook.com are the only supported identity + // providers for OAuth 2.0 access tokens. Do not include URL schemes and port + // numbers. + // + // Do not specify this value for OpenID Connect ID tokens. + ProviderId *string + + noSmithyDocumentSerde +} + +// Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web +// Services credentials that can be used to make Amazon Web Services requests. +type AssumeRoleWithWebIdentityOutput struct { + + // The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers + // that you can use to refer to the resulting temporary security credentials. For + // example, you can reference these credentials as a principal in a resource-based + // policy by using the ARN or assumed role ID. The ARN and ID include the + // RoleSessionName that you specified when you called AssumeRole . + AssumedRoleUser *types.AssumedRoleUser + + // The intended audience (also known as client ID) of the web identity token. This + // is traditionally the client identifier issued to the application that requested + // the web identity token. + Audience *string + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // A percentage value that indicates the packed size of the session policies and + // session tags combined passed in the request. The request fails if the packed + // size is greater than 100 percent, which means the policies and tags exceeded the + // allowed space. + PackedPolicySize *int32 + + // The issuing authority of the web identity token presented. For OpenID Connect + // ID tokens, this contains the value of the iss field. For OAuth 2.0 access + // tokens, this contains the value of the ProviderId parameter that was passed in + // the AssumeRoleWithWebIdentity request. + Provider *string + + // The value of the source identity that is returned in the JSON web token (JWT) + // from the identity provider. + // + // You can require users to set a source identity value when they assume a role. + // You do this by using the sts:SourceIdentity condition key in a role trust + // policy. That way, actions that are taken with the role are associated with that + // user. After the source identity is set, the value cannot be changed. It is + // present in the request for all actions that are taken by the role and persists + // across [chained role]sessions. You can configure your identity provider to use an attribute + // associated with your users, like user name or email, as the source identity when + // calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON + // web token. To learn more about OIDC tokens and claims, see [Using Tokens with User Pools]in the Amazon + // Cognito Developer Guide. For more information about using source identity, see [Monitor and control actions taken with assumed roles] + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts + // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + // [Using Tokens with User Pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html + SourceIdentity *string + + // The unique user identifier that is returned by the identity provider. This + // identifier is associated with the WebIdentityToken that was submitted with the + // AssumeRoleWithWebIdentity call. The identifier is typically unique to the user + // and the application that acquired the WebIdentityToken (pairwise identifier). + // For OpenID Connect ID tokens, this field contains the value returned by the + // identity provider as the token's sub (Subject) claim. + SubjectFromWebIdentityToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithWebIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithWebIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssumeRoleWithWebIdentity", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go new file mode 100644 index 00000000..537ab875 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of short term credentials you can use to perform privileged tasks +// in a member account. +// +// Before you can launch a privileged session, you must have enabled centralized +// root access in your organization. For steps to enable this feature, see [Centralize root access for member accounts]in the +// IAM User Guide. +// +// The global endpoint is not supported for AssumeRoot. You must send this request +// to a Regional STS endpoint. For more information, see [Endpoints]. +// +// You can track AssumeRoot in CloudTrail logs to determine what actions were +// performed in a session. For more information, see [Track privileged tasks in CloudTrail]in the IAM User Guide. +// +// [Endpoints]: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html#sts-endpoints +// [Track privileged tasks in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html +// [Centralize root access for member accounts]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html +func (c *Client) AssumeRoot(ctx context.Context, params *AssumeRootInput, optFns ...func(*Options)) (*AssumeRootOutput, error) { + if params == nil { + params = &AssumeRootInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssumeRoot", params, optFns, c.addOperationAssumeRootMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssumeRootOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssumeRootInput struct { + + // The member account principal ARN or account ID. + // + // This member is required. + TargetPrincipal *string + + // The identity based policy that scopes the session to the privileged tasks that + // can be performed. You can use one of following Amazon Web Services managed + // policies to scope root session actions. You can add additional customer managed + // policies to further limit the permissions for the root session. + // + // [IAMAuditRootUserCredentials] + // + // [IAMCreateRootUserPassword] + // + // [IAMDeleteRootUserCredentials] + // + // [S3UnlockBucketPolicy] + // + // [SQSUnlockQueuePolicy] + // + // [IAMDeleteRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials + // [IAMCreateRootUserPassword]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword + // [IAMAuditRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials + // [S3UnlockBucketPolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy + // [SQSUnlockQueuePolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy + // + // This member is required. + TaskPolicyArn *types.PolicyDescriptorType + + // The duration, in seconds, of the privileged session. The value can range from 0 + // seconds up to the maximum session duration of 900 seconds (15 minutes). If you + // specify a value higher than this setting, the operation fails. + // + // By default, the value is set to 900 seconds. + DurationSeconds *int32 + + noSmithyDocumentSerde +} + +type AssumeRootOutput struct { + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // The source identity specified by the principal that is calling the AssumeRoot + // operation. + // + // You can use the aws:SourceIdentity condition key to control access based on the + // value of source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles] + // in the IAM User Guide. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html + SourceIdentity *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoot{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoot"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssumeRootValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoot(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssumeRoot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssumeRoot", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go new file mode 100644 index 00000000..a56840e1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Decodes additional information about the authorization status of a request from +// an encoded message returned in response to an Amazon Web Services request. +// +// For example, if a user is not authorized to perform an operation that he or she +// has requested, the request returns a Client.UnauthorizedOperation response (an +// HTTP 403 response). Some Amazon Web Services operations additionally return an +// encoded message that can provide details about this authorization failure. +// +// Only certain Amazon Web Services operations return an encoded authorization +// message. The documentation for an individual operation indicates whether that +// operation returns an encoded message in addition to returning an HTTP code. +// +// The message is encoded because the details of the authorization status can +// contain privileged information that the user who requested the operation should +// not see. To decode an authorization status message, a user must be granted +// permissions through an IAM [policy]to request the DecodeAuthorizationMessage ( +// sts:DecodeAuthorizationMessage ) action. +// +// The decoded message includes the following type of information: +// +// - Whether the request was denied due to an explicit deny or due to the +// absence of an explicit allow. For more information, see [Determining Whether a Request is Allowed or Denied]in the IAM User +// Guide. +// +// - The principal who made the request. +// +// - The requested action. +// +// - The requested resource. +// +// - The values of condition keys in the context of the user's request. +// +// [Determining Whether a Request is Allowed or Denied]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow +// [policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html +func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) { + if params == nil { + params = &DecodeAuthorizationMessageInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DecodeAuthorizationMessage", params, optFns, c.addOperationDecodeAuthorizationMessageMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DecodeAuthorizationMessageOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DecodeAuthorizationMessageInput struct { + + // The encoded message that was returned with the response. + // + // This member is required. + EncodedMessage *string + + noSmithyDocumentSerde +} + +// A document that contains additional information about the authorization status +// of a request from an encoded message that is returned in response to an Amazon +// Web Services request. +type DecodeAuthorizationMessageOutput struct { + + // The API returns a response with the decoded message. + DecodedMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDecodeAuthorizationMessage{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DecodeAuthorizationMessage"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DecodeAuthorizationMessage", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go new file mode 100644 index 00000000..c80b0550 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the account identifier for the specified access key ID. +// +// Access keys consist of two parts: an access key ID (for example, +// AKIAIOSFODNN7EXAMPLE ) and a secret access key (for example, +// wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). For more information about access +// keys, see [Managing Access Keys for IAM Users]in the IAM User Guide. +// +// When you pass an access key ID to this operation, it returns the ID of the +// Amazon Web Services account to which the keys belong. Access key IDs beginning +// with AKIA are long-term credentials for an IAM user or the Amazon Web Services +// account root user. Access key IDs beginning with ASIA are temporary credentials +// that are created using STS operations. If the account in the response belongs to +// you, you can sign in as the root user and review your root user access keys. +// Then, you can pull a [credentials report]to learn which IAM user owns the keys. To learn who +// requested the temporary credentials for an ASIA access key, view the STS events +// in your [CloudTrail logs]in the IAM User Guide. +// +// This operation does not indicate the state of the access key. The key might be +// active, inactive, or deleted. Active keys might not have permissions to perform +// an operation. Providing a deleted access key might return an error that the key +// doesn't exist. +// +// [credentials report]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html +// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html +// [Managing Access Keys for IAM Users]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html +func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) { + if params == nil { + params = &GetAccessKeyInfoInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessKeyInfo", params, optFns, c.addOperationGetAccessKeyInfoMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessKeyInfoOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessKeyInfoInput struct { + + // The identifier of an access key. + // + // This parameter allows (through its regex pattern) a string of characters that + // can consist of any upper- or lowercase letter or digit. + // + // This member is required. + AccessKeyId *string + + noSmithyDocumentSerde +} + +type GetAccessKeyInfoOutput struct { + + // The number used to identify the Amazon Web Services account. + Account *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetAccessKeyInfo{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessKeyInfo"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetAccessKeyInfo", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go new file mode 100644 index 00000000..49304bda --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns details about the IAM user or role whose credentials are used to call +// the operation. +// +// No permissions are required to perform this operation. If an administrator +// attaches a policy to your identity that explicitly denies access to the +// sts:GetCallerIdentity action, you can still perform this operation. Permissions +// are not required because the same information is returned when access is denied. +// To view an example response, see [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]in the IAM User Guide. +// +// [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa +func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) { + if params == nil { + params = &GetCallerIdentityInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCallerIdentity", params, optFns, c.addOperationGetCallerIdentityMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCallerIdentityOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCallerIdentityInput struct { + noSmithyDocumentSerde +} + +// Contains the response to a successful GetCallerIdentity request, including information about the +// entity making the request. +type GetCallerIdentityOutput struct { + + // The Amazon Web Services account ID number of the account that owns or contains + // the calling entity. + Account *string + + // The Amazon Web Services ARN associated with the calling entity. + Arn *string + + // The unique identifier of the calling entity. The exact value depends on the + // type of entity that is making the call. The values returned are those listed in + // the aws:userid column in the [Principal table]found on the Policy Variables reference page in + // the IAM User Guide. + // + // [Principal table]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable + UserId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetCallerIdentity{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCallerIdentity"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCallerIdentity", + } +} + +// PresignGetCallerIdentity is used to generate a presigned HTTP Request which +// contains presigned URL, signed headers and HTTP method used. +func (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { + if params == nil { + params = &GetCallerIdentityInput{} + } + options := c.options.copy() + for _, fn := range optFns { + fn(&options) + } + clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) + + result, _, err := c.client.invokeOperation(ctx, "GetCallerIdentity", params, clientOptFns, + c.client.addOperationGetCallerIdentityMiddlewares, + presignConverter(options).convertToPresignMiddleware, + ) + if err != nil { + return nil, err + } + + out := result.(*v4.PresignedHTTPRequest) + return out, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go new file mode 100644 index 00000000..e2ecc792 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go @@ -0,0 +1,396 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of temporary security credentials (consisting of an access key +// ID, a secret access key, and a security token) for a user. A typical use is in a +// proxy application that gets temporary security credentials on behalf of +// distributed applications inside a corporate network. +// +// You must call the GetFederationToken operation using the long-term security +// credentials of an IAM user. As a result, this call is appropriate in contexts +// where those credentials can be safeguarded, usually in a server-based +// application. For a comparison of GetFederationToken with the other API +// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. +// +// Although it is possible to call GetFederationToken using the security +// credentials of an Amazon Web Services account root user rather than an IAM user +// that you create for the purpose of a proxy application, we do not recommend it. +// For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in the IAM User Guide. +// +// You can create a mobile-based or browser-based app that can authenticate users +// using a web identity provider like Login with Amazon, Facebook, Google, or an +// OpenID Connect-compatible identity provider. In this case, we recommend that you +// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User +// Guide. +// +// # Session duration +// +// The temporary credentials are valid for the specified duration, from 900 +// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default +// session duration is 43,200 seconds (12 hours). Temporary credentials obtained by +// using the root user credentials have a maximum duration of 3,600 seconds (1 +// hour). +// +// # Permissions +// +// You can use the temporary credentials created by GetFederationToken in any +// Amazon Web Services service with the following exceptions: +// +// - You cannot call any IAM operations using the CLI or the Amazon Web Services +// API. This limitation does not apply to console sessions. +// +// - You cannot call any STS operations except GetCallerIdentity . +// +// You can use temporary credentials for single sign-on (SSO) to the console. +// +// You must pass an inline or managed [session policy] to this operation. You can pass a single +// JSON policy document to use as an inline session policy. You can also specify up +// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session +// policies. The plaintext that you use for both inline and managed session +// policies can't exceed 2,048 characters. +// +// Though the session policy parameters are optional, if you do not pass a policy, +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM user +// policies and the session policies that you pass. This gives you a way to further +// restrict the permissions for a federated user. You cannot use session policies +// to grant more permissions than those that are defined in the permissions policy +// of the IAM user. For more information, see [Session Policies]in the IAM User Guide. For +// information about using GetFederationToken to create temporary security +// credentials, see [GetFederationToken—Federation Through a Custom Identity Broker]. +// +// You can use the credentials to access a resource that has a resource-based +// policy. If that policy specifically references the federated user session in the +// Principal element of the policy, the session has the permissions allowed by the +// policy. These permissions are granted in addition to the permissions granted by +// the session policies. +// +// # Tags +// +// (Optional) You can pass tag key-value pairs to your session. These are called +// session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM User +// Guide. +// +// You can create a mobile-based or browser-based app that can authenticate users +// using a web identity provider like Login with Amazon, Facebook, Google, or an +// OpenID Connect-compatible identity provider. In this case, we recommend that you +// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User +// Guide. +// +// An administrator must grant you the permissions necessary to pass session tags. +// The administrator can also create granular permissions to allow you to pass only +// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide. +// +// Tag key–value pairs are not case sensitive, but case is preserved. This means +// that you cannot have separate Department and department tag keys. Assume that +// the user that you are federating has the Department = Marketing tag and you +// pass the department = engineering session tag. Department and department are +// not saved as separate tags, and the session tag passed in the request takes +// precedence over the user tag. +// +// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity +// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Amazon Cognito]: http://aws.amazon.com/cognito/ +// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session +// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// [GetFederationToken—Federation Through a Custom Identity Broker]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken +// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials +// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html +// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html +func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) { + if params == nil { + params = &GetFederationTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFederationToken", params, optFns, c.addOperationGetFederationTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFederationTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFederationTokenInput struct { + + // The name of the federated user. The name is used as an identifier for the + // temporary security credentials (such as Bob ). For example, you can reference + // the federated user name in a resource-based policy, such as in an Amazon S3 + // bucket policy. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@- + // + // This member is required. + Name *string + + // The duration, in seconds, that the session should last. Acceptable durations + // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds + // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained + // using root user credentials are restricted to a maximum of 3,600 seconds (one + // hour). If the specified duration is longer than one hour, the session obtained + // by using root user credentials defaults to one hour. + DurationSeconds *int32 + + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // You must pass an inline or managed [session policy] to this operation. You can pass a single + // JSON policy document to use as an inline session policy. You can also specify up + // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session + // policies. + // + // This parameter is optional. However, if you do not pass any session policies, + // then the resulting federated user session has no permissions. + // + // When you pass session policies, the session permissions are the intersection of + // the IAM user policies and the session policies that you pass. This gives you a + // way to further restrict the permissions for a federated user. You cannot use + // session policies to grant more permissions than those that are defined in the + // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User + // Guide. + // + // The resulting credentials can be used to access a resource that has a + // resource-based policy. If that policy specifically references the federated user + // session in the Principal element of the policy, the session has the permissions + // allowed by the policy. These permissions are granted in addition to the + // permissions that are granted by the session policies. + // + // The plaintext that you use for both inline and managed session policies can't + // exceed 2,048 characters. The JSON policy characters can be any ASCII character + // from the space character to the end of the valid character list (\u0020 through + // \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage + // return (\u000D) characters. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + Policy *string + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want to + // use as a managed session policy. The policies must exist in the same account as + // the IAM user that is requesting federated access. + // + // You must pass an inline or managed [session policy] to this operation. You can pass a single + // JSON policy document to use as an inline session policy. You can also specify up + // to 10 managed policy Amazon Resource Names (ARNs) to use as managed session + // policies. The plaintext that you use for both inline and managed session + // policies can't exceed 2,048 characters. You can provide up to 10 managed policy + // ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General + // Reference. + // + // This parameter is optional. However, if you do not pass any session policies, + // then the resulting federated user session has no permissions. + // + // When you pass session policies, the session permissions are the intersection of + // the IAM user policies and the session policies that you pass. This gives you a + // way to further restrict the permissions for a federated user. You cannot use + // session policies to grant more permissions than those that are defined in the + // permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User + // Guide. + // + // The resulting credentials can be used to access a resource that has a + // resource-based policy. If that policy specifically references the federated user + // session in the Principal element of the policy, the session has the permissions + // allowed by the policy. These permissions are granted in addition to the + // permissions that are granted by the session policies. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + PolicyArns []types.PolicyDescriptorType + + // A list of session tags. Each session tag consists of a key name and an + // associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User + // Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plaintext + // session tag keys can’t exceed 128 characters and the values can’t exceed 256 + // characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide. + // + // An Amazon Web Services conversion compresses the passed inline session policy, + // managed policy ARNs, and session tags into a packed binary format that has a + // separate limit. Your request can fail for this limit even if your plaintext + // meets the other requirements. The PackedPolicySize response element indicates + // by percentage how close the policies and tags for your request are to the upper + // size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the user you are federating. When you do, session tags override a user tag + // with the same key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This means + // that you cannot have separate Department and department tag keys. Assume that + // the role has the Department = Marketing tag and you pass the department = + // engineering session tag. Department and department are not saved as separate + // tags, and the session tag passed in the request takes precedence over the role + // tag. + // + // [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html + // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + Tags []types.Tag + + noSmithyDocumentSerde +} + +// Contains the response to a successful GetFederationToken request, including temporary Amazon Web +// Services credentials that can be used to make Amazon Web Services requests. +type GetFederationTokenOutput struct { + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // Identifiers for the federated user associated with the credentials (such as + // arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use + // the federated user's ARN in your resource-based policies, such as an Amazon S3 + // bucket policy. + FederatedUser *types.FederatedUser + + // A percentage value that indicates the packed size of the session policies and + // session tags combined passed in the request. The request fails if the packed + // size is greater than 100 percent, which means the policies and tags exceeded the + // allowed space. + PackedPolicySize *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetFederationToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetFederationToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetFederationToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go new file mode 100644 index 00000000..fdc45111 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go @@ -0,0 +1,242 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a set of temporary credentials for an Amazon Web Services account or +// IAM user. The credentials consist of an access key ID, a secret access key, and +// a security token. Typically, you use GetSessionToken if you want to use MFA to +// protect programmatic calls to specific Amazon Web Services API operations like +// Amazon EC2 StopInstances . +// +// MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is +// associated with their MFA device. Using the temporary security credentials that +// the call returns, IAM users can then make programmatic calls to API operations +// that require MFA authentication. An incorrect MFA code causes the API to return +// an access denied error. For a comparison of GetSessionToken with the other API +// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide. +// +// No permissions are required for users to perform this operation. The purpose of +// the sts:GetSessionToken operation is to authenticate the user using MFA. You +// cannot use policies to control authentication operations. For more information, +// see [Permissions for GetSessionToken]in the IAM User Guide. +// +// # Session Duration +// +// The GetSessionToken operation must be called by using the long-term Amazon Web +// Services security credentials of an IAM user. Credentials that are created by +// IAM users are valid for the duration that you specify. This duration can range +// from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours), +// with a default of 43,200 seconds (12 hours). Credentials based on account +// credentials can range from 900 seconds (15 minutes) up to 3,600 seconds (1 +// hour), with a default of 1 hour. +// +// # Permissions +// +// The temporary security credentials created by GetSessionToken can be used to +// make API calls to any Amazon Web Services service with the following exceptions: +// +// - You cannot call any IAM API operations unless MFA authentication +// information is included in the request. +// +// - You cannot call any STS API except AssumeRole or GetCallerIdentity . +// +// The credentials that GetSessionToken returns are based on permissions +// associated with the IAM user whose credentials were used to call the operation. +// The temporary credentials have the same permissions as the IAM user. +// +// Although it is possible to call GetSessionToken using the security credentials +// of an Amazon Web Services account root user rather than an IAM user, we do not +// recommend it. If GetSessionToken is called using root user credentials, the +// temporary credentials have root user permissions. For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in +// the IAM User Guide +// +// For more information about using GetSessionToken to create temporary +// credentials, see [Temporary Credentials for Users in Untrusted Environments]in the IAM User Guide. +// +// [Permissions for GetSessionToken]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html +// [Temporary Credentials for Users in Untrusted Environments]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken +// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials +// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html +// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html +func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) { + if params == nil { + params = &GetSessionTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSessionToken", params, optFns, c.addOperationGetSessionTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSessionTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSessionTokenInput struct { + + // The duration, in seconds, that the credentials should remain valid. Acceptable + // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600 + // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions for + // Amazon Web Services account owners are restricted to a maximum of 3,600 seconds + // (one hour). If the duration is longer than one hour, the session for Amazon Web + // Services account owners defaults to one hour. + DurationSeconds *int32 + + // The identification number of the MFA device that is associated with the IAM + // user who is making the GetSessionToken call. Specify this value if the IAM user + // has a policy that requires MFA authentication. The value is either the serial + // number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name + // (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You + // can find the device for an IAM user by going to the Amazon Web Services + // Management Console and viewing the user's security credentials. + // + // The regex used to validate this parameter is a string of characters consisting + // of upper- and lower-case alphanumeric characters with no spaces. You can also + // include underscores or any of the following characters: =,.@:/- + SerialNumber *string + + // The value provided by the MFA device, if MFA is required. If any policy + // requires the IAM user to submit an MFA code, specify this value. If MFA + // authentication is required, the user must provide a code when requesting a set + // of temporary security credentials. A user who fails to provide the code receives + // an "access denied" response when requesting resources that require MFA + // authentication. + // + // The format for this parameter, as described by its regex pattern, is a sequence + // of six numeric digits. + TokenCode *string + + noSmithyDocumentSerde +} + +// Contains the response to a successful GetSessionToken request, including temporary Amazon Web +// Services credentials that can be used to make Amazon Web Services requests. +type GetSessionTokenOutput struct { + + // The temporary security credentials, which include an access key ID, a secret + // access key, and a security (or session) token. + // + // The size of the security token that STS API operations return is not fixed. We + // strongly recommend that you make no assumptions about the maximum size. + Credentials *types.Credentials + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSessionToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetSessionToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetSessionToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go new file mode 100644 index 00000000..a90b2b73 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go @@ -0,0 +1,325 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, + + "AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "sts") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go new file mode 100644 index 00000000..59349890 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -0,0 +1,2719 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "bytes" + "context" + "encoding/xml" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + smithy "github.com/aws/smithy-go" + smithyxml "github.com/aws/smithy-go/encoding/xml" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsAwsquery_deserializeOpAssumeRole struct { +} + +func (*awsAwsquery_deserializeOpAssumeRole) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAssumeRole) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAssumeRole(response, &metadata) + } + output := &AssumeRoleOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AssumeRoleResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAssumeRoleOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAssumeRole(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocument", errorCode): + return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PackedPolicyTooLarge", errorCode): + return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAssumeRoleWithSAML struct { +} + +func (*awsAwsquery_deserializeOpAssumeRoleWithSAML) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response, &metadata) + } + output := &AssumeRoleWithSAMLOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AssumeRoleWithSAMLResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("IDPRejectedClaim", errorCode): + return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) + + case strings.EqualFold("InvalidIdentityToken", errorCode): + return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocument", errorCode): + return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PackedPolicyTooLarge", errorCode): + return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAssumeRoleWithWebIdentity struct { +} + +func (*awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response, &metadata) + } + output := &AssumeRoleWithWebIdentityOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AssumeRoleWithWebIdentityResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("IDPCommunicationError", errorCode): + return awsAwsquery_deserializeErrorIDPCommunicationErrorException(response, errorBody) + + case strings.EqualFold("IDPRejectedClaim", errorCode): + return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody) + + case strings.EqualFold("InvalidIdentityToken", errorCode): + return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocument", errorCode): + return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PackedPolicyTooLarge", errorCode): + return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpAssumeRoot struct { +} + +func (*awsAwsquery_deserializeOpAssumeRoot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpAssumeRoot) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorAssumeRoot(response, &metadata) + } + output := &AssumeRootOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("AssumeRootResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentAssumeRootOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorAssumeRoot(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExpiredTokenException", errorCode): + return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpDecodeAuthorizationMessage struct { +} + +func (*awsAwsquery_deserializeOpDecodeAuthorizationMessage) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response, &metadata) + } + output := &DecodeAuthorizationMessageOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("DecodeAuthorizationMessageResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidAuthorizationMessageException", errorCode): + return awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetAccessKeyInfo struct { +} + +func (*awsAwsquery_deserializeOpGetAccessKeyInfo) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response, &metadata) + } + output := &GetAccessKeyInfoOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetAccessKeyInfoResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetAccessKeyInfo(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetCallerIdentity struct { +} + +func (*awsAwsquery_deserializeOpGetCallerIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetCallerIdentity) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorGetCallerIdentity(response, &metadata) + } + output := &GetCallerIdentityOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetCallerIdentityResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetCallerIdentity(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetFederationToken struct { +} + +func (*awsAwsquery_deserializeOpGetFederationToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetFederationToken) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorGetFederationToken(response, &metadata) + } + output := &GetFederationTokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetFederationTokenResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetFederationToken(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("MalformedPolicyDocument", errorCode): + return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PackedPolicyTooLarge", errorCode): + return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsquery_deserializeOpGetSessionToken struct { +} + +func (*awsAwsquery_deserializeOpGetSessionToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetSessionToken) 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + 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, awsAwsquery_deserializeOpErrorGetSessionToken(response, &metadata) + } + output := &GetSessionTokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetSessionTokenResult") + 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 out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(&output, 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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetSessionToken(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 + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExpiredTokenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentExpiredTokenException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IDPCommunicationErrorException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IDPRejectedClaimException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidAuthorizationMessageException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidIdentityTokenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MalformedPolicyDocumentException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PackedPolicyTooLargeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RegionDisabledException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRegionDisabledException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AssumedRoleUser + if *v == nil { + sv = &types.AssumedRoleUser{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Arn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Arn = ptr.String(xtv) + } + + case strings.EqualFold("AssumedRoleId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AssumedRoleId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Credentials + if *v == nil { + sv = &types.Credentials{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AccessKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Expiration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Expiration = ptr.Time(t) + } + + case strings.EqualFold("SecretAccessKey", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretAccessKey = ptr.String(xtv) + } + + case strings.EqualFold("SessionToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExpiredTokenException + if *v == nil { + sv = &types.ExpiredTokenException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.FederatedUser + if *v == nil { + sv = &types.FederatedUser{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Arn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Arn = ptr.String(xtv) + } + + case strings.EqualFold("FederatedUserId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.FederatedUserId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IDPCommunicationErrorException + if *v == nil { + sv = &types.IDPCommunicationErrorException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IDPRejectedClaimException + if *v == nil { + sv = &types.IDPRejectedClaimException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidAuthorizationMessageException + if *v == nil { + sv = &types.InvalidAuthorizationMessageException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidIdentityTokenException + if *v == nil { + sv = &types.InvalidIdentityTokenException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.MalformedPolicyDocumentException + if *v == nil { + sv = &types.MalformedPolicyDocumentException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.PackedPolicyTooLargeException + if *v == nil { + sv = &types.PackedPolicyTooLargeException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.RegionDisabledException + if *v == nil { + sv = &types.RegionDisabledException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssumeRoleOutput + if *v == nil { + sv = &AssumeRoleOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AssumedRoleUser", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PackedPolicySize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PackedPolicySize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWithSAMLOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssumeRoleWithSAMLOutput + if *v == nil { + sv = &AssumeRoleWithSAMLOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AssumedRoleUser", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Audience", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Audience = ptr.String(xtv) + } + + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Issuer", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Issuer = ptr.String(xtv) + } + + case strings.EqualFold("NameQualifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NameQualifier = ptr.String(xtv) + } + + case strings.EqualFold("PackedPolicySize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PackedPolicySize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + + case strings.EqualFold("Subject", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Subject = ptr.String(xtv) + } + + case strings.EqualFold("SubjectType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubjectType = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **AssumeRoleWithWebIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssumeRoleWithWebIdentityOutput + if *v == nil { + sv = &AssumeRoleWithWebIdentityOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AssumedRoleUser", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Audience", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Audience = ptr.String(xtv) + } + + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PackedPolicySize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PackedPolicySize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Provider", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Provider = ptr.String(xtv) + } + + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + + case strings.EqualFold("SubjectFromWebIdentityToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubjectFromWebIdentityToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentAssumeRootOutput(v **AssumeRootOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *AssumeRootOutput + if *v == nil { + sv = &AssumeRootOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SourceIdentity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SourceIdentity = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(v **DecodeAuthorizationMessageOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DecodeAuthorizationMessageOutput + if *v == nil { + sv = &DecodeAuthorizationMessageOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DecodedMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DecodedMessage = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(v **GetAccessKeyInfoOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetAccessKeyInfoOutput + if *v == nil { + sv = &GetAccessKeyInfoOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Account", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Account = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(v **GetCallerIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCallerIdentityOutput + if *v == nil { + sv = &GetCallerIdentityOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Account", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Account = ptr.String(xtv) + } + + case strings.EqualFold("Arn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Arn = ptr.String(xtv) + } + + case strings.EqualFold("UserId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederationTokenOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetFederationTokenOutput + if *v == nil { + sv = &GetFederationTokenOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("FederatedUser", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentFederatedUser(&sv.FederatedUser, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PackedPolicySize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PackedPolicySize = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetSessionTokenOutput + if *v == nil { + sv = &GetSessionTokenOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go new file mode 100644 index 00000000..cbb19c7f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go @@ -0,0 +1,13 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package sts provides the API client, operations, and parameter types for AWS +// Security Token Service. +// +// # Security Token Service +// +// Security Token Service (STS) enables you to request temporary, +// limited-privilege credentials for users. This guide provides descriptions of the +// STS API. For more information about using this service, see [Temporary Security Credentials]. +// +// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html +package sts diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go new file mode 100644 index 00000000..dca2ce35 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -0,0 +1,1136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "sts" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_STS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "STS", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string + + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // Whether the global endpoint should be used, rather then the regional endpoint + // for us-east-1. + // + // Defaults to false if no value is + // provided. + // + // AWS::STS::UseGlobalEndpoint + UseGlobalEndpoint *bool +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + if p.UseGlobalEndpoint == nil { + return fmt.Errorf("parameter UseGlobalEndpoint is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + + if p.UseGlobalEndpoint == nil { + p.UseGlobalEndpoint = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _UseFIPS := *params.UseFIPS + _UseGlobalEndpoint := *params.UseGlobalEndpoint + + if _UseGlobalEndpoint == true { + if !(params.Endpoint != nil) { + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == false { + if _UseDualStack == false { + if _Region == "ap-northeast-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-south-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-southeast-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ap-southeast-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "aws-global" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "ca-central-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-central-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-north-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "eu-west-3" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "sa-east-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-east-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-east-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-west-1" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + if _Region == "us-west-2" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, _Region) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + } + } + } + } + } + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _PartitionResult.SupportsFIPS == true { + if _PartitionResult.Name == "aws-us-gov" { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + if _Region == "aws-global" { + uriString := "https://sts.amazonaws.com" + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningName(&sp, "sts") + smithyhttp.SetSigV4ASigningName(&sp, "sts") + + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://sts.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.Region = bindRegion(options.Region) + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json new file mode 100644 index 00000000..70a88452 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json @@ -0,0 +1,42 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5", + "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_AssumeRole.go", + "api_op_AssumeRoleWithSAML.go", + "api_op_AssumeRoleWithWebIdentity.go", + "api_op_AssumeRoot.go", + "api_op_DecodeAuthorizationMessage.go", + "api_op_GetAccessKeyInfo.go", + "api_op_GetCallerIdentity.go", + "api_op_GetFederationToken.go", + "api_op_GetSessionToken.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/sts", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go new file mode 100644 index 00000000..c55eca63 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package sts + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.33.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go new file mode 100644 index 00000000..9fe930b8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go @@ -0,0 +1,515 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver STS endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "aws-global", + }: endpoints.Endpoint{ + Hostname: "sts.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "sts-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-east-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-2-fips", + }: endpoints.Endpoint{ + Hostname: "sts-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "sts-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Hostname: "sts-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-iso-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "sts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "sts.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "sts.us-gov-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "sts.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + }, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go new file mode 100644 index 00000000..e1398f3b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go new file mode 100644 index 00000000..96b22213 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go @@ -0,0 +1,1005 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/query" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsquery_serializeOpAssumeRole struct { +} + +func (*awsAwsquery_serializeOpAssumeRole) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeRoleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AssumeRole") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentAssumeRoleInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAssumeRoleWithSAML struct { +} + +func (*awsAwsquery_serializeOpAssumeRoleWithSAML) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeRoleWithSAMLInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AssumeRoleWithSAML") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAssumeRoleWithWebIdentity struct { +} + +func (*awsAwsquery_serializeOpAssumeRoleWithWebIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AssumeRoleWithWebIdentity") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpAssumeRoot struct { +} + +func (*awsAwsquery_serializeOpAssumeRoot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpAssumeRoot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssumeRootInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("AssumeRoot") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentAssumeRootInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpDecodeAuthorizationMessage struct { +} + +func (*awsAwsquery_serializeOpDecodeAuthorizationMessage) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DecodeAuthorizationMessageInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DecodeAuthorizationMessage") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpGetAccessKeyInfo struct { +} + +func (*awsAwsquery_serializeOpGetAccessKeyInfo) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAccessKeyInfoInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetAccessKeyInfo") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpGetCallerIdentity struct { +} + +func (*awsAwsquery_serializeOpGetCallerIdentity) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCallerIdentityInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetCallerIdentity") + body.Key("Version").String("2011-06-15") + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpGetFederationToken struct { +} + +func (*awsAwsquery_serializeOpGetFederationToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetFederationTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetFederationToken") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentGetFederationTokenInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsquery_serializeOpGetSessionToken struct { +} + +func (*awsAwsquery_serializeOpGetSessionToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSessionTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetSessionToken") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentGetSessionTokenInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentPolicyDescriptorType(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptorType, value query.Value) error { + object := value.Object() + _ = object + + if v.Arn != nil { + objectKey := object.Key("arn") + objectKey.String(*v.Arn) + } + + return nil +} + +func awsAwsquery_serializeDocumentProvidedContext(v *types.ProvidedContext, value query.Value) error { + object := value.Object() + _ = object + + if v.ContextAssertion != nil { + objectKey := object.Key("ContextAssertion") + objectKey.String(*v.ContextAssertion) + } + + if v.ProviderArn != nil { + objectKey := object.Key("ProviderArn") + objectKey.String(*v.ProviderArn) + } + + return nil +} + +func awsAwsquery_serializeDocumentProvidedContextsListType(v []types.ProvidedContext, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentProvidedContext(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error { + object := value.Object() + _ = object + + if v.Key != nil { + objectKey := object.Key("Key") + objectKey.String(*v.Key) + } + + if v.Value != nil { + objectKey := object.Key("Value") + objectKey.String(*v.Value) + } + + return nil +} + +func awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.ExternalId != nil { + objectKey := object.Key("ExternalId") + objectKey.String(*v.ExternalId) + } + + if v.Policy != nil { + objectKey := object.Key("Policy") + objectKey.String(*v.Policy) + } + + if v.PolicyArns != nil { + objectKey := object.Key("PolicyArns") + if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { + return err + } + } + + if v.ProvidedContexts != nil { + objectKey := object.Key("ProvidedContexts") + if err := awsAwsquery_serializeDocumentProvidedContextsListType(v.ProvidedContexts, objectKey); err != nil { + return err + } + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + if v.RoleSessionName != nil { + objectKey := object.Key("RoleSessionName") + objectKey.String(*v.RoleSessionName) + } + + if v.SerialNumber != nil { + objectKey := object.Key("SerialNumber") + objectKey.String(*v.SerialNumber) + } + + if v.SourceIdentity != nil { + objectKey := object.Key("SourceIdentity") + objectKey.String(*v.SourceIdentity) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { + return err + } + } + + if v.TokenCode != nil { + objectKey := object.Key("TokenCode") + objectKey.String(*v.TokenCode) + } + + if v.TransitiveTagKeys != nil { + objectKey := object.Key("TransitiveTagKeys") + if err := awsAwsquery_serializeDocumentTagKeyListType(v.TransitiveTagKeys, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.Policy != nil { + objectKey := object.Key("Policy") + objectKey.String(*v.Policy) + } + + if v.PolicyArns != nil { + objectKey := object.Key("PolicyArns") + if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { + return err + } + } + + if v.PrincipalArn != nil { + objectKey := object.Key("PrincipalArn") + objectKey.String(*v.PrincipalArn) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + if v.SAMLAssertion != nil { + objectKey := object.Key("SAMLAssertion") + objectKey.String(*v.SAMLAssertion) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.Policy != nil { + objectKey := object.Key("Policy") + objectKey.String(*v.Policy) + } + + if v.PolicyArns != nil { + objectKey := object.Key("PolicyArns") + if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { + return err + } + } + + if v.ProviderId != nil { + objectKey := object.Key("ProviderId") + objectKey.String(*v.ProviderId) + } + + if v.RoleArn != nil { + objectKey := object.Key("RoleArn") + objectKey.String(*v.RoleArn) + } + + if v.RoleSessionName != nil { + objectKey := object.Key("RoleSessionName") + objectKey.String(*v.RoleSessionName) + } + + if v.WebIdentityToken != nil { + objectKey := object.Key("WebIdentityToken") + objectKey.String(*v.WebIdentityToken) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentAssumeRootInput(v *AssumeRootInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.TargetPrincipal != nil { + objectKey := object.Key("TargetPrincipal") + objectKey.String(*v.TargetPrincipal) + } + + if v.TaskPolicyArn != nil { + objectKey := object.Key("TaskPolicyArn") + if err := awsAwsquery_serializeDocumentPolicyDescriptorType(v.TaskPolicyArn, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput, value query.Value) error { + object := value.Object() + _ = object + + if v.EncodedMessage != nil { + objectKey := object.Key("EncodedMessage") + objectKey.String(*v.EncodedMessage) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(v *GetAccessKeyInfoInput, value query.Value) error { + object := value.Object() + _ = object + + if v.AccessKeyId != nil { + objectKey := object.Key("AccessKeyId") + objectKey.String(*v.AccessKeyId) + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetCallerIdentityInput(v *GetCallerIdentityInput, value query.Value) error { + object := value.Object() + _ = object + + return nil +} + +func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationTokenInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.Name != nil { + objectKey := object.Key("Name") + objectKey.String(*v.Name) + } + + if v.Policy != nil { + objectKey := object.Key("Policy") + objectKey.String(*v.Policy) + } + + if v.PolicyArns != nil { + objectKey := object.Key("PolicyArns") + if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil { + return err + } + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} + +func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.SerialNumber != nil { + objectKey := object.Key("SerialNumber") + objectKey.String(*v.SerialNumber) + } + + if v.TokenCode != nil { + objectKey := object.Key("TokenCode") + objectKey.String(*v.TokenCode) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go new file mode 100644 index 00000000..041629bb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go @@ -0,0 +1,248 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The web identity token that was passed is expired or is not valid. Get a new +// identity token from the identity provider and then retry the request. +type ExpiredTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ExpiredTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExpiredTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExpiredTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTokenException" + } + return *e.ErrorCodeOverride +} +func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request could not be fulfilled because the identity provider (IDP) that was +// asked to verify the incoming identity token could not be reached. This is often +// a transient error caused by network conditions. Retry the request a limited +// number of times so that you don't exceed the request rate. If the error +// persists, the identity provider might be down or not responding. +type IDPCommunicationErrorException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IDPCommunicationErrorException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IDPCommunicationErrorException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IDPCommunicationErrorException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IDPCommunicationError" + } + return *e.ErrorCodeOverride +} +func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The identity provider (IdP) reported that authentication failed. This might be +// because the claim is invalid. +// +// If this error is returned for the AssumeRoleWithWebIdentity operation, it can +// also mean that the claim has expired or has been explicitly revoked. +type IDPRejectedClaimException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *IDPRejectedClaimException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *IDPRejectedClaimException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *IDPRejectedClaimException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "IDPRejectedClaim" + } + return *e.ErrorCodeOverride +} +func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The error returned if the message passed to DecodeAuthorizationMessage was +// invalid. This can happen if the token contains invalid characters, such as line +// breaks, or if the message has expired. +type InvalidAuthorizationMessageException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidAuthorizationMessageException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidAuthorizationMessageException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidAuthorizationMessageException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidAuthorizationMessageException" + } + return *e.ErrorCodeOverride +} +func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + +// The web identity token that was passed could not be validated by Amazon Web +// Services. Get a new identity token from the identity provider and then retry the +// request. +type InvalidIdentityTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidIdentityTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidIdentityTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidIdentityTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidIdentityToken" + } + return *e.ErrorCodeOverride +} +func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected because the policy document was malformed. The error +// message describes the specific error. +type MalformedPolicyDocumentException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MalformedPolicyDocumentException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MalformedPolicyDocumentException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MalformedPolicyDocumentException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MalformedPolicyDocument" + } + return *e.ErrorCodeOverride +} +func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An Amazon Web Services conversion +// compresses the session policy document, session policy ARNs, and session tags +// into a packed binary format that has a separate limit. The error message +// indicates by percentage how close the policies and tags are to the upper size +// limit. For more information, see [Passing Session Tags in STS]in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see [IAM and STS Entity Character Limits]in the IAM User Guide. +// +// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +// [IAM and STS Entity Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length +type PackedPolicyTooLargeException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *PackedPolicyTooLargeException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *PackedPolicyTooLargeException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *PackedPolicyTooLargeException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "PackedPolicyTooLarge" + } + return *e.ErrorCodeOverride +} +func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// STS is not activated in the requested region for the account that is being +// asked to generate credentials. The account administrator must use the IAM +// console to activate STS in that region. For more information, see [Activating and Deactivating STS in an Amazon Web Services Region]in the IAM +// User Guide. +// +// [Activating and Deactivating STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html +type RegionDisabledException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *RegionDisabledException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *RegionDisabledException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *RegionDisabledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "RegionDisabledException" + } + return *e.ErrorCodeOverride +} +func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go new file mode 100644 index 00000000..dff7a3c2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// The identifiers for the temporary security credentials that the operation +// returns. +type AssumedRoleUser struct { + + // The ARN of the temporary security credentials that are returned from the AssumeRole + // action. For more information about ARNs and how to use them in policies, see [IAM Identifiers]in + // the IAM User Guide. + // + // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html + // + // This member is required. + Arn *string + + // A unique identifier that contains the role ID and the role session name of the + // role that is being assumed. The role ID is generated by Amazon Web Services when + // the role is created. + // + // This member is required. + AssumedRoleId *string + + noSmithyDocumentSerde +} + +// Amazon Web Services credentials for API authentication. +type Credentials struct { + + // The access key ID that identifies the temporary security credentials. + // + // This member is required. + AccessKeyId *string + + // The date on which the current credentials expire. + // + // This member is required. + Expiration *time.Time + + // The secret access key that can be used to sign requests. + // + // This member is required. + SecretAccessKey *string + + // The token that users must pass to the service API to use the temporary + // credentials. + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +// Identifiers for the federated user that is associated with the credentials. +type FederatedUser struct { + + // The ARN that specifies the federated user that is associated with the + // credentials. For more information about ARNs and how to use them in policies, + // see [IAM Identifiers]in the IAM User Guide. + // + // [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html + // + // This member is required. + Arn *string + + // The string that identifies the federated user associated with the credentials, + // similar to the unique ID of an IAM user. + // + // This member is required. + FederatedUserId *string + + noSmithyDocumentSerde +} + +// A reference to the IAM managed policy that is passed as a session policy for a +// role session or a federated user session. +type PolicyDescriptorType struct { + + // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session + // policy for the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web + // Services General Reference. + // + // [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html + Arn *string + + noSmithyDocumentSerde +} + +// Contains information about the provided context. This includes the signed and +// encrypted trusted context assertion and the context provider ARN from which the +// trusted context assertion was generated. +type ProvidedContext struct { + + // The signed and encrypted trusted context assertion generated by the context + // provider. The trusted context assertion is signed and encrypted by Amazon Web + // Services STS. + ContextAssertion *string + + // The context provider ARN from which the trusted context assertion was generated. + ProviderArn *string + + noSmithyDocumentSerde +} + +// You can pass custom key-value pair attributes when you assume a role or +// federate a user. These are called session tags. You can then use the session +// tags to control access to resources. For more information, see [Tagging Amazon Web Services STS Sessions]in the IAM User +// Guide. +// +// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html +type Tag struct { + + // The key for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag keys can’t + // exceed 128 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User + // Guide. + // + // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // + // This member is required. + Key *string + + // The value for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag values can’t + // exceed 256 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User + // Guide. + // + // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go new file mode 100644 index 00000000..1026e221 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go @@ -0,0 +1,347 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssumeRole struct { +} + +func (*validateOpAssumeRole) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeRoleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeRoleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssumeRoleWithSAML struct { +} + +func (*validateOpAssumeRoleWithSAML) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeRoleWithSAML) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeRoleWithSAMLInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeRoleWithSAMLInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssumeRoleWithWebIdentity struct { +} + +func (*validateOpAssumeRoleWithWebIdentity) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeRoleWithWebIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeRoleWithWebIdentityInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssumeRoot struct { +} + +func (*validateOpAssumeRoot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssumeRoot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssumeRootInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssumeRootInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDecodeAuthorizationMessage struct { +} + +func (*validateOpDecodeAuthorizationMessage) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDecodeAuthorizationMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DecodeAuthorizationMessageInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDecodeAuthorizationMessageInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAccessKeyInfo struct { +} + +func (*validateOpGetAccessKeyInfo) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessKeyInfo) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessKeyInfoInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessKeyInfoInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetFederationToken struct { +} + +func (*validateOpGetFederationToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFederationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFederationTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFederationTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssumeRoleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeRole{}, middleware.After) +} + +func addOpAssumeRoleWithSAMLValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeRoleWithSAML{}, middleware.After) +} + +func addOpAssumeRoleWithWebIdentityValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeRoleWithWebIdentity{}, middleware.After) +} + +func addOpAssumeRootValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssumeRoot{}, middleware.After) +} + +func addOpDecodeAuthorizationMessageValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDecodeAuthorizationMessage{}, middleware.After) +} + +func addOpGetAccessKeyInfoValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessKeyInfo{}, middleware.After) +} + +func addOpGetFederationTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFederationToken{}, middleware.After) +} + +func validateTag(v *types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Tag"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTagListType(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagListType"} + for i := range v { + if err := validateTag(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssumeRoleInput(v *AssumeRoleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleInput"} + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.RoleSessionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName")) + } + if v.Tags != nil { + if err := validateTagListType(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithSAMLInput"} + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.PrincipalArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn")) + } + if v.SAMLAssertion == nil { + invalidParams.Add(smithy.NewErrParamRequired("SAMLAssertion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithWebIdentityInput"} + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.RoleSessionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName")) + } + if v.WebIdentityToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("WebIdentityToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssumeRootInput(v *AssumeRootInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssumeRootInput"} + if v.TargetPrincipal == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetPrincipal")) + } + if v.TaskPolicyArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaskPolicyArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DecodeAuthorizationMessageInput"} + if v.EncodedMessage == nil { + invalidParams.Add(smithy.NewErrParamRequired("EncodedMessage")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAccessKeyInfoInput(v *GetAccessKeyInfoInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessKeyInfoInput"} + if v.AccessKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFederationTokenInput(v *GetFederationTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFederationTokenInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Tags != nil { + if err := validateTagListType(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/smithy-go/.gitignore b/vendor/github.com/aws/smithy-go/.gitignore index c92d6105..2518b349 100644 --- a/vendor/github.com/aws/smithy-go/.gitignore +++ b/vendor/github.com/aws/smithy-go/.gitignore @@ -24,3 +24,6 @@ build/ # VS Code bin/ .vscode/ + +# make +c.out diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 9cca07b5..56b19e3a 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,91 @@ +# Release (2024-11-15) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.22.1 + * **Bug Fix**: Fix failure to replace URI path segments when their names overlap. + +# Release (2024-10-03) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.22.0 + * **Feature**: Add HTTP client metrics. + +# Release (2024-09-25) + +## Module Highlights +* `github.com/aws/smithy-go/aws-http-auth`: [v1.0.0](aws-http-auth/CHANGELOG.md#v100-2024-09-25) + * **Release**: Initial release of module aws-http-auth, which implements generically consumable SigV4 and SigV4a request signing. + +# Release (2024-09-19) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.21.0 + * **Feature**: Add tracing and metrics APIs, and builtin instrumentation for both, in generated clients. +* `github.com/aws/smithy-go/metrics/smithyotelmetrics`: [v1.0.0](metrics/smithyotelmetrics/CHANGELOG.md#v100-2024-09-19) + * **Release**: Initial release of `smithyotelmetrics` module, which is used to adapt an OpenTelemetry SDK meter provider to be used with Smithy clients. +* `github.com/aws/smithy-go/tracing/smithyoteltracing`: [v1.0.0](tracing/smithyoteltracing/CHANGELOG.md#v100-2024-09-19) + * **Release**: Initial release of `smithyoteltracing` module, which is used to adapt an OpenTelemetry SDK tracer provider to be used with Smithy clients. + +# Release (2024-08-14) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.20.4 + * **Dependency Update**: Bump minimum Go version to 1.21. + +# Release (2024-06-27) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.20.3 + * **Bug Fix**: Fix encoding/cbor test overflow on x86. + +# Release (2024-03-29) + +* No change notes available for this release. + +# Release (2024-02-21) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.20.1 + * **Bug Fix**: Remove runtime dependency on go-cmp. + +# Release (2024-02-13) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.20.0 + * **Feature**: Add codegen definition for sigv4a trait. + * **Feature**: Bump minimum Go version to 1.20 per our language support policy. + +# Release (2023-12-07) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.19.0 + * **Feature**: Support modeled request compression. + +# Release (2023-11-30) + +* No change notes available for this release. + +# Release (2023-11-29) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.18.0 + * **Feature**: Expose Options() method on generated service clients. + +# Release (2023-11-15) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.17.0 + * **Feature**: Support identity/auth components of client reference architecture. + # Release (2023-10-31) ## Module Highlights diff --git a/vendor/github.com/aws/smithy-go/Makefile b/vendor/github.com/aws/smithy-go/Makefile index 4b3c2093..e66fa8ca 100644 --- a/vendor/github.com/aws/smithy-go/Makefile +++ b/vendor/github.com/aws/smithy-go/Makefile @@ -33,13 +33,18 @@ smithy-clean: ################## # Linting/Verify # ################## -.PHONY: verify vet +.PHONY: verify vet cover verify: vet vet: go vet ${BUILD_TAGS} --all ./... +cover: + go test ${BUILD_TAGS} -coverprofile c.out ./... + @cover=`go tool cover -func c.out | grep '^total:' | awk '{ print $$3+0 }'`; \ + echo "total (statements): $$cover%"; + ################ # Unit Testing # ################ diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index c374f692..08df7458 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -1,19 +1,21 @@ -## Smithy Go +# Smithy Go [![Go Build Status](https://github.com/aws/smithy-go/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/go.yml)[![Codegen Build Status](https://github.com/aws/smithy-go/actions/workflows/codegen.yml/badge.svg?branch=main)](https://github.com/aws/smithy-go/actions/workflows/codegen.yml) -[Smithy](https://smithy.io/) code generators for Go. +[Smithy](https://smithy.io/) code generators for Go and the accompanying smithy-go runtime. + +The smithy-go runtime requires a minimum version of Go 1.20. **WARNING: All interfaces are subject to change.** -## Can I use this? +## Can I use the code generators? In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java), such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html), in order to generate transport mechanisms and serialization/deserialization code ("serde") accordingly. -The code generator does not currently support any protocols out of the box, +The code generator does not currently support any protocols out of the box other than the new `smithy.protocols#rpcv2Cbor`, therefore the useability of this project on its own is currently limited. Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are @@ -21,6 +23,70 @@ tracking the movement of those out of the SDK into smithy-go in [#458](https://github.com/aws/smithy-go/issues/458), but there's currently no timeline for doing so. +## Plugins + +This repository implements the following Smithy build plugins: + +| ID | GAV prefix | Description | +|----|------------|-------------| +| `go-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go client code generation for Smithy models. | +| `go-server-codegen` | `software.amazon.smithy.go:smithy-go-codegen` | Implements Go server code generation for Smithy models. | + +**NOTE: Build plugins are not currently published to mavenCentral. You must publish to mavenLocal to make the build plugins visible to the Smithy CLI. The artifact version is currently fixed at 0.1.0.** + +## `go-codegen` + +### Configuration + +[`GoSettings`](codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoSettings.java) +contains all of the settings enabled from `smithy-build.json` and helper +methods and types. The up-to-date list of top-level properties enabled for +`go-client-codegen` can be found in `GoSettings::from()`. + +| Setting | Type | Required | Description | +|-----------------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------| +| `service` | string | yes | The Shape ID of the service for which to generate the client. | +| `module` | string | yes | Name of the module in `generated.json` (and `go.mod` if `generateGoMod` is enabled) and `doc.go`. | +| `generateGoMod` | boolean | | Whether to generate a default `go.mod` file. The default value is `false`. | +| `goDirective` | string | | [Go directive](https://go.dev/ref/mod#go-mod-file-go) of the module. The default value is the minimum supported Go version. | + +### Supported protocols + +| Protocol | Notes | +|----------|-------| +| [`smithy.protocols#rpcv2Cbor`](https://smithy.io/2.0/additional-specs/protocols/smithy-rpc-v2.html) | Event streaming not yet implemented. | + +### Example + +This example applies the `go-codegen` build plugin to the Smithy quickstart +example created from `smithy init`: + +```json +{ + "version": "1.0", + "sources": [ + "models" + ], + "maven": { + "dependencies": [ + "software.amazon.smithy.go:smithy-go-codegen:0.1.0" + ] + }, + "plugins": { + "go-codegen": { + "service": "example.weather#Weather", + "module": "github.com/example/weather", + "generateGoMod": true, + "goDirective": "1.20" + } + } +} +``` + +## `go-server-codegen` + +This plugin is a work-in-progress and is currently undocumented. + ## License This project is licensed under the Apache-2.0 License. diff --git a/vendor/github.com/aws/smithy-go/auth/auth.go b/vendor/github.com/aws/smithy-go/auth/auth.go new file mode 100644 index 00000000..5bdb70c9 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/auth.go @@ -0,0 +1,3 @@ +// Package auth defines protocol-agnostic authentication types for smithy +// clients. +package auth diff --git a/vendor/github.com/aws/smithy-go/auth/identity.go b/vendor/github.com/aws/smithy-go/auth/identity.go new file mode 100644 index 00000000..ba8cf70d --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/identity.go @@ -0,0 +1,47 @@ +package auth + +import ( + "context" + "time" + + "github.com/aws/smithy-go" +) + +// Identity contains information that identifies who the user making the +// request is. +type Identity interface { + Expiration() time.Time +} + +// IdentityResolver defines the interface through which an Identity is +// retrieved. +type IdentityResolver interface { + GetIdentity(context.Context, smithy.Properties) (Identity, error) +} + +// IdentityResolverOptions defines the interface through which an entity can be +// queried to retrieve an IdentityResolver for a given auth scheme. +type IdentityResolverOptions interface { + GetIdentityResolver(schemeID string) IdentityResolver +} + +// AnonymousIdentity is a sentinel to indicate no identity. +type AnonymousIdentity struct{} + +var _ Identity = (*AnonymousIdentity)(nil) + +// Expiration returns the zero value for time, as anonymous identity never +// expires. +func (*AnonymousIdentity) Expiration() time.Time { + return time.Time{} +} + +// AnonymousIdentityResolver returns AnonymousIdentity. +type AnonymousIdentityResolver struct{} + +var _ IdentityResolver = (*AnonymousIdentityResolver)(nil) + +// GetIdentity returns AnonymousIdentity. +func (*AnonymousIdentityResolver) GetIdentity(_ context.Context, _ smithy.Properties) (Identity, error) { + return &AnonymousIdentity{}, nil +} diff --git a/vendor/github.com/aws/smithy-go/auth/option.go b/vendor/github.com/aws/smithy-go/auth/option.go new file mode 100644 index 00000000..d5dabff0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/option.go @@ -0,0 +1,25 @@ +package auth + +import "github.com/aws/smithy-go" + +type ( + authOptionsKey struct{} +) + +// Option represents a possible authentication method for an operation. +type Option struct { + SchemeID string + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +// GetAuthOptions gets auth Options from Properties. +func GetAuthOptions(p *smithy.Properties) ([]*Option, bool) { + v, ok := p.Get(authOptionsKey{}).([]*Option) + return v, ok +} + +// SetAuthOptions sets auth Options on Properties. +func SetAuthOptions(p *smithy.Properties, options []*Option) { + p.Set(authOptionsKey{}, options) +} diff --git a/vendor/github.com/aws/smithy-go/auth/scheme_id.go b/vendor/github.com/aws/smithy-go/auth/scheme_id.go new file mode 100644 index 00000000..fb6a57c6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/auth/scheme_id.go @@ -0,0 +1,20 @@ +package auth + +// Anonymous +const ( + SchemeIDAnonymous = "smithy.api#noAuth" +) + +// HTTP auth schemes +const ( + SchemeIDHTTPBasic = "smithy.api#httpBasicAuth" + SchemeIDHTTPDigest = "smithy.api#httpDigestAuth" + SchemeIDHTTPBearer = "smithy.api#httpBearerAuth" + SchemeIDHTTPAPIKey = "smithy.api#httpApiKeyAuth" +) + +// AWS auth schemes +const ( + SchemeIDSigV4 = "aws.auth#sigv4" + SchemeIDSigV4A = "aws.auth#sigv4a" +) diff --git a/vendor/github.com/aws/smithy-go/container/private/cache/cache.go b/vendor/github.com/aws/smithy-go/container/private/cache/cache.go new file mode 100644 index 00000000..69af8775 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/container/private/cache/cache.go @@ -0,0 +1,19 @@ +// Package cache defines the interface for a key-based data store. +// +// This package is designated as private and is intended for use only by the +// smithy client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package cache + +// Cache defines the interface for an opaquely-typed, key-based data store. +// +// The thread-safety of this interface is undefined and is dictated by +// implementations. +type Cache interface { + // Retrieve the value associated with the given key. The returned boolean + // indicates whether the cache held a value for the given key. + Get(k interface{}) (interface{}, bool) + + // Store a value under the given key. + Put(k interface{}, v interface{}) +} diff --git a/vendor/github.com/aws/smithy-go/container/private/cache/lru/lru.go b/vendor/github.com/aws/smithy-go/container/private/cache/lru/lru.go new file mode 100644 index 00000000..02ecb0a3 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/container/private/cache/lru/lru.go @@ -0,0 +1,63 @@ +// Package lru implements [cache.Cache] with an LRU eviction policy. +// +// This implementation is NOT thread-safe. +// +// This package is designated as private and is intended for use only by the +// smithy client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package lru + +import ( + "container/list" + + "github.com/aws/smithy-go/container/private/cache" +) + +// New creates a new LRU cache with the given capacity. +func New(cap int) cache.Cache { + return &lru{ + entries: make(map[interface{}]*list.Element, cap), + cap: cap, + mru: list.New(), + } +} + +type lru struct { + entries map[interface{}]*list.Element + cap int + + mru *list.List // least-recently used is at the back +} + +type element struct { + key interface{} + value interface{} +} + +func (l *lru) Get(k interface{}) (interface{}, bool) { + e, ok := l.entries[k] + if !ok { + return nil, false + } + + l.mru.MoveToFront(e) + return e.Value.(*element).value, true +} + +func (l *lru) Put(k interface{}, v interface{}) { + if len(l.entries) == l.cap { + l.evict() + } + + ev := &element{ + key: k, + value: v, + } + e := l.mru.PushFront(ev) + l.entries[k] = e +} + +func (l *lru) evict() { + e := l.mru.Remove(l.mru.Back()) + delete(l.entries, e.(*element).key) +} diff --git a/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go b/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go index e78926c9..9ae30854 100644 --- a/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go +++ b/vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.go @@ -22,33 +22,33 @@ func bufCap(b []byte, n int) []byte { // replacePathElement replaces a single element in the path []byte. // Escape is used to control whether the value will be escaped using Amazon path escape style. func replacePathElement(path, fieldBuf []byte, key, val string, escape bool) ([]byte, []byte, error) { - fieldBuf = bufCap(fieldBuf, len(key)+3) // { [+] } + // search for "{}". If not found, search for the greedy version "{+}". If none are found, return error + fieldBuf = bufCap(fieldBuf, len(key)+2) // { } fieldBuf = append(fieldBuf, uriTokenStart) fieldBuf = append(fieldBuf, key...) + fieldBuf = append(fieldBuf, uriTokenStop) start := bytes.Index(path, fieldBuf) - end := start + len(fieldBuf) - if start < 0 || len(path[end:]) == 0 { - // TODO what to do about error? - return path, fieldBuf, fmt.Errorf("invalid path index, start=%d,end=%d. %s", start, end, path) - } - encodeSep := true - if path[end] == uriTokenSkip { - // '+' token means do not escape slashes + if start < 0 { + fieldBuf = bufCap(fieldBuf, len(key)+3) // { [+] } + fieldBuf = append(fieldBuf, uriTokenStart) + fieldBuf = append(fieldBuf, key...) + fieldBuf = append(fieldBuf, uriTokenSkip) + fieldBuf = append(fieldBuf, uriTokenStop) + + start = bytes.Index(path, fieldBuf) + if start < 0 { + return path, fieldBuf, fmt.Errorf("invalid path index, start=%d. %s", start, path) + } encodeSep = false - end++ } + end := start + len(fieldBuf) if escape { val = EscapePath(val, encodeSep) } - if path[end] != uriTokenStop { - return path, fieldBuf, fmt.Errorf("invalid path element, does not contain token stop, %s", path) - } - end++ - fieldBuf = bufCap(fieldBuf, len(val)) fieldBuf = append(fieldBuf, val...) diff --git a/vendor/github.com/aws/smithy-go/encoding/json/array.go b/vendor/github.com/aws/smithy-go/encoding/json/array.go new file mode 100644 index 00000000..7a232f66 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/array.go @@ -0,0 +1,35 @@ +package json + +import ( + "bytes" +) + +// Array represents the encoding of a JSON Array +type Array struct { + w *bytes.Buffer + writeComma bool + scratch *[]byte +} + +func newArray(w *bytes.Buffer, scratch *[]byte) *Array { + w.WriteRune(leftBracket) + return &Array{w: w, scratch: scratch} +} + +// Value adds a new element to the JSON Array. +// Returns a Value type that is used to encode +// the array element. +func (a *Array) Value() Value { + if a.writeComma { + a.w.WriteRune(comma) + } else { + a.writeComma = true + } + + return newValue(a.w, a.scratch) +} + +// Close encodes the end of the JSON Array +func (a *Array) Close() { + a.w.WriteRune(rightBracket) +} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/constants.go b/vendor/github.com/aws/smithy-go/encoding/json/constants.go new file mode 100644 index 00000000..91044092 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/constants.go @@ -0,0 +1,15 @@ +package json + +const ( + leftBrace = '{' + rightBrace = '}' + + leftBracket = '[' + rightBracket = ']' + + comma = ',' + quote = '"' + colon = ':' + + null = "null" +) diff --git a/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go b/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go new file mode 100644 index 00000000..7050c85b --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/decoder_util.go @@ -0,0 +1,139 @@ +package json + +import ( + "bytes" + "encoding/json" + "fmt" + "io" +) + +// DiscardUnknownField discards unknown fields from a decoder body. +// This function is useful while deserializing a JSON body with additional +// unknown information that should be discarded. +func DiscardUnknownField(decoder *json.Decoder) error { + // This deliberately does not share logic with CollectUnknownField, even + // though it could, because if we were to delegate to that then we'd incur + // extra allocations and general memory usage. + v, err := decoder.Token() + if err == io.EOF { + return nil + } + if err != nil { + return err + } + + if _, ok := v.(json.Delim); ok { + for decoder.More() { + err = DiscardUnknownField(decoder) + } + endToken, err := decoder.Token() + if err != nil { + return err + } + if _, ok := endToken.(json.Delim); !ok { + return fmt.Errorf("invalid JSON : expected json delimiter, found %T %v", + endToken, endToken) + } + } + + return nil +} + +// CollectUnknownField grabs the contents of unknown fields from the decoder body +// and returns them as a byte slice. This is useful for skipping unknown fields without +// completely discarding them. +func CollectUnknownField(decoder *json.Decoder) ([]byte, error) { + result, err := collectUnknownField(decoder) + if err != nil { + return nil, err + } + + buff := bytes.NewBuffer(nil) + encoder := json.NewEncoder(buff) + + if err := encoder.Encode(result); err != nil { + return nil, err + } + + return buff.Bytes(), nil +} + +func collectUnknownField(decoder *json.Decoder) (interface{}, error) { + // Grab the initial value. This could either be a concrete value like a string or a a + // delimiter. + token, err := decoder.Token() + if err == io.EOF { + return nil, nil + } + if err != nil { + return nil, err + } + + // If it's an array or object, we'll need to recurse. + delim, ok := token.(json.Delim) + if ok { + var result interface{} + if delim == '{' { + result, err = collectUnknownObject(decoder) + if err != nil { + return nil, err + } + } else { + result, err = collectUnknownArray(decoder) + if err != nil { + return nil, err + } + } + + // Discard the closing token. decoder.Token handles checking for matching delimiters + if _, err := decoder.Token(); err != nil { + return nil, err + } + return result, nil + } + + return token, nil +} + +func collectUnknownArray(decoder *json.Decoder) ([]interface{}, error) { + // We need to create an empty array here instead of a nil array, since by getting + // into this function at all we necessarily have seen a non-nil list. + array := []interface{}{} + + for decoder.More() { + value, err := collectUnknownField(decoder) + if err != nil { + return nil, err + } + array = append(array, value) + } + + return array, nil +} + +func collectUnknownObject(decoder *json.Decoder) (map[string]interface{}, error) { + object := make(map[string]interface{}) + + for decoder.More() { + key, err := collectUnknownField(decoder) + if err != nil { + return nil, err + } + + // Keys have to be strings, which is particularly important as the encoder + // won't except a map with interface{} keys + stringKey, ok := key.(string) + if !ok { + return nil, fmt.Errorf("expected string key, found %T", key) + } + + value, err := collectUnknownField(decoder) + if err != nil { + return nil, err + } + + object[stringKey] = value + } + + return object, nil +} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/encoder.go b/vendor/github.com/aws/smithy-go/encoding/json/encoder.go new file mode 100644 index 00000000..8772953f --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/encoder.go @@ -0,0 +1,30 @@ +package json + +import ( + "bytes" +) + +// Encoder is JSON encoder that supports construction of JSON values +// using methods. +type Encoder struct { + w *bytes.Buffer + Value +} + +// NewEncoder returns a new JSON encoder +func NewEncoder() *Encoder { + writer := bytes.NewBuffer(nil) + scratch := make([]byte, 64) + + return &Encoder{w: writer, Value: newValue(writer, &scratch)} +} + +// String returns the String output of the JSON encoder +func (e Encoder) String() string { + return e.w.String() +} + +// Bytes returns the []byte slice of the JSON encoder +func (e Encoder) Bytes() []byte { + return e.w.Bytes() +} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/escape.go b/vendor/github.com/aws/smithy-go/encoding/json/escape.go new file mode 100644 index 00000000..d984d0cd --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/escape.go @@ -0,0 +1,198 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Copied and modified from Go 1.8 stdlib's encoding/json/#safeSet + +package json + +import ( + "bytes" + "unicode/utf8" +) + +// safeSet holds the value true if the ASCII character with the given array +// position can be represented inside a JSON string without any further +// escaping. +// +// All values are true except for the ASCII control characters (0-31), the +// double quote ("), and the backslash character ("\"). +var safeSet = [utf8.RuneSelf]bool{ + ' ': true, + '!': true, + '"': false, + '#': true, + '$': true, + '%': true, + '&': true, + '\'': true, + '(': true, + ')': true, + '*': true, + '+': true, + ',': true, + '-': true, + '.': true, + '/': true, + '0': true, + '1': true, + '2': true, + '3': true, + '4': true, + '5': true, + '6': true, + '7': true, + '8': true, + '9': true, + ':': true, + ';': true, + '<': true, + '=': true, + '>': true, + '?': true, + '@': true, + 'A': true, + 'B': true, + 'C': true, + 'D': true, + 'E': true, + 'F': true, + 'G': true, + 'H': true, + 'I': true, + 'J': true, + 'K': true, + 'L': true, + 'M': true, + 'N': true, + 'O': true, + 'P': true, + 'Q': true, + 'R': true, + 'S': true, + 'T': true, + 'U': true, + 'V': true, + 'W': true, + 'X': true, + 'Y': true, + 'Z': true, + '[': true, + '\\': false, + ']': true, + '^': true, + '_': true, + '`': true, + 'a': true, + 'b': true, + 'c': true, + 'd': true, + 'e': true, + 'f': true, + 'g': true, + 'h': true, + 'i': true, + 'j': true, + 'k': true, + 'l': true, + 'm': true, + 'n': true, + 'o': true, + 'p': true, + 'q': true, + 'r': true, + 's': true, + 't': true, + 'u': true, + 'v': true, + 'w': true, + 'x': true, + 'y': true, + 'z': true, + '{': true, + '|': true, + '}': true, + '~': true, + '\u007f': true, +} + +// copied from Go 1.8 stdlib's encoding/json/#hex +var hex = "0123456789abcdef" + +// escapeStringBytes escapes and writes the passed in string bytes to the dst +// buffer +// +// Copied and modifed from Go 1.8 stdlib's encodeing/json/#encodeState.stringBytes +func escapeStringBytes(e *bytes.Buffer, s []byte) { + e.WriteByte('"') + start := 0 + for i := 0; i < len(s); { + if b := s[i]; b < utf8.RuneSelf { + if safeSet[b] { + i++ + continue + } + if start < i { + e.Write(s[start:i]) + } + switch b { + case '\\', '"': + e.WriteByte('\\') + e.WriteByte(b) + case '\n': + e.WriteByte('\\') + e.WriteByte('n') + case '\r': + e.WriteByte('\\') + e.WriteByte('r') + case '\t': + e.WriteByte('\\') + e.WriteByte('t') + default: + // This encodes bytes < 0x20 except for \t, \n and \r. + // If escapeHTML is set, it also escapes <, >, and & + // because they can lead to security holes when + // user-controlled strings are rendered into JSON + // and served to some browsers. + e.WriteString(`\u00`) + e.WriteByte(hex[b>>4]) + e.WriteByte(hex[b&0xF]) + } + i++ + start = i + continue + } + c, size := utf8.DecodeRune(s[i:]) + if c == utf8.RuneError && size == 1 { + if start < i { + e.Write(s[start:i]) + } + e.WriteString(`\ufffd`) + i += size + start = i + continue + } + // U+2028 is LINE SEPARATOR. + // U+2029 is PARAGRAPH SEPARATOR. + // They are both technically valid characters in JSON strings, + // but don't work in JSONP, which has to be evaluated as JavaScript, + // and can lead to security holes there. It is valid JSON to + // escape them, so we do so unconditionally. + // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion. + if c == '\u2028' || c == '\u2029' { + if start < i { + e.Write(s[start:i]) + } + e.WriteString(`\u202`) + e.WriteByte(hex[c&0xF]) + i += size + start = i + continue + } + i += size + } + if start < len(s) { + e.Write(s[start:]) + } + e.WriteByte('"') +} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/object.go b/vendor/github.com/aws/smithy-go/encoding/json/object.go new file mode 100644 index 00000000..722346d0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/object.go @@ -0,0 +1,40 @@ +package json + +import ( + "bytes" +) + +// Object represents the encoding of a JSON Object type +type Object struct { + w *bytes.Buffer + writeComma bool + scratch *[]byte +} + +func newObject(w *bytes.Buffer, scratch *[]byte) *Object { + w.WriteRune(leftBrace) + return &Object{w: w, scratch: scratch} +} + +func (o *Object) writeKey(key string) { + escapeStringBytes(o.w, []byte(key)) + o.w.WriteRune(colon) +} + +// Key adds the given named key to the JSON object. +// Returns a Value encoder that should be used to encode +// a JSON value type. +func (o *Object) Key(name string) Value { + if o.writeComma { + o.w.WriteRune(comma) + } else { + o.writeComma = true + } + o.writeKey(name) + return newValue(o.w, o.scratch) +} + +// Close encodes the end of the JSON Object +func (o *Object) Close() { + o.w.WriteRune(rightBrace) +} diff --git a/vendor/github.com/aws/smithy-go/encoding/json/value.go b/vendor/github.com/aws/smithy-go/encoding/json/value.go new file mode 100644 index 00000000..b41ff1e1 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/encoding/json/value.go @@ -0,0 +1,149 @@ +package json + +import ( + "bytes" + "encoding/base64" + "math/big" + "strconv" + + "github.com/aws/smithy-go/encoding" +) + +// Value represents a JSON Value type +// JSON Value types: Object, Array, String, Number, Boolean, and Null +type Value struct { + w *bytes.Buffer + scratch *[]byte +} + +// newValue returns a new Value encoder +func newValue(w *bytes.Buffer, scratch *[]byte) Value { + return Value{w: w, scratch: scratch} +} + +// String encodes v as a JSON string +func (jv Value) String(v string) { + escapeStringBytes(jv.w, []byte(v)) +} + +// Byte encodes v as a JSON number +func (jv Value) Byte(v int8) { + jv.Long(int64(v)) +} + +// Short encodes v as a JSON number +func (jv Value) Short(v int16) { + jv.Long(int64(v)) +} + +// Integer encodes v as a JSON number +func (jv Value) Integer(v int32) { + jv.Long(int64(v)) +} + +// Long encodes v as a JSON number +func (jv Value) Long(v int64) { + *jv.scratch = strconv.AppendInt((*jv.scratch)[:0], v, 10) + jv.w.Write(*jv.scratch) +} + +// ULong encodes v as a JSON number +func (jv Value) ULong(v uint64) { + *jv.scratch = strconv.AppendUint((*jv.scratch)[:0], v, 10) + jv.w.Write(*jv.scratch) +} + +// Float encodes v as a JSON number +func (jv Value) Float(v float32) { + jv.float(float64(v), 32) +} + +// Double encodes v as a JSON number +func (jv Value) Double(v float64) { + jv.float(v, 64) +} + +func (jv Value) float(v float64, bits int) { + *jv.scratch = encoding.EncodeFloat((*jv.scratch)[:0], v, bits) + jv.w.Write(*jv.scratch) +} + +// Boolean encodes v as a JSON boolean +func (jv Value) Boolean(v bool) { + *jv.scratch = strconv.AppendBool((*jv.scratch)[:0], v) + jv.w.Write(*jv.scratch) +} + +// Base64EncodeBytes writes v as a base64 value in JSON string +func (jv Value) Base64EncodeBytes(v []byte) { + encodeByteSlice(jv.w, (*jv.scratch)[:0], v) +} + +// Write writes v directly to the JSON document +func (jv Value) Write(v []byte) { + jv.w.Write(v) +} + +// Array returns a new Array encoder +func (jv Value) Array() *Array { + return newArray(jv.w, jv.scratch) +} + +// Object returns a new Object encoder +func (jv Value) Object() *Object { + return newObject(jv.w, jv.scratch) +} + +// Null encodes a null JSON value +func (jv Value) Null() { + jv.w.WriteString(null) +} + +// BigInteger encodes v as JSON value +func (jv Value) BigInteger(v *big.Int) { + jv.w.Write([]byte(v.Text(10))) +} + +// BigDecimal encodes v as JSON value +func (jv Value) BigDecimal(v *big.Float) { + if i, accuracy := v.Int64(); accuracy == big.Exact { + jv.Long(i) + return + } + // TODO: Should this try to match ES6 ToString similar to stdlib JSON? + jv.w.Write([]byte(v.Text('e', -1))) +} + +// Based on encoding/json encodeByteSlice from the Go Standard Library +// https://golang.org/src/encoding/json/encode.go +func encodeByteSlice(w *bytes.Buffer, scratch []byte, v []byte) { + if v == nil { + w.WriteString(null) + return + } + + w.WriteRune(quote) + + encodedLen := base64.StdEncoding.EncodedLen(len(v)) + if encodedLen <= len(scratch) { + // If the encoded bytes fit in e.scratch, avoid an extra + // allocation and use the cheaper Encoding.Encode. + dst := scratch[:encodedLen] + base64.StdEncoding.Encode(dst, v) + w.Write(dst) + } else if encodedLen <= 1024 { + // The encoded bytes are short enough to allocate for, and + // Encoding.Encode is still cheaper. + dst := make([]byte, encodedLen) + base64.StdEncoding.Encode(dst, v) + w.Write(dst) + } else { + // The encoded bytes are too long to cheaply allocate, and + // Encoding.Encode is no longer noticeably cheaper. + enc := base64.NewEncoder(base64.StdEncoding, w) + enc.Write(v) + enc.Close() + } + + w.WriteRune(quote) +} diff --git a/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/strings.go b/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/strings.go index 8e230783..5cf4a7b0 100644 --- a/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/strings.go +++ b/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/strings.go @@ -1,6 +1,5 @@ package rulesfn - // Substring returns the substring of the input provided. If the start or stop // indexes are not valid for the input nil will be returned. If errors occur // they will be added to the provided [ErrorCollector]. diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index d96be806..212eae4f 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.16.0" +const goModuleVersion = "1.22.1" diff --git a/vendor/github.com/aws/smithy-go/metrics/metrics.go b/vendor/github.com/aws/smithy-go/metrics/metrics.go new file mode 100644 index 00000000..c009d9f2 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/metrics/metrics.go @@ -0,0 +1,136 @@ +// Package metrics defines the metrics APIs used by Smithy clients. +package metrics + +import ( + "context" + + "github.com/aws/smithy-go" +) + +// MeterProvider is the entry point for creating a Meter. +type MeterProvider interface { + Meter(scope string, opts ...MeterOption) Meter +} + +// MeterOption applies configuration to a Meter. +type MeterOption func(o *MeterOptions) + +// MeterOptions represents configuration for a Meter. +type MeterOptions struct { + Properties smithy.Properties +} + +// Meter is the entry point for creation of measurement instruments. +type Meter interface { + // integer/synchronous + Int64Counter(name string, opts ...InstrumentOption) (Int64Counter, error) + Int64UpDownCounter(name string, opts ...InstrumentOption) (Int64UpDownCounter, error) + Int64Gauge(name string, opts ...InstrumentOption) (Int64Gauge, error) + Int64Histogram(name string, opts ...InstrumentOption) (Int64Histogram, error) + + // integer/asynchronous + Int64AsyncCounter(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) + Int64AsyncUpDownCounter(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) + Int64AsyncGauge(name string, callback Int64Callback, opts ...InstrumentOption) (AsyncInstrument, error) + + // floating-point/synchronous + Float64Counter(name string, opts ...InstrumentOption) (Float64Counter, error) + Float64UpDownCounter(name string, opts ...InstrumentOption) (Float64UpDownCounter, error) + Float64Gauge(name string, opts ...InstrumentOption) (Float64Gauge, error) + Float64Histogram(name string, opts ...InstrumentOption) (Float64Histogram, error) + + // floating-point/asynchronous + Float64AsyncCounter(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) + Float64AsyncUpDownCounter(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) + Float64AsyncGauge(name string, callback Float64Callback, opts ...InstrumentOption) (AsyncInstrument, error) +} + +// InstrumentOption applies configuration to an instrument. +type InstrumentOption func(o *InstrumentOptions) + +// InstrumentOptions represents configuration for an instrument. +type InstrumentOptions struct { + UnitLabel string + Description string +} + +// Int64Counter measures a monotonically increasing int64 value. +type Int64Counter interface { + Add(context.Context, int64, ...RecordMetricOption) +} + +// Int64UpDownCounter measures a fluctuating int64 value. +type Int64UpDownCounter interface { + Add(context.Context, int64, ...RecordMetricOption) +} + +// Int64Gauge samples a discrete int64 value. +type Int64Gauge interface { + Sample(context.Context, int64, ...RecordMetricOption) +} + +// Int64Histogram records multiple data points for an int64 value. +type Int64Histogram interface { + Record(context.Context, int64, ...RecordMetricOption) +} + +// Float64Counter measures a monotonically increasing float64 value. +type Float64Counter interface { + Add(context.Context, float64, ...RecordMetricOption) +} + +// Float64UpDownCounter measures a fluctuating float64 value. +type Float64UpDownCounter interface { + Add(context.Context, float64, ...RecordMetricOption) +} + +// Float64Gauge samples a discrete float64 value. +type Float64Gauge interface { + Sample(context.Context, float64, ...RecordMetricOption) +} + +// Float64Histogram records multiple data points for an float64 value. +type Float64Histogram interface { + Record(context.Context, float64, ...RecordMetricOption) +} + +// AsyncInstrument is the universal handle returned for creation of all async +// instruments. +// +// Callers use the Stop() API to unregister the callback passed at instrument +// creation. +type AsyncInstrument interface { + Stop() +} + +// Int64Callback describes a function invoked when an async int64 instrument is +// read. +type Int64Callback func(context.Context, Int64Observer) + +// Int64Observer is the interface passed to async int64 instruments. +// +// Callers use the Observe() API of this interface to report metrics to the +// underlying collector. +type Int64Observer interface { + Observe(context.Context, int64, ...RecordMetricOption) +} + +// Float64Callback describes a function invoked when an async float64 +// instrument is read. +type Float64Callback func(context.Context, Float64Observer) + +// Float64Observer is the interface passed to async int64 instruments. +// +// Callers use the Observe() API of this interface to report metrics to the +// underlying collector. +type Float64Observer interface { + Observe(context.Context, float64, ...RecordMetricOption) +} + +// RecordMetricOption applies configuration to a recorded metric. +type RecordMetricOption func(o *RecordMetricOptions) + +// RecordMetricOptions represents configuration for a recorded metric. +type RecordMetricOptions struct { + Properties smithy.Properties +} diff --git a/vendor/github.com/aws/smithy-go/metrics/nop.go b/vendor/github.com/aws/smithy-go/metrics/nop.go new file mode 100644 index 00000000..fb374e1f --- /dev/null +++ b/vendor/github.com/aws/smithy-go/metrics/nop.go @@ -0,0 +1,67 @@ +package metrics + +import "context" + +// NopMeterProvider is a no-op metrics implementation. +type NopMeterProvider struct{} + +var _ MeterProvider = (*NopMeterProvider)(nil) + +// Meter returns a meter which creates no-op instruments. +func (NopMeterProvider) Meter(string, ...MeterOption) Meter { + return nopMeter{} +} + +type nopMeter struct{} + +var _ Meter = (*nopMeter)(nil) + +func (nopMeter) Int64Counter(string, ...InstrumentOption) (Int64Counter, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64UpDownCounter(string, ...InstrumentOption) (Int64UpDownCounter, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64Gauge(string, ...InstrumentOption) (Int64Gauge, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64Histogram(string, ...InstrumentOption) (Int64Histogram, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64AsyncCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64AsyncUpDownCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Int64AsyncGauge(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[int64]{}, nil +} +func (nopMeter) Float64Counter(string, ...InstrumentOption) (Float64Counter, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64UpDownCounter(string, ...InstrumentOption) (Float64UpDownCounter, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64Gauge(string, ...InstrumentOption) (Float64Gauge, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64Histogram(string, ...InstrumentOption) (Float64Histogram, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64AsyncCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64AsyncUpDownCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[float64]{}, nil +} +func (nopMeter) Float64AsyncGauge(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrument[float64]{}, nil +} + +type nopInstrument[N any] struct{} + +func (nopInstrument[N]) Add(context.Context, N, ...RecordMetricOption) {} +func (nopInstrument[N]) Sample(context.Context, N, ...RecordMetricOption) {} +func (nopInstrument[N]) Record(context.Context, N, ...RecordMetricOption) {} +func (nopInstrument[_]) Stop() {} diff --git a/vendor/github.com/aws/smithy-go/middleware/context.go b/vendor/github.com/aws/smithy-go/middleware/context.go new file mode 100644 index 00000000..f51aa4f0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/middleware/context.go @@ -0,0 +1,41 @@ +package middleware + +import "context" + +type ( + serviceIDKey struct{} + operationNameKey struct{} +) + +// WithServiceID adds a service ID to the context, scoped to middleware stack +// values. +// +// This API is called in the client runtime when bootstrapping an operation and +// should not typically be used directly. +func WithServiceID(parent context.Context, id string) context.Context { + return WithStackValue(parent, serviceIDKey{}, id) +} + +// GetServiceID retrieves the service ID from the context. This is typically +// the service shape's name from its Smithy model. Service clients for specific +// systems (e.g. AWS SDK) may use an alternate designated value. +func GetServiceID(ctx context.Context) string { + id, _ := GetStackValue(ctx, serviceIDKey{}).(string) + return id +} + +// WithOperationName adds the operation name to the context, scoped to +// middleware stack values. +// +// This API is called in the client runtime when bootstrapping an operation and +// should not typically be used directly. +func WithOperationName(parent context.Context, id string) context.Context { + return WithStackValue(parent, operationNameKey{}, id) +} + +// GetOperationName retrieves the operation name from the context. This is +// typically the operation shape's name from its Smithy model. +func GetOperationName(ctx context.Context) string { + name, _ := GetStackValue(ctx, operationNameKey{}).(string) + return name +} diff --git a/vendor/github.com/aws/smithy-go/modman.toml b/vendor/github.com/aws/smithy-go/modman.toml index 20295cdd..9d94b7cb 100644 --- a/vendor/github.com/aws/smithy-go/modman.toml +++ b/vendor/github.com/aws/smithy-go/modman.toml @@ -1,5 +1,4 @@ [dependencies] - "github.com/google/go-cmp" = "v0.5.8" "github.com/jmespath/go-jmespath" = "v0.4.0" [modules] diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go new file mode 100644 index 00000000..004d78f2 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/gzip.go @@ -0,0 +1,30 @@ +package requestcompression + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" +) + +func gzipCompress(input io.Reader) ([]byte, error) { + var b bytes.Buffer + w, err := gzip.NewWriterLevel(&b, gzip.DefaultCompression) + if err != nil { + return nil, fmt.Errorf("failed to create gzip writer, %v", err) + } + + inBytes, err := io.ReadAll(input) + if err != nil { + return nil, fmt.Errorf("failed read payload to compress, %v", err) + } + + if _, err = w.Write(inBytes); err != nil { + return nil, fmt.Errorf("failed to write payload to be compressed, %v", err) + } + if err = w.Close(); err != nil { + return nil, fmt.Errorf("failed to flush payload being compressed, %v", err) + } + + return b.Bytes(), nil +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go new file mode 100644 index 00000000..06c16afc --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.go @@ -0,0 +1,52 @@ +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "net/http" +) + +const captureUncompressedRequestID = "CaptureUncompressedRequest" + +// AddCaptureUncompressedRequestMiddleware captures http request before compress encoding for check +func AddCaptureUncompressedRequestMiddleware(stack *middleware.Stack, buf *bytes.Buffer) error { + return stack.Serialize.Insert(&captureUncompressedRequestMiddleware{ + buf: buf, + }, "RequestCompression", middleware.Before) +} + +type captureUncompressedRequestMiddleware struct { + req *http.Request + buf *bytes.Buffer + bytes []byte +} + +// ID returns id of the captureUncompressedRequestMiddleware +func (*captureUncompressedRequestMiddleware) ID() string { + return captureUncompressedRequestID +} + +// HandleSerialize captures request payload before it is compressed by request compression middleware +func (m *captureUncompressedRequestMiddleware) HandleSerialize(ctx context.Context, input middleware.SerializeInput, next middleware.SerializeHandler, +) ( + output middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := input.Request.(*smithyhttp.Request) + if !ok { + return output, metadata, fmt.Errorf("error when retrieving http request") + } + + _, err = io.Copy(m.buf, request.GetStream()) + if err != nil { + return output, metadata, fmt.Errorf("error when copying http request stream: %q", err) + } + if err = request.RewindStream(); err != nil { + return output, metadata, fmt.Errorf("error when rewinding request stream: %q", err) + } + + return next.HandleSerialize(ctx, input) +} diff --git a/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go new file mode 100644 index 00000000..7c414760 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.go @@ -0,0 +1,103 @@ +// Package requestcompression implements runtime support for smithy-modeled +// request compression. +// +// This package is designated as private and is intended for use only by the +// smithy client runtime. The exported API therein is not considered stable and +// is subject to breaking changes without notice. +package requestcompression + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/transport/http" + "io" +) + +const MaxRequestMinCompressSizeBytes = 10485760 + +// Enumeration values for supported compress Algorithms. +const ( + GZIP = "gzip" +) + +type compressFunc func(io.Reader) ([]byte, error) + +var allowedAlgorithms = map[string]compressFunc{ + GZIP: gzipCompress, +} + +// AddRequestCompression add requestCompression middleware to op stack +func AddRequestCompression(stack *middleware.Stack, disabled bool, minBytes int64, algorithms []string) error { + return stack.Serialize.Add(&requestCompression{ + disableRequestCompression: disabled, + requestMinCompressSizeBytes: minBytes, + compressAlgorithms: algorithms, + }, middleware.After) +} + +type requestCompression struct { + disableRequestCompression bool + requestMinCompressSizeBytes int64 + compressAlgorithms []string +} + +// ID returns the ID of the middleware +func (m requestCompression) ID() string { + return "RequestCompression" +} + +// HandleSerialize gzip compress the request's stream/body if enabled by config fields +func (m requestCompression) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if m.disableRequestCompression { + return next.HandleSerialize(ctx, in) + } + // still need to check requestMinCompressSizeBytes in case it is out of range after service client config + if m.requestMinCompressSizeBytes < 0 || m.requestMinCompressSizeBytes > MaxRequestMinCompressSizeBytes { + return out, metadata, fmt.Errorf("invalid range for min request compression size bytes %d, must be within 0 and 10485760 inclusively", m.requestMinCompressSizeBytes) + } + + req, ok := in.Request.(*http.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown request type %T", req) + } + + for _, algorithm := range m.compressAlgorithms { + compressFunc := allowedAlgorithms[algorithm] + if compressFunc != nil { + if stream := req.GetStream(); stream != nil { + size, found, err := req.StreamLength() + if err != nil { + return out, metadata, fmt.Errorf("error while finding request stream length, %v", err) + } else if !found || size < m.requestMinCompressSizeBytes { + return next.HandleSerialize(ctx, in) + } + + compressedBytes, err := compressFunc(stream) + if err != nil { + return out, metadata, fmt.Errorf("failed to compress request stream, %v", err) + } + + var newReq *http.Request + if newReq, err = req.SetStream(bytes.NewReader(compressedBytes)); err != nil { + return out, metadata, fmt.Errorf("failed to set request stream, %v", err) + } + *req = *newReq + + if val := req.Header.Get("Content-Encoding"); val != "" { + req.Header.Set("Content-Encoding", fmt.Sprintf("%s, %s", val, algorithm)) + } else { + req.Header.Set("Content-Encoding", algorithm) + } + } + break + } + } + + return next.HandleSerialize(ctx, in) +} diff --git a/vendor/github.com/aws/smithy-go/properties.go b/vendor/github.com/aws/smithy-go/properties.go index 17d659c5..68df4c4e 100644 --- a/vendor/github.com/aws/smithy-go/properties.go +++ b/vendor/github.com/aws/smithy-go/properties.go @@ -1,52 +1,69 @@ package smithy +import "maps" + // PropertiesReader provides an interface for reading metadata from the // underlying metadata container. type PropertiesReader interface { - Get(key interface{}) interface{} + Get(key any) any } // Properties provides storing and reading metadata values. Keys may be any -// comparable value type. Get and set will panic if key is not a comparable -// value type. +// comparable value type. Get and Set will panic if a key is not comparable. // -// Properties uses lazy initialization, and Set method must be called as an -// addressable value, or pointer. Not doing so may cause key/value pair to not -// be set. +// The zero value for a Properties instance is ready for reads/writes without +// any additional initialization. type Properties struct { - values map[interface{}]interface{} + values map[any]any } // Get attempts to retrieve the value the key points to. Returns nil if the // key was not found. // // Panics if key type is not comparable. -func (m *Properties) Get(key interface{}) interface{} { +func (m *Properties) Get(key any) any { + m.lazyInit() return m.values[key] } // Set stores the value pointed to by the key. If a value already exists at // that key it will be replaced with the new value. // -// Set method must be called as an addressable value, or pointer. If Set is not -// called as an addressable value or pointer, the key value pair being set may -// be lost. -// // Panics if the key type is not comparable. -func (m *Properties) Set(key, value interface{}) { - if m.values == nil { - m.values = map[interface{}]interface{}{} - } +func (m *Properties) Set(key, value any) { + m.lazyInit() m.values[key] = value } // Has returns whether the key exists in the metadata. // // Panics if the key type is not comparable. -func (m *Properties) Has(key interface{}) bool { - if m.values == nil { - return false - } +func (m *Properties) Has(key any) bool { + m.lazyInit() _, ok := m.values[key] return ok } + +// SetAll accepts all of the given Properties into the receiver, overwriting +// any existing keys in the case of conflicts. +func (m *Properties) SetAll(other *Properties) { + if other.values == nil { + return + } + + m.lazyInit() + for k, v := range other.values { + m.values[k] = v + } +} + +// Values returns a shallow clone of the property set's values. +func (m *Properties) Values() map[any]any { + return maps.Clone(m.values) +} + +func (m *Properties) lazyInit() { + if m.values == nil { + m.values = map[any]any{} + } +} diff --git a/vendor/github.com/aws/smithy-go/tracing/context.go b/vendor/github.com/aws/smithy-go/tracing/context.go new file mode 100644 index 00000000..a404ed9d --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/context.go @@ -0,0 +1,96 @@ +package tracing + +import "context" + +type ( + operationTracerKey struct{} + spanLineageKey struct{} +) + +// GetSpan returns the active trace Span on the context. +// +// The boolean in the return indicates whether a Span was actually in the +// context, but a no-op implementation will be returned if not, so callers +// can generally disregard the boolean unless they wish to explicitly confirm +// presence/absence of a Span. +func GetSpan(ctx context.Context) (Span, bool) { + lineage := getLineage(ctx) + if len(lineage) == 0 { + return nopSpan{}, false + } + + return lineage[len(lineage)-1], true +} + +// WithSpan sets the active trace Span on the context. +func WithSpan(parent context.Context, span Span) context.Context { + lineage := getLineage(parent) + if len(lineage) == 0 { + return context.WithValue(parent, spanLineageKey{}, []Span{span}) + } + + lineage = append(lineage, span) + return context.WithValue(parent, spanLineageKey{}, lineage) +} + +// PopSpan pops the current Span off the context, setting the active Span on +// the returned Context back to its parent and returning the REMOVED one. +// +// PopSpan on a context with no active Span will return a no-op instance. +// +// This is mostly necessary for the runtime to manage base trace spans due to +// the wrapped-function nature of the middleware stack. End-users of Smithy +// clients SHOULD NOT generally be using this API. +func PopSpan(parent context.Context) (context.Context, Span) { + lineage := getLineage(parent) + if len(lineage) == 0 { + return parent, nopSpan{} + } + + span := lineage[len(lineage)-1] + lineage = lineage[:len(lineage)-1] + return context.WithValue(parent, spanLineageKey{}, lineage), span +} + +func getLineage(ctx context.Context) []Span { + v := ctx.Value(spanLineageKey{}) + if v == nil { + return nil + } + + return v.([]Span) +} + +// GetOperationTracer returns the embedded operation-scoped Tracer on a +// Context. +// +// The boolean in the return indicates whether a Tracer was actually in the +// context, but a no-op implementation will be returned if not, so callers +// can generally disregard the boolean unless they wish to explicitly confirm +// presence/absence of a Tracer. +func GetOperationTracer(ctx context.Context) (Tracer, bool) { + v := ctx.Value(operationTracerKey{}) + if v == nil { + return nopTracer{}, false + } + + return v.(Tracer), true +} + +// WithOperationTracer returns a child Context embedding the given Tracer. +// +// The runtime will use this embed a scoped tracer for client operations, +// Smithy/SDK client callers DO NOT need to do this explicitly. +func WithOperationTracer(parent context.Context, tracer Tracer) context.Context { + return context.WithValue(parent, operationTracerKey{}, tracer) +} + +// StartSpan is a convenience API for creating tracing Spans from a Context. +// +// StartSpan uses the operation-scoped Tracer, previously stored using +// [WithOperationTracer], to start the Span. If a Tracer has not been embedded +// the returned Span will be a no-op implementation. +func StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { + tracer, _ := GetOperationTracer(ctx) + return tracer.StartSpan(ctx, name, opts...) +} diff --git a/vendor/github.com/aws/smithy-go/tracing/nop.go b/vendor/github.com/aws/smithy-go/tracing/nop.go new file mode 100644 index 00000000..573d28b1 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/nop.go @@ -0,0 +1,32 @@ +package tracing + +import "context" + +// NopTracerProvider is a no-op tracing implementation. +type NopTracerProvider struct{} + +var _ TracerProvider = (*NopTracerProvider)(nil) + +// Tracer returns a tracer which creates no-op spans. +func (NopTracerProvider) Tracer(string, ...TracerOption) Tracer { + return nopTracer{} +} + +type nopTracer struct{} + +var _ Tracer = (*nopTracer)(nil) + +func (nopTracer) StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) { + return ctx, nopSpan{} +} + +type nopSpan struct{} + +var _ Span = (*nopSpan)(nil) + +func (nopSpan) Name() string { return "" } +func (nopSpan) Context() SpanContext { return SpanContext{} } +func (nopSpan) AddEvent(string, ...EventOption) {} +func (nopSpan) SetProperty(any, any) {} +func (nopSpan) SetStatus(SpanStatus) {} +func (nopSpan) End() {} diff --git a/vendor/github.com/aws/smithy-go/tracing/tracing.go b/vendor/github.com/aws/smithy-go/tracing/tracing.go new file mode 100644 index 00000000..089ed393 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/tracing/tracing.go @@ -0,0 +1,95 @@ +// Package tracing defines tracing APIs to be used by Smithy clients. +package tracing + +import ( + "context" + + "github.com/aws/smithy-go" +) + +// SpanStatus records the "success" state of an observed span. +type SpanStatus int + +// Enumeration of SpanStatus. +const ( + SpanStatusUnset SpanStatus = iota + SpanStatusOK + SpanStatusError +) + +// SpanKind indicates the nature of the work being performed. +type SpanKind int + +// Enumeration of SpanKind. +const ( + SpanKindInternal SpanKind = iota + SpanKindClient + SpanKindServer + SpanKindProducer + SpanKindConsumer +) + +// TracerProvider is the entry point for creating client traces. +type TracerProvider interface { + Tracer(scope string, opts ...TracerOption) Tracer +} + +// TracerOption applies configuration to a tracer. +type TracerOption func(o *TracerOptions) + +// TracerOptions represent configuration for tracers. +type TracerOptions struct { + Properties smithy.Properties +} + +// Tracer is the entry point for creating observed client Spans. +// +// Spans created by tracers propagate by existing on the Context. Consumers of +// the API can use [GetSpan] to pull the active Span from a Context. +// +// Creation of child Spans is implicit through Context persistence. If +// CreateSpan is called with a Context that holds a Span, the result will be a +// child of that Span. +type Tracer interface { + StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) +} + +// SpanOption applies configuration to a span. +type SpanOption func(o *SpanOptions) + +// SpanOptions represent configuration for span events. +type SpanOptions struct { + Kind SpanKind + Properties smithy.Properties +} + +// Span records a conceptually individual unit of work that takes place in a +// Smithy client operation. +type Span interface { + Name() string + Context() SpanContext + AddEvent(name string, opts ...EventOption) + SetStatus(status SpanStatus) + SetProperty(k, v any) + End() +} + +// EventOption applies configuration to a span event. +type EventOption func(o *EventOptions) + +// EventOptions represent configuration for span events. +type EventOptions struct { + Properties smithy.Properties +} + +// SpanContext uniquely identifies a Span. +type SpanContext struct { + TraceID string + SpanID string + IsRemote bool +} + +// IsValid is true when a span has nonzero trace and span IDs. +func (ctx *SpanContext) IsValid() bool { + return len(ctx.TraceID) != 0 && len(ctx.SpanID) != 0 +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth.go b/vendor/github.com/aws/smithy-go/transport/http/auth.go new file mode 100644 index 00000000..58e1ab5e --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/auth.go @@ -0,0 +1,21 @@ +package http + +import ( + "context" + + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// AuthScheme defines an HTTP authentication scheme. +type AuthScheme interface { + SchemeID() string + IdentityResolver(auth.IdentityResolverOptions) auth.IdentityResolver + Signer() Signer +} + +// Signer defines the interface through which HTTP requests are supplemented +// with an Identity. +type Signer interface { + SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go b/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go new file mode 100644 index 00000000..d60cf2a6 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/auth_schemes.go @@ -0,0 +1,45 @@ +package http + +import ( + "context" + + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/auth" +) + +// NewAnonymousScheme returns the anonymous HTTP auth scheme. +func NewAnonymousScheme() AuthScheme { + return &authScheme{ + schemeID: auth.SchemeIDAnonymous, + signer: &nopSigner{}, + } +} + +// authScheme is parameterized to generically implement the exported AuthScheme +// interface +type authScheme struct { + schemeID string + signer Signer +} + +var _ AuthScheme = (*authScheme)(nil) + +func (s *authScheme) SchemeID() string { + return s.schemeID +} + +func (s *authScheme) IdentityResolver(o auth.IdentityResolverOptions) auth.IdentityResolver { + return o.GetIdentityResolver(s.schemeID) +} + +func (s *authScheme) Signer() Signer { + return s.signer +} + +type nopSigner struct{} + +var _ Signer = (*nopSigner)(nil) + +func (*nopSigner) SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error { + return nil +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/client.go b/vendor/github.com/aws/smithy-go/transport/http/client.go index e691c69b..0fceae81 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/client.go +++ b/vendor/github.com/aws/smithy-go/transport/http/client.go @@ -6,7 +6,9 @@ import ( "net/http" smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/metrics" "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" ) // ClientDo provides the interface for custom HTTP client implementations. @@ -27,13 +29,30 @@ func (fn ClientDoFunc) Do(r *http.Request) (*http.Response, error) { // implementation is http.Client. type ClientHandler struct { client ClientDo + + Meter metrics.Meter // For HTTP client metrics. } // NewClientHandler returns an initialized middleware handler for the client. +// +// Deprecated: Use [NewClientHandlerWithOptions]. func NewClientHandler(client ClientDo) ClientHandler { - return ClientHandler{ + return NewClientHandlerWithOptions(client) +} + +// NewClientHandlerWithOptions returns an initialized middleware handler for the client +// with applied options. +func NewClientHandlerWithOptions(client ClientDo, opts ...func(*ClientHandler)) ClientHandler { + h := ClientHandler{ client: client, } + for _, opt := range opts { + opt(&h) + } + if h.Meter == nil { + h.Meter = metrics.NopMeterProvider{}.Meter("") + } + return h } // Handle implements the middleware Handler interface, that will invoke the @@ -42,6 +61,14 @@ func NewClientHandler(client ClientDo) ClientHandler { func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( out interface{}, metadata middleware.Metadata, err error, ) { + ctx, span := tracing.StartSpan(ctx, "DoHTTPRequest") + defer span.End() + + ctx, client, err := withMetrics(ctx, c.client, c.Meter) + if err != nil { + return nil, metadata, fmt.Errorf("instrument with HTTP metrics: %w", err) + } + req, ok := input.(*Request) if !ok { return nil, metadata, fmt.Errorf("expect Smithy http.Request value as input, got unsupported type %T", input) @@ -52,7 +79,17 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( return nil, metadata, err } - resp, err := c.client.Do(builtRequest) + span.SetProperty("http.method", req.Method) + span.SetProperty("http.request_content_length", -1) // at least indicate unknown + length, ok, err := req.StreamLength() + if err != nil { + return nil, metadata, err + } + if ok { + span.SetProperty("http.request_content_length", length) + } + + resp, err := client.Do(builtRequest) if resp == nil { // Ensure a http response value is always present to prevent unexpected // panics. @@ -79,6 +116,10 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) ( _ = builtRequest.Body.Close() } + span.SetProperty("net.protocol.version", fmt.Sprintf("%d.%d", resp.ProtoMajor, resp.ProtoMinor)) + span.SetProperty("http.status_code", resp.StatusCode) + span.SetProperty("http.response_content_length", resp.ContentLength) + return &Response{Response: resp}, metadata, err } diff --git a/vendor/github.com/aws/smithy-go/transport/http/metrics.go b/vendor/github.com/aws/smithy-go/transport/http/metrics.go new file mode 100644 index 00000000..ab110139 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/metrics.go @@ -0,0 +1,184 @@ +package http + +import ( + "context" + "crypto/tls" + "net/http" + "net/http/httptrace" + "time" + + "github.com/aws/smithy-go/metrics" +) + +var now = time.Now + +// withMetrics instruments an HTTP client and context to collect HTTP metrics. +func withMetrics(parent context.Context, client ClientDo, meter metrics.Meter) ( + context.Context, ClientDo, error, +) { + hm, err := newHTTPMetrics(meter) + if err != nil { + return nil, nil, err + } + + ctx := httptrace.WithClientTrace(parent, &httptrace.ClientTrace{ + DNSStart: hm.DNSStart, + ConnectStart: hm.ConnectStart, + TLSHandshakeStart: hm.TLSHandshakeStart, + + GotConn: hm.GotConn(parent), + PutIdleConn: hm.PutIdleConn(parent), + ConnectDone: hm.ConnectDone(parent), + DNSDone: hm.DNSDone(parent), + TLSHandshakeDone: hm.TLSHandshakeDone(parent), + GotFirstResponseByte: hm.GotFirstResponseByte(parent), + }) + return ctx, &timedClientDo{client, hm}, nil +} + +type timedClientDo struct { + ClientDo + hm *httpMetrics +} + +func (c *timedClientDo) Do(r *http.Request) (*http.Response, error) { + c.hm.doStart = now() + resp, err := c.ClientDo.Do(r) + + c.hm.DoRequestDuration.Record(r.Context(), elapsed(c.hm.doStart)) + return resp, err +} + +type httpMetrics struct { + DNSLookupDuration metrics.Float64Histogram // client.http.connections.dns_lookup_duration + ConnectDuration metrics.Float64Histogram // client.http.connections.acquire_duration + TLSHandshakeDuration metrics.Float64Histogram // client.http.connections.tls_handshake_duration + ConnectionUsage metrics.Int64UpDownCounter // client.http.connections.usage + + DoRequestDuration metrics.Float64Histogram // client.http.do_request_duration + TimeToFirstByte metrics.Float64Histogram // client.http.time_to_first_byte + + doStart time.Time + dnsStart time.Time + connectStart time.Time + tlsStart time.Time +} + +func newHTTPMetrics(meter metrics.Meter) (*httpMetrics, error) { + hm := &httpMetrics{} + + var err error + hm.DNSLookupDuration, err = meter.Float64Histogram("client.http.connections.dns_lookup_duration", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "The time it takes a request to perform DNS lookup." + }) + if err != nil { + return nil, err + } + hm.ConnectDuration, err = meter.Float64Histogram("client.http.connections.acquire_duration", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "The time it takes a request to acquire a connection." + }) + if err != nil { + return nil, err + } + hm.TLSHandshakeDuration, err = meter.Float64Histogram("client.http.connections.tls_handshake_duration", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "The time it takes an HTTP request to perform the TLS handshake." + }) + if err != nil { + return nil, err + } + hm.ConnectionUsage, err = meter.Int64UpDownCounter("client.http.connections.usage", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "{connection}" + o.Description = "Current state of connections pool." + }) + if err != nil { + return nil, err + } + hm.DoRequestDuration, err = meter.Float64Histogram("client.http.do_request_duration", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "Time spent performing an entire HTTP transaction." + }) + if err != nil { + return nil, err + } + hm.TimeToFirstByte, err = meter.Float64Histogram("client.http.time_to_first_byte", func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = "Time from start of transaction to when the first response byte is available." + }) + if err != nil { + return nil, err + } + + return hm, nil +} + +func (m *httpMetrics) DNSStart(httptrace.DNSStartInfo) { + m.dnsStart = now() +} + +func (m *httpMetrics) ConnectStart(string, string) { + m.connectStart = now() +} + +func (m *httpMetrics) TLSHandshakeStart() { + m.tlsStart = now() +} + +func (m *httpMetrics) GotConn(ctx context.Context) func(httptrace.GotConnInfo) { + return func(httptrace.GotConnInfo) { + m.addConnAcquired(ctx, 1) + } +} + +func (m *httpMetrics) PutIdleConn(ctx context.Context) func(error) { + return func(error) { + m.addConnAcquired(ctx, -1) + } +} + +func (m *httpMetrics) DNSDone(ctx context.Context) func(httptrace.DNSDoneInfo) { + return func(httptrace.DNSDoneInfo) { + m.DNSLookupDuration.Record(ctx, elapsed(m.dnsStart)) + } +} + +func (m *httpMetrics) ConnectDone(ctx context.Context) func(string, string, error) { + return func(string, string, error) { + m.ConnectDuration.Record(ctx, elapsed(m.connectStart)) + } +} + +func (m *httpMetrics) TLSHandshakeDone(ctx context.Context) func(tls.ConnectionState, error) { + return func(tls.ConnectionState, error) { + m.TLSHandshakeDuration.Record(ctx, elapsed(m.tlsStart)) + } +} + +func (m *httpMetrics) GotFirstResponseByte(ctx context.Context) func() { + return func() { + m.TimeToFirstByte.Record(ctx, elapsed(m.doStart)) + } +} + +func (m *httpMetrics) addConnAcquired(ctx context.Context, incr int64) { + m.ConnectionUsage.Add(ctx, incr, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("state", "acquired") + }) +} + +// Not used: it is recommended to track acquired vs idle conn, but we can't +// determine when something is truly idle with the current HTTP client hooks +// available to us. +func (m *httpMetrics) addConnIdle(ctx context.Context, incr int64) { + m.ConnectionUsage.Add(ctx, incr, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("state", "idle") + }) +} + +func elapsed(start time.Time) float64 { + end := now() + elapsed := end.Sub(start) + return float64(elapsed) / 1e9 +} diff --git a/vendor/github.com/aws/smithy-go/transport/http/properties.go b/vendor/github.com/aws/smithy-go/transport/http/properties.go new file mode 100644 index 00000000..c65aa393 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/properties.go @@ -0,0 +1,80 @@ +package http + +import smithy "github.com/aws/smithy-go" + +type ( + sigV4SigningNameKey struct{} + sigV4SigningRegionKey struct{} + + sigV4ASigningNameKey struct{} + sigV4ASigningRegionsKey struct{} + + isUnsignedPayloadKey struct{} + disableDoubleEncodingKey struct{} +) + +// GetSigV4SigningName gets the signing name from Properties. +func GetSigV4SigningName(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4SigningNameKey{}).(string) + return v, ok +} + +// SetSigV4SigningName sets the signing name on Properties. +func SetSigV4SigningName(p *smithy.Properties, name string) { + p.Set(sigV4SigningNameKey{}, name) +} + +// GetSigV4SigningRegion gets the signing region from Properties. +func GetSigV4SigningRegion(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4SigningRegionKey{}).(string) + return v, ok +} + +// SetSigV4SigningRegion sets the signing region on Properties. +func SetSigV4SigningRegion(p *smithy.Properties, region string) { + p.Set(sigV4SigningRegionKey{}, region) +} + +// GetSigV4ASigningName gets the v4a signing name from Properties. +func GetSigV4ASigningName(p *smithy.Properties) (string, bool) { + v, ok := p.Get(sigV4ASigningNameKey{}).(string) + return v, ok +} + +// SetSigV4ASigningName sets the signing name on Properties. +func SetSigV4ASigningName(p *smithy.Properties, name string) { + p.Set(sigV4ASigningNameKey{}, name) +} + +// GetSigV4ASigningRegion gets the v4a signing region set from Properties. +func GetSigV4ASigningRegions(p *smithy.Properties) ([]string, bool) { + v, ok := p.Get(sigV4ASigningRegionsKey{}).([]string) + return v, ok +} + +// SetSigV4ASigningRegions sets the v4a signing region set on Properties. +func SetSigV4ASigningRegions(p *smithy.Properties, regions []string) { + p.Set(sigV4ASigningRegionsKey{}, regions) +} + +// GetIsUnsignedPayload gets whether the payload is unsigned from Properties. +func GetIsUnsignedPayload(p *smithy.Properties) (bool, bool) { + v, ok := p.Get(isUnsignedPayloadKey{}).(bool) + return v, ok +} + +// SetIsUnsignedPayload sets whether the payload is unsigned on Properties. +func SetIsUnsignedPayload(p *smithy.Properties, isUnsignedPayload bool) { + p.Set(isUnsignedPayloadKey{}, isUnsignedPayload) +} + +// GetDisableDoubleEncoding gets whether the payload is unsigned from Properties. +func GetDisableDoubleEncoding(p *smithy.Properties) (bool, bool) { + v, ok := p.Get(disableDoubleEncodingKey{}).(bool) + return v, ok +} + +// SetDisableDoubleEncoding sets whether the payload is unsigned on Properties. +func SetDisableDoubleEncoding(p *smithy.Properties, disableDoubleEncoding bool) { + p.Set(disableDoubleEncodingKey{}, disableDoubleEncoding) +} diff --git a/vendor/github.com/snowflakedb/gosnowflake/s3_storage_client.go b/vendor/github.com/snowflakedb/gosnowflake/s3_storage_client.go index ed3bca59..d756b00a 100644 --- a/vendor/github.com/snowflakedb/gosnowflake/s3_storage_client.go +++ b/vendor/github.com/snowflakedb/gosnowflake/s3_storage_client.go @@ -106,7 +106,7 @@ func (util *snowflakeS3Client) getFileHeader(meta *fileMetadata, filename string } return &fileHeader{ out.Metadata[sfcDigest], - out.ContentLength, + *out.ContentLength, &encMeta, }, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index d709a278..d35a0431 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -86,12 +86,14 @@ github.com/apache/arrow/go/v12/parquet/internal/gen-go/parquet # github.com/apache/thrift v0.19.0 ## explicit; go 1.20 github.com/apache/thrift/lib/go/thrift -# github.com/aws/aws-sdk-go-v2 v1.22.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2 v1.32.7 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/arn github.com/aws/aws-sdk-go-v2/aws/defaults github.com/aws/aws-sdk-go-v2/aws/middleware +github.com/aws/aws-sdk-go-v2/aws/protocol/query +github.com/aws/aws-sdk-go-v2/aws/protocol/restjson github.com/aws/aws-sdk-go-v2/aws/protocol/xml github.com/aws/aws-sdk-go-v2/aws/ratelimit github.com/aws/aws-sdk-go-v2/aws/retry @@ -99,75 +101,123 @@ github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4 github.com/aws/aws-sdk-go-v2/aws/signer/v4 github.com/aws/aws-sdk-go-v2/aws/transport/http github.com/aws/aws-sdk-go-v2/internal/auth +github.com/aws/aws-sdk-go-v2/internal/auth/smithy github.com/aws/aws-sdk-go-v2/internal/awsutil +github.com/aws/aws-sdk-go-v2/internal/context +github.com/aws/aws-sdk-go-v2/internal/endpoints github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn +github.com/aws/aws-sdk-go-v2/internal/middleware github.com/aws/aws-sdk-go-v2/internal/rand github.com/aws/aws-sdk-go-v2/internal/sdk github.com/aws/aws-sdk-go-v2/internal/sdkio +github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi -# github.com/aws/aws-sdk-go-v2/credentials v1.15.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/config v1.28.7 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/config +# github.com/aws/aws-sdk-go-v2/credentials v1.17.48 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/credentials -# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.4 -## explicit; go 1.19 +github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds +github.com/aws/aws-sdk-go-v2/credentials/endpointcreds +github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client +github.com/aws/aws-sdk-go-v2/credentials/processcreds +github.com/aws/aws-sdk-go-v2/credentials/ssocreds +github.com/aws/aws-sdk-go-v2/credentials/stscreds +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/feature/ec2/imds +github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config +# github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/feature/s3/manager -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/internal/ini +# github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/internal/v4a github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4 -# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding -# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/checksum -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/internal/s3shared github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config -# github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/rds v1.93.2 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/service/rds +github.com/aws/aws-sdk-go-v2/service/rds/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/rds/types +# github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 +## explicit; go 1.21 github.com/aws/aws-sdk-go-v2/service/s3 github.com/aws/aws-sdk-go-v2/service/s3/internal/arn github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints github.com/aws/aws-sdk-go-v2/service/s3/types -# github.com/aws/smithy-go v1.16.0 -## explicit; go 1.19 +# github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/service/sso +github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/sso/types +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/service/ssooidc +github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/ssooidc/types +# github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 +## explicit; go 1.21 +github.com/aws/aws-sdk-go-v2/service/sts +github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints +github.com/aws/aws-sdk-go-v2/service/sts/types +# github.com/aws/smithy-go v1.22.1 +## explicit; go 1.21 github.com/aws/smithy-go +github.com/aws/smithy-go/auth github.com/aws/smithy-go/auth/bearer +github.com/aws/smithy-go/container/private/cache +github.com/aws/smithy-go/container/private/cache/lru github.com/aws/smithy-go/context github.com/aws/smithy-go/document github.com/aws/smithy-go/encoding github.com/aws/smithy-go/encoding/httpbinding +github.com/aws/smithy-go/encoding/json github.com/aws/smithy-go/encoding/xml github.com/aws/smithy-go/endpoints github.com/aws/smithy-go/endpoints/private/rulesfn github.com/aws/smithy-go/internal/sync/singleflight github.com/aws/smithy-go/io github.com/aws/smithy-go/logging +github.com/aws/smithy-go/metrics github.com/aws/smithy-go/middleware +github.com/aws/smithy-go/private/requestcompression github.com/aws/smithy-go/ptr github.com/aws/smithy-go/rand github.com/aws/smithy-go/sync github.com/aws/smithy-go/time +github.com/aws/smithy-go/tracing github.com/aws/smithy-go/transport/http github.com/aws/smithy-go/transport/http/internal/io github.com/aws/smithy-go/waiter